3-d finite volume MPFA L-method discretization of a two-phase flow pressure equation of the sequential IMPES model. More...
#include <dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh>
3-d finite volume MPFA L-method discretization of a two-phase flow pressure equation of the sequential IMPES model.
Finite Volume-MPFAL-Implementation of the equation \( - \text{div}\, \mathbf{v}_t = - \text{div}\, (\lambda_t \mathbf{K} \text{grad}\, \Phi_w + f_n \lambda_t \mathbf{K} \text{grad}\, \Phi_{cap} ) = 0, \), or \( - \text{div}\, \mathbf{v}_t = - \text{div}\, (\lambda_t \mathbf{K} \text{grad}\, \Phi_n - f_w \lambda_t \mathbf{K} \text{grad}\, \Phi_{cap} ) = 0, \).
\( \Phi = g \) on \( \Gamma_1 \), and \( - \text{div} \, \mathbf{v}_t \cdot \mathbf{n} = J \) on \( \Gamma_2 \).
Here, \( \Phi_\alpha \) denotes the potential of phase \( \alpha \), \( \mathbf{K} \) the intrinsic permeability, \( \lambda_t \) the total mobility, \( f_\alpha \) the phase fractional flow function.
More details on the equations can be found in
Wolff 2013: http://elib.uni-stuttgart.de/opus/volltexte/2013/8661/
M. Wolff, Y. Cao, B. Flemisch, R. Helmig, and B. Wohlmuth (2013a). Multi-point flux approximation L-method in 3D: numerical convergence and application to two-phase flow through porous media. In P. Bastian, J. Kraus, R. Scheichl, and M. Wheeler, editors, Simulation of Flow in Porous Media - Applications in Energy and Environment. De Gruyter.
M. Wolff, B. Flemisch, R. Helmig, I. Aavatsmark. Treatment of tensorial relative permeabilities with multipoint flux approximation. International Journal of Numerical Analysis and Modeling (9), pp. 725-744, 2012.
Remark1: only for 3-D hexahedrons of quadrilaterals.
TypeTag | The problem Type Tag |
Public Types | |
using | TransmissibilityType = typename TransmissibilityCalculator::TransmissibilityType |
Type including methods for calculation of MPFA transmissibilities. More... | |
using | InteractionVolume = GetPropType< TypeTag, Properties::MPFAInteractionVolume > |
Type for storing interaction volume information. More... | |
Public Member Functions | |
void | updateMaterialLaws () |
constitutive functions are initialized and stored in the variables object More... | |
void | initialize (bool solveTwice=true) |
Initializes the pressure model. More... | |
void | storePressureSolution () |
Globally stores the pressure solution. More... | |
void | storePressureSolution (const Element &element) |
Stores the pressure solution of a cell. More... | |
void | update () |
Pressure update. More... | |
Scalar | evaluateErrorTerm (CellData &cellData) |
Volume correction term to correct for unphysical saturation overshoots/undershoots. More... | |
template<class MultiWriter > | |
void | addOutputVtkFields (MultiWriter &writer) |
Adds pressure output to the output file. More... | |
InteractionVolumeContainer & | interactionVolumes () |
Returns the global container of the stored interaction volumes. More... | |
TransmissibilityCalculator & | transmissibilityCalculator () |
Returns the transmissibility calculator. More... | |
FvMpfaL3dPressure2p (Problem &problem) | |
Constructs a FvMpfaL3dPressure2p object. More... | |
const Scalar | pressure (const int eIdxGlobal) const |
Public access function for the primary pressure variable. More... | |
void | getSource (EntryType &entry, const Element &element, const CellData &cellData, const bool first) |
Function which calculates the source entry. More... | |
void | getStorage (EntryType &entry, const Element &element, const CellData &cellData, const bool first) |
Function which calculates the storage entry. More... | |
void | getFlux (EntryType &entry, const Intersection &intersection, const CellData &cellData, const bool first) |
Function which calculates the flux entry. More... | |
void | getFluxOnBoundary (EntryType &entry, const Intersection &intersection, const CellData &cellData, const bool first) |
Function which calculates the boundary flux entry. More... | |
const Matrix & | globalMatrix () |
Returns the global matrix of the last pressure solution step. More... | |
const RHSVector & | rightHandSide () |
Returns the right hand side vector of the last pressure solution step. More... | |
void | initialize () |
Initialize pressure model. More... | |
void | calculateVelocity () |
void | updateVelocity () |
void | serializeEntity (std::ostream &outstream, const Element &element) |
Function for serialization of the pressure field. More... | |
void | deserializeEntity (std::istream &instream, const Element &element) |
Function for deserialization of the pressure field. More... | |
void | setFixPressureAtIndex (Scalar pressure, int eIdxGlobal) |
Set a pressure to be fixed at a certain cell. More... | |
void | unsetFixPressureAtIndex (int eIdxGlobal) |
Reset the fixed pressure state. More... | |
void | resetFixPressureAtIndex () |
Protected Types | |
enum | { rhs = 1 , matrix = 0 } |
Indices of matrix and rhs entries. More... | |
enum | { pressEqIdx = Indices::pressureEqIdx } |
using | EntryType = Dune::FieldVector< Scalar, 2 > |
Protected Member Functions | |
void | initializeMatrix () |
Initializes the sparse matrix for the pressure solution. More... | |
void | initializeMatrixRowSize () |
Initializes the row size of the sparse matrix for the pressure solution. More... | |
void | initializeMatrixIndices () |
Initializes the indices of the sparse matrix for the pressure solution. More... | |
void | assemble () |
function which assembles the system of equations to be solved More... | |
void | assembleInnerInteractionVolume (InteractionVolume &interactionVolume) |
assembles the matrix entries of one interaction volume into the global matrix More... | |
void | assembleBoundaryInteractionVolume (InteractionVolume &interactionVolume) |
void | assemble (bool first) |
Function which assembles the system of equations to be solved. More... | |
void | solve () |
Solves the global system of equations to get the spatial distribution of the pressure. More... | |
PressureSolution & | pressure () |
Returns the vector containing the pressure solution. More... | |
const PressureSolution & | pressure () const |
Returns the vector containing the pressure solution. More... | |
void | initializePressure () |
Initialization of the pressure solution vector: Initialization with meaningful values may. More... | |
Protected Attributes | |
InteractionVolumeContainer | interactionVolumes_ |
TransmissibilityCalculator | transmissibilityCalculator_ |
The transmissibility calculator including methods for the MPFA transmissibility calculation. More... | |
Matrix | A_ |
Global stiffnes matrix (sparse matrix which is build by the initializeMatrix() function) More... | |
RHSVector | f_ |
Right hand side vector. More... | |
|
protectedinherited |
Type of the vector of entries
Contains the return values of the get*()-functions (matrix or right-hand side entry).
using Dumux::FvMpfaL3dPressure2p< TypeTag >::InteractionVolume = GetPropType<TypeTag, Properties::MPFAInteractionVolume> |
Type for storing interaction volume information.
using Dumux::FvMpfaL3dPressure2p< TypeTag >::TransmissibilityType = typename TransmissibilityCalculator::TransmissibilityType |
Type including methods for calculation of MPFA transmissibilities.
|
protectedinherited |
Indices of matrix and rhs entries.
During the assembling of the global system of equations get-functions are called (getSource(), getFlux(), etc.), which return global matrix or right hand side entries in a vector. These can be accessed using following indices:
Enumerator | |
---|---|
rhs | index for the right hand side entry |
matrix | index for the global matrix entry |
|
inline |
Constructs a FvMpfaL3dPressure2p object.
problem | A problem class object |
|
inline |
Adds pressure output to the output file.
Adds the pressure, the potential and the capillary pressure 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) |
|
protected |
function which assembles the system of equations to be solved
assembles the global matrix and rhs vector for the pressure solution
|
protectedinherited |
Function which assembles the system of equations to be solved.
This function assembles the Matrix and the right hand side (RHS) vector to solve for a pressure field with a Finite-Volume (FV) discretization. Implementations of this base class have to provide the methods getSource()
, getStorage()
, getFlux()
and getFluxOnBoundary()
if the assemble() method is called!
first | Indicates if function is called at the initialization step or during the simulation (If first is true , no pressure field of previous iterations is required) |
|
protected |
|
protected |
assembles the matrix entries of one interaction volume into the global matrix
|
inlineinherited |
|
inlineinherited |
Function for deserialization of the pressure field.
Function needed for restart option. Reads the pressure of a grid element from a restart file.
instream | Stream from the restart file. |
element | Grid element |
|
inline |
Volume correction term to correct for unphysical saturation overshoots/undershoots.
These can occur if the estimated time step for the explicit transport was too large. Correction by an artificial source term allows to correct this errors due to wrong time-stepping without losing mass conservation. The error term looks as follows:
\[ q_{error} = \begin{cases} S < 0 & \frac{S}{\Delta t} V \\ S > 1 & \frac{(S - 1)}{\Delta t} V \\ 0 \le S \le 1 & 0 \end{cases} \]
cellData | The IMPES CellData object of the current cell. |
|
inherited |
Function which calculates the flux entry.
Function computes the inter-cell flux term and writes it to the corresponding entry of the entry vector
entry | Vector containing return values of the function |
intersection | Intersection of two grid elements |
cellData | Object containing all model relevant cell data |
first | Indicates if function is called in the initialization step or during the simulation |
|
inherited |
Function which calculates the boundary flux entry.
Function computes the boundary-flux term and writes it to the corresponding entry of the entry vector
entry | Vector containing return values of the function |
intersection | Intersection of two grid elements |
cellData | Object containing all model relevant cell data |
first | Indicates if function is called in the initialization step or during the simulation |
|
inherited |
Function which calculates the source entry.
Function computes the source term and writes it to the corresponding entry of the entry vector
entry | Vector containing return values of the function |
element | Grid element |
cellData | Object containing all model relevant cell data |
first | Indicates if function is called in the initialization step or during the simulation |
|
inherited |
Function which calculates the storage entry.
Function computes the storage term and writes it to the corresponding entry of the entry vector
entry | Vector containing return values of the function |
element | Grid element |
cellData | Object containing all model relevant cell data |
first | Indicates if function is called in the initialization step or during the simulation |
|
inlineinherited |
Returns the global matrix of the last pressure solution step.
|
inlineinherited |
Initialize pressure model.
Function initializes the sparse matrix to solve the global system of equations and sets/calculates the initial pressure
|
inline |
Initializes the pressure model.
Function initializes the sparse matrix to solve the global system of equations and sets/calculates the initial pressure
|
protected |
Initializes the sparse matrix for the pressure solution.
|
protected |
Initializes the indices of the sparse matrix for the pressure solution.
|
protected |
Initializes the row size of the sparse matrix for the pressure solution.
|
inlineprotectedinherited |
Initialization of the pressure solution vector: Initialization with meaningful values may.
|
inline |
Returns the global container of the stored interaction volumes.
|
inlineprotectedinherited |
Returns the vector containing the pressure solution.
|
inlineprotectedinherited |
Returns the vector containing the pressure solution.
|
inlineinherited |
Public access function for the primary pressure variable.
Function returns the cell pressure value at index eIdxGlobal
eIdxGlobal | Global index of a grid cell |
|
inlineinherited |
|
inlineinherited |
Returns the right hand side vector of the last pressure solution step.
|
inlineinherited |
Function for serialization of the pressure field.
Function needed for restart option. Writes the pressure of a grid element to a restart file.
outstream | Stream into the restart file. |
element | Grid element |
|
inlineinherited |
Set a pressure to be fixed at a certain cell.
Allows to fix a pressure somewhere (at one certain cell) in the domain. This can be necessary e.g. if only Neumann boundary conditions are defined. The pressure is fixed until the unsetFixPressureAtIndex()
function is called
pressure | Pressure value at eIdxGlobal |
eIdxGlobal | Global index of a grid cell |
|
protectedinherited |
Solves the global system of equations to get the spatial distribution of the pressure.
|
inline |
Globally stores the pressure solution.
|
inline |
Stores the pressure solution of a cell.
element | Dune grid element |
|
inline |
Returns the transmissibility calculator.
Object including methods for the MPFA transmissibility calculation
|
inlineinherited |
Reset the fixed pressure state.
No pressure is fixed inside the domain until setFixPressureAtIndex()
function is called again.
eIdxGlobal | Global index of a grid cell |
|
inline |
Pressure update.
Function reassembles the system of equations and solves for a new pressure solution.
void Dumux::FvMpfaL3dPressure2p< TypeTag >::updateMaterialLaws |
constitutive functions are initialized and stored in the variables object
constitutive functions are updated once if new saturations are calculated and stored in the variables object
|
inlineinherited |
|
protectedinherited |
Global stiffnes matrix (sparse matrix which is build by the initializeMatrix()
function)
|
protectedinherited |
Right hand side vector.
|
protected |
Global container of the stored interaction volumes
|
protected |
The transmissibility calculator including methods for the MPFA transmissibility calculation.