Implements the cell average update rule. In one dimension, the finite volume method subdivide the domain into
cells (intervals) and approximates the integral of the unknown function q over each of these cells at each time step (see figure below).
The ghost cells are the boundary cells that are introduced to avoid writing special formulas for the boundary cells.
Denote the i-th cell by
Then the approximation to the average of q in the cell Ci at time t, which we denote with Qi is
The approximation to this average derives from the integral form of the conservation law
which states that the average within the cell can only changes due to the fluxes at the boundaries (if we assume that
no source or sink is present in the cell).
If we integrate this expression in time from t to t+deltat, we obtain
and dividing by deltax we reach the form
which give us an explicit time marching algorithm. By using the notation for averages introduced above we can write
where
approximates the average flux along the interface xi-1/2.
The FVMIntegrator block implements this average update rule. Initial condition of the problem can be passed to the IC input of the block,
whereas the boundary conditions to the corresponding ghost cells. The number of ghost cells depends on the method we use. In the present
package, two ghost cells at the left and at the right are enough for every method implemented.
Release Notes: