Class for the calculation of velocities from the pressure solution of an IMPES scheme using a grid adaptive MPFA L-method. More...
#include <dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh>
Class for the calculation of velocities from the pressure solution of an IMPES scheme using a grid adaptive MPFA L-method.
Can be used for calculating the complete velocity field before the solution of the transport equation (more efficient), or for face-wise velocity calculation directly in the transport solution (less efficient).
Remark1: only for 2-D quadrilateral grids!
Remark2: can use UGGrid, ALUGrid
Remark3: Allowed difference in grid levels of two neighboring cells: 1
TypeTag | The problem Type Tag |
Public Types | |
using | TransmissibilityCalculator = FvMpfaL2dTransmissibilityCalculator< TypeTag > |
Public Member Functions | |
FvMpfaL2dPressureVelocity2pAdaptive (Problem &problem) | |
Constructs a FvMpfaL2dPressureVelocity2pAdaptive object. More... | |
void | calculateVelocity () |
Calculates the velocities at all cell-cell interfaces. More... | |
void | calculateVelocity (const Intersection &, CellData &) |
Calculates the velocity at a cell-cell interface. More... | |
void | calculateVelocityOnBoundary (const Intersection &intersection, CellData &cellData) |
Calculates the velocity at a boundary. More... | |
void | updateVelocity () |
Function for updating the velocity field if iterations are necessary in the transport solution. More... | |
void | initialize () |
Initializes pressure and velocity. More... | |
void | update () |
Pressure and velocity update. More... | |
bool | calculateVelocityInTransport () |
Indicates if velocity is reconstructed in the pressure step or in the transport step. More... | |
template<class MultiWriter > | |
void | addOutputVtkFields (MultiWriter &writer) |
Adds velocity output to the output file. More... | |
void | updateMaterialLaws () |
constitutive functions are initialized and stored in the variables object More... | |
void | updateInteractionVolumeInfo () |
Updates interaction volumes. More... | |
void | storePressureSolution () |
Globally stores the pressure solution. More... | |
void | storePressureSolution (const Element &element) |
Stores the pressure solution of a cell. 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 | 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 | assemble (bool first) |
Function which assembles the system of equations to be solved. More... | |
void | initializeMatrixRowSize () |
Initialize the global matrix of the system of equations to solve. More... | |
void | initializeMatrixIndices () |
Initialize the global matrix of the system of equations to solve. 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 | |
GlobalInteractionVolumeVector | interactionVolumes_ |
Global Vector of interaction volumes. More... | |
InnerBoundaryVolumeFaces | innerBoundaryVolumeFaces_ |
Vector marking faces which intersect the boundary. 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).
|
inherited |
|
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 FvMpfaL2dPressureVelocity2pAdaptive object.
problem | A problem class object |
|
inline |
Adds velocity output to the output file.
Adds the phase velocities or a total velocity (depending on the formulation) 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) |
|
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) |
void Dumux::FvMpfaL2dPressureVelocity2pAdaptive< TypeTag >::calculateVelocity |
Calculates the velocities at all cell-cell interfaces.
Calculates the velocities at a cell-cell interfaces for the entire simulation grid.
Calculates the velocities at a cell-cell interfaces from a given pressure field for the entire simulation grid.
void Dumux::FvMpfaL2dPressureVelocity2pAdaptive< TypeTag >::calculateVelocity | ( | const Intersection & | intersection, |
CellData & | cellData | ||
) |
Calculates the velocity at a cell-cell interface.
Calculates the velocity at a cell-cell interface from a given pressure field.
intersection | Intersection of two grid cells |
cellData | Object containing all model relevant cell data |
|
inline |
Indicates if velocity is reconstructed in the pressure step or in the transport step.
Returns true (In the standard finite volume discretization the velocity is calculated during the saturation transport.)
void Dumux::FvMpfaL2dPressureVelocity2pAdaptive< TypeTag >::calculateVelocityOnBoundary | ( | const Intersection & | intersection, |
CellData & | cellData | ||
) |
Calculates the velocity at a boundary.
Calculates the velocity at a boundary from a given pressure field.
intersection | Boundary intersection |
cellData | Object containing all model relevant cell data |
|
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 |
|
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.
|
inline |
Initializes pressure and velocity.
Function initializes the sparse matrix to solve the global system of equations and sets/calculates the initial pressure
|
protectedinherited |
Initialize the global matrix of the system of equations to solve.
|
protectedinherited |
Initialize the global matrix of the system of equations to solve.
|
inlineprotectedinherited |
Initialization of the pressure solution vector: Initialization with meaningful values may.
|
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.
|
inlineinherited |
Globally stores the pressure solution.
|
inlineinherited |
Stores the pressure solution of a cell.
element | Dune grid element |
|
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 and velocity update.
Function reassembles the system of equations and solves for a new pressure solution.
|
inlineinherited |
Updates interaction volumes.
Globally rebuilds the MPFA interaction volumes.
|
inherited |
constitutive functions are initialized and stored in the variables object
Updates constitutive relations and stores them in the variable class.
Stores mobility, fractional flow function and capillary pressure for all grid cells.
|
inline |
Function for updating the velocity field if iterations are necessary in the transport solution.
|
protectedinherited |
Global stiffnes matrix (sparse matrix which is build by the initializeMatrix()
function)
|
protectedinherited |
Right hand side vector.
|
protectedinherited |
Vector marking faces which intersect the boundary.
|
protectedinherited |
Global Vector of interaction volumes.