1D Heat Equation Solver 1.0
Computational Methods Assignment 2025
Loading...
Searching...
No Matches
Richardson Class Reference

Implementation of the explicit Richardson scheme (CTCS). More...

#include <richardson.hpp>

Inheritance diagram for Richardson:
Inheritance graph
Collaboration diagram for Richardson:
Collaboration graph

Public Member Functions

bool uses_previous_step () const noexcept override
 Indicate that this is a three-level scheme.
std::string name () const override
 Get human-readable name of the scheme.
void step (const Grid &g, double D, double dt, const std::vector< double > &Tprev, const std::vector< double > &Tcurr, std::vector< double > &Tnext) const override
 Advance one time step using the Richardson explicit scheme.
Public Member Functions inherited from Method
virtual ~Method ()=default

Detailed Description

Implementation of the explicit Richardson scheme (CTCS).

The scheme reads:

\‍[  T_i^{n+1} = T_i^{n-1} + 2 r \left( T_{i+1}^n - 2 T_i^n + T_{i-1}^n \right),
  \quad r = \frac{D \, \Delta t}{\Delta x^2}
\‍]

It is a three-level scheme, therefore it requires both $T^{n-1}$ and $T^n$ to produce $T^{n+1}$. Boundary conditions are not enforced here, but left to the solver.

Definition at line 26 of file richardson.hpp.

Member Function Documentation

◆ name()

std::string Richardson::name ( ) const
inlineoverridevirtual

Get human-readable name of the scheme.

Returns
"Richardson"

Implements Method.

Definition at line 42 of file richardson.hpp.

◆ step()

void Richardson::step ( const Grid & g,
double D,
double dt,
const std::vector< double > & Tprev,
const std::vector< double > & Tcurr,
std::vector< double > & Tnext ) const
overridevirtual

Advance one time step using the Richardson explicit scheme.

This computes $T^{n+1}$ from $T^{n}$ and $T^{n-1}$. Interior nodes $i = 1, \dots, N-2$ are updated, while boundary nodes are left untouched (the solver will impose Dirichlet BCs).

Parameters
gGrid metadata (spacing and number of nodes)
DDiffusivity [cm^2/h]
dtTime step [h]
TprevTemperature field at previous time layer $T^{n-1}$
TcurrTemperature field at current time layer $T^{n}$
TnextOutput temperature field to be filled with $T^{n+1}$

Implements Method.

Definition at line 10 of file richardson.cpp.

◆ uses_previous_step()

bool Richardson::uses_previous_step ( ) const
inlineoverridevirtualnoexcept

Indicate that this is a three-level scheme.

Returns
true always, since Richardson needs $T^{n-1}$.

Implements Method.

Definition at line 33 of file richardson.hpp.


The documentation for this class was generated from the following files: