3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Member Functions | Protected Member Functions | List of all members
Dumux::FVSaturation2P< TypeTag > Class Template Reference

The finite volume discretization of a saturation transport equation. More...

#include <dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh>

Inheritance diagram for Dumux::FVSaturation2P< TypeTag >:

Description

template<class TypeTag>
class Dumux::FVSaturation2P< TypeTag >

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)

Template Parameters
TypeTagThe 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)
 

Constructor & Destructor Documentation

◆ FVSaturation2P()

template<class TypeTag >
Dumux::FVSaturation2P< TypeTag >::FVSaturation2P ( Problem &  problem)
inline

Constructs a FVSaturation2P object.

Parameters
problemA problem class object

Member Function Documentation

◆ addOutputVtkFields()

template<class TypeTag >
template<class MultiWriter >
void Dumux::FVSaturation2P< TypeTag >::addOutputVtkFields ( MultiWriter &  writer)
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.

Template Parameters
MultiWriterClass defining the output writer
Parameters
writerThe output writer (usually a VTKMultiWriter object)

◆ capillaryFlux() [1/2]

template<class TypeTag >
CapillaryFlux & Dumux::FVSaturation2P< TypeTag >::capillaryFlux ( )
inlineprotected

◆ capillaryFlux() [2/2]

template<class TypeTag >
const CapillaryFlux & Dumux::FVSaturation2P< TypeTag >::capillaryFlux ( ) const
inlineprotected

◆ deserializeEntity()

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::deserializeEntity ( std::istream &  instream,
const Element &  element 
)
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.

Parameters
instreamStream from the restart file.
elementGrid element

◆ enableLocalTimeStepping()

template<class TypeTag >
bool Dumux::FVTransport< TypeTag >::enableLocalTimeStepping ( )
inlineinherited

◆ getFlux()

template<class TypeTag >
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.

Parameters
updateThe cell update
intersectionIntersection of two grid elements
cellDataIObject 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.

◆ getFluxOnBoundary()

template<class TypeTag >
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.

Parameters
updateThe cell update
intersectionIntersection of two grid elements
cellDataIObject 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}\)])

◆ getSource()

template<class TypeTag >
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.

Parameters
updateThe cell update
elementGrid element
cellDataIObject 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}\)).

◆ getTransportedQuantity()

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::getTransportedQuantity ( TransportSolutionType &  transportedQuantity)
inline

Writes the current values of the primary transport variable into the transportedQuantity-vector (comes as function argument)

Parameters
transportedQuantityVector of the size of global numbers of degrees of freedom of the primary transport variable.

◆ gravityFlux() [1/2]

template<class TypeTag >
GravityFlux & Dumux::FVSaturation2P< TypeTag >::gravityFlux ( )
inlineprotected

◆ gravityFlux() [2/2]

template<class TypeTag >
const GravityFlux & Dumux::FVSaturation2P< TypeTag >::gravityFlux ( ) const
inlineprotected

◆ initialize()

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::initialize

Sets the initial solution.

Sets the initial solution \( S_0 \).

◆ innerUpdate()

template<class TypeTag >
void Dumux::FVTransport< TypeTag >::innerUpdate ( TransportSolutionType &  updateVec)
protectedinherited

◆ inPhysicalRange()

template<class TypeTag >
template<class DataEntry >
bool Dumux::FVSaturation2P< TypeTag >::inPhysicalRange ( DataEntry &  entry)
inline

Check if saturation is in physical range.

Template Parameters
DataEntryData class
Parameters
entryEntry which is checked

◆ serializeEntity()

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::serializeEntity ( std::ostream &  outstream,
const Element &  element 
)
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.

Parameters
outstreamStream into the restart file.
elementGrid element

◆ setTransportedQuantity()

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::setTransportedQuantity ( TransportSolutionType &  transportedQuantity)
inline

Writes the current values of the primary transport variable into the variable container.

Parameters
transportedQuantityVector of the size of global numbers of degrees of freedom of the primary transport variable.

◆ update()

template<class TypeTag >
void Dumux::FVTransport< TypeTag >::update ( const Scalar  t,
Scalar &  dt,
TransportSolutionType &  updateVec,
bool  impet = false 
)
inherited

Calculate the update vector.

Parameters
tcurrent time
dttime step size
updateVecvector containing the update values
impetvariable 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.

◆ updateMaterialLaws()

template<class TypeTag >
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.

◆ updateSaturationSolution() [1/3]

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::updateSaturationSolution ( int  eIdxGlobal,
Scalar  update,
Scalar  dt 
)
inline

Updates the saturation solution of a cell.

Calculates secondary saturation variables and stores saturations.

Parameters
eIdxGlobalGlobal cell index
updateCell saturation update
dtCurrent time step

◆ updateSaturationSolution() [2/3]

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::updateSaturationSolution ( TransportSolutionType &  updateVec)
inline

Globally updates the saturation solution.

Parameters
updateVecVector containing the global update.

◆ updateSaturationSolution() [3/3]

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::updateSaturationSolution ( TransportSolutionType &  updateVec,
Scalar  dt 
)
inline

Globally updates the saturation solution.

Parameters
updateVecVector containing the global update.
dttime step for update

◆ updateTransport()

template<class TypeTag >
void Dumux::FVTransport< TypeTag >::updateTransport ( const Scalar  t,
Scalar &  dt,
TransportSolutionType &  updateVec 
)
inlineinherited

◆ updateTransportedQuantity() [1/2]

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::updateTransportedQuantity ( TransportSolutionType &  updateVec)
inline

Updates the primary transport variable.

Parameters
updateVecVector containing the global update.

◆ updateTransportedQuantity() [2/2]

template<class TypeTag >
void Dumux::FVSaturation2P< TypeTag >::updateTransportedQuantity ( TransportSolutionType &  updateVec,
Scalar  dt 
)
inline

Updates the primary transport variable.

Parameters
updateVecVector containing the global update
dttime step for update

◆ velocity() [1/2]

template<class TypeTag >
Velocity & Dumux::FVSaturation2P< TypeTag >::velocity ( )
inline

◆ velocity() [2/2]

template<class TypeTag >
Velocity & Dumux::FVSaturation2P< TypeTag >::velocity ( ) const
inline

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