The finite volume discretization of a saturation transport equation. More...
#include <dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh>
The finite volume discretization of a saturation transport equation.
This model solves equations of the form
\[ \phi \frac{\partial (\varrho_\alpha S_\alpha)}{\partial t} + \text{div}\, (\varrho_\alpha \boldsymbol{v_\alpha}) = q_\alpha, \]
where \( S_\alpha \) is the saturation of phase \(\alpha \in \{ w, n \}\) and \( \boldsymbol v_\alpha \) is the phase velocity defined by the multi-phase Darcy equation. If a phase velocity is reconstructed from the pressure solution it can be directly inserted into the previous equation. In the incompressible case the equation is further divided by the phase density \( \varrho_\alpha \). If a total velocity is reconstructed the saturation equation is reformulated into:
\[ \phi \frac{\partial S_w}{\partial t} + f_w \text{div}\, \boldsymbol{v}_{t} + f_w \lambda_n \boldsymbol{K}\left(\textbf{grad}\, p_c - (\varrho_n-\varrho_w) {\textbf g} \right)= q_\alpha, \]
to get a wetting phase saturation or
\[ \phi \frac{\partial S_n}{\partial t} + f_n \text{div}\, \boldsymbol{v}_{t} - f_n \lambda_w \boldsymbol{K}\left(\textbf{grad}\, p_c - (\varrho_n-\varrho_w) {\textbf g} \right)= q_\alpha, \]
if the nonwetting phase saturation is the primary transport variable.
The total velocity formulation is only implemented for incompressible fluids and \( f_\alpha \) is the fractional flow function, \( \lambda_\alpha \) is the mobility, \( \boldsymbol K \) the absolute permeability tensor, \( p_c \) the capillary pressure, \( \varrho_\alpha \) the phase density, \( {\textbf g} \) the gravitational acceleration vector, and \( q_\alpha \) the source term.
In the IMPES models the default setting is:
formulation: \( p_w \) - \( S_w \) (Property: Formulation defined as SequentialTwoPCommonIndices::pwsw)
compressibility: disabled (Property: EnableCompressibility set to false)
TypeTag | The Type Tag |
Public Member Functions | |
Velocity & | velocity () |
Velocity & | velocity () const |
void | getFlux (Scalar &update, const Intersection &intersection, CellData &cellDataI) |
Function which calculates the flux update. More... | |
void | getFluxOnBoundary (Scalar &update, const Intersection &intersection, CellData &cellDataI) |
Function which calculates the boundary flux update. More... | |
void | getSource (Scalar &update, const Element &element, CellData &cellDataI) |
Function which calculates the source update. More... | |
void | initialize () |
Sets the initial solution. More... | |
void | updateMaterialLaws () |
Update the values of the material laws and constitutive relations. More... | |
void | getTransportedQuantity (TransportSolutionType &transportedQuantity) |
Writes the current values of the primary transport variable into the transportedQuantity -vector (comes as function argument) More... | |
void | setTransportedQuantity (TransportSolutionType &transportedQuantity) |
Writes the current values of the primary transport variable into the variable container. More... | |
template<class DataEntry > | |
bool | inPhysicalRange (DataEntry &entry) |
Check if saturation is in physical range. More... | |
void | updateTransportedQuantity (TransportSolutionType &updateVec) |
Updates the primary transport variable. More... | |
void | updateTransportedQuantity (TransportSolutionType &updateVec, Scalar dt) |
Updates the primary transport variable. More... | |
void | updateSaturationSolution (TransportSolutionType &updateVec) |
Globally updates the saturation solution. More... | |
void | updateSaturationSolution (TransportSolutionType &updateVec, Scalar dt) |
Globally updates the saturation solution. More... | |
void | updateSaturationSolution (int eIdxGlobal, Scalar update, Scalar dt) |
Updates the saturation solution of a cell. More... | |
template<class MultiWriter > | |
void | addOutputVtkFields (MultiWriter &writer) |
Adds saturation output to the output file. More... | |
void | serializeEntity (std::ostream &outstream, const Element &element) |
Function for serialization of the primary transport variable. More... | |
void | deserializeEntity (std::istream &instream, const Element &element) |
Function for deserialization of the primary transport variable. More... | |
FVSaturation2P (Problem &problem) | |
Constructs a FVSaturation2P object. More... | |
void | update (const Scalar t, Scalar &dt, TransportSolutionType &updateVec, bool impet=false) |
Calculate the update vector. More... | |
void | updateTransport (const Scalar t, Scalar &dt, TransportSolutionType &updateVec) |
bool | enableLocalTimeStepping () |
Protected Member Functions | |
CapillaryFlux & | capillaryFlux () |
const CapillaryFlux & | capillaryFlux () const |
GravityFlux & | gravityFlux () |
const GravityFlux & | gravityFlux () const |
void | innerUpdate (TransportSolutionType &updateVec) |
|
inline |
Constructs a FVSaturation2P object.
problem | A problem class object |
|
inline |
Adds saturation output to the output file.
Adds the phase saturation to the output. If the velocity is calculated in the transport model it is also added to the output. If the VtkOutputLevel is equal to zero (default) only primary variables are written, if it is larger than zero also secondary variables are written.
MultiWriter | Class defining the output writer |
writer | The output writer (usually a VTKMultiWriter object) |
|
inlineprotected |
|
inlineprotected |
|
inline |
Function for deserialization of the primary transport variable.
Function needed for restart option. Reads the the primary transport variable of a grid element from a restart file.
instream | Stream from the restart file. |
element | Grid element |
|
inlineinherited |
void Dumux::FVSaturation2P< TypeTag >::getFlux | ( | Scalar & | update, |
const Intersection & | intersection, | ||
CellData & | cellDataI | ||
) |
Function which calculates the flux update.
Function computes the inter-cell flux term and adds it to the update.
update | The cell update |
intersection | Intersection of two grid elements |
cellDataI | Object containing all model relevant cell data |
If a total velocity formulation is used this functions calculates not only the advective flux but also fluxes due to gravity and capillary diffusion. These have to be defined separately as implementation of a DiffusivePart or ConvectivePart (e.g. GravityPart / CapillaryDiffusion ) and added to the property system via properties CapillaryFlux
and GravityFlux
.
void Dumux::FVSaturation2P< TypeTag >::getFluxOnBoundary | ( | Scalar & | update, |
const Intersection & | intersection, | ||
CellData & | cellDataI | ||
) |
Function which calculates the boundary flux update.
Function computes the boundary-flux term and adds it to the update.
update | The cell update |
intersection | Intersection of two grid elements |
cellDataI | Object containing all model relevant cell data |
Dirichlet boundary condition is a phase saturation depending on the formulation ( \( S_w \) (default) or \( S_n \)), Neumann boundary condition are phase mass fluxes ( \( q_w \) (default) or \( q_n \) [ \(\text{kg}/(\text{m}^2 \text{s}\)])
void Dumux::FVSaturation2P< TypeTag >::getSource | ( | Scalar & | update, |
const Element & | element, | ||
CellData & | cellDataI | ||
) |
Function which calculates the source update.
Function computes the source term and adds it to the update.
update | The cell update |
element | Grid element |
cellDataI | Object containing all model relevant cell data |
Source of the fluid phase has to be defined as mass flux ( \(\text{kg}/(\text{m}^3 \text{s}\)).
|
inline |
Writes the current values of the primary transport variable into the transportedQuantity
-vector (comes as function argument)
transportedQuantity | Vector of the size of global numbers of degrees of freedom of the primary transport variable. |
|
inlineprotected |
|
inlineprotected |
void Dumux::FVSaturation2P< TypeTag >::initialize |
Sets the initial solution.
Sets the initial solution \( S_0 \).
|
protectedinherited |
|
inline |
Check if saturation is in physical range.
DataEntry | Data class |
entry | Entry which is checked |
|
inline |
Function for serialization of the primary transport variable.
Function needed for restart option. Writes the primary transport variable of a grid element to a restart file.
outstream | Stream into the restart file. |
element | Grid element |
|
inline |
Writes the current values of the primary transport variable into the variable container.
transportedQuantity | Vector of the size of global numbers of degrees of freedom of the primary transport variable. |
|
inherited |
Calculate the update vector.
t | current time |
dt | time step size |
updateVec | vector containing the update values |
impet | variable should be true if an impet algorithm is used and false if the transport part is solved independently |
Additionally to the update vector, the recommended time step size dt is calculated employing a CFL condition.
void Dumux::FVSaturation2P< TypeTag >::updateMaterialLaws |
Update the values of the material laws and constitutive relations.
Updates constitutive relations and stores them in the variable class.
Stores mobility, fractional flow function and capillary pressure for all grid cells.
|
inline |
Updates the saturation solution of a cell.
Calculates secondary saturation variables and stores saturations.
eIdxGlobal | Global cell index |
update | Cell saturation update |
dt | Current time step |
|
inline |
Globally updates the saturation solution.
updateVec | Vector containing the global update. |
|
inline |
Globally updates the saturation solution.
updateVec | Vector containing the global update. |
dt | time step for update |
|
inlineinherited |
|
inline |
Updates the primary transport variable.
updateVec | Vector containing the global update. |
|
inline |
Updates the primary transport variable.
updateVec | Vector containing the global update |
dt | time step for update |
|
inline |
|
inline |