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

Class for the calculation of 3d velocities from the pressure solution of an IMPES scheme using a MPFA L-method. More...

#include <dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh>

Inheritance diagram for Dumux::FvMpfaL3dPressureVelocity2p< TypeTag >:
Inheritance graph

Description

template<class TypeTag>
class Dumux::FvMpfaL3dPressureVelocity2p< TypeTag >

Class for the calculation of 3d velocities from the pressure solution of an IMPES scheme using a 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 3-D Hexahedrons of quadrilaterals!

Template Parameters
TypeTagThe problem Type Tag

Public Types

using TransmissibilityType = typename TransmissibilityCalculator::TransmissibilityType
 Type including methods for calculation of MPFA transmissibilities. More...
 

Public Member Functions

 FvMpfaL3dPressureVelocity2p (Problem &problem)
 Constructs a FvMpfaL3dPressureVelocity2p object. More...
 
void calculateVelocity ()
 Calculates the velocities at a cell-cell interfaces for the entire simulation grid. 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 (bool solveTwice=true)
 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 initialize ()
 Initialize pressure model. More...
 
void storePressureSolution ()
 Globally stores the pressure solution. More...
 
void storePressureSolution (const Element &element)
 Stores the pressure solution of a cell. More...
 
Scalar evaluateErrorTerm (CellData &cellData)
 Volume correction term to correct for unphysical saturation overshoots/undershoots. More...
 
InteractionVolumeContainer & interactionVolumes ()
 Returns the global container of the stored interaction volumes. More...
 
TransmissibilityCalculatortransmissibilityCalculator ()
 Returns the transmissibility calculator. 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 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 assemble (bool first)
 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 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...
 

Member Typedef Documentation

◆ EntryType

template<class TypeTag >
using Dumux::FVPressure< TypeTag >::EntryType = Dune::FieldVector<Scalar, 2>
protectedinherited

Type of the vector of entries

Contains the return values of the get*()-functions (matrix or right-hand side entry).

◆ TransmissibilityType

template<class TypeTag >
using Dumux::FvMpfaL3dPressure2p< TypeTag >::TransmissibilityType = typename TransmissibilityCalculator::TransmissibilityType
inherited

Type including methods for calculation of MPFA transmissibilities.

Member Enumeration Documentation

◆ anonymous enum

template<class TypeTag >
anonymous enum
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

◆ anonymous enum

template<class TypeTag >
anonymous enum
protectedinherited
Enumerator
pressEqIdx 

Constructor & Destructor Documentation

◆ FvMpfaL3dPressureVelocity2p()

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

Constructs a FvMpfaL3dPressureVelocity2p object.

Parameters
problemA problem class object

Member Function Documentation

◆ addOutputVtkFields()

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

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

◆ assemble() [1/2]

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::assemble
protectedinherited

function which assembles the system of equations to be solved

assembles the global matrix and rhs vector for the pressure solution

◆ assemble() [2/2]

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::assemble ( bool  first)
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!

Parameters
firstIndicates if function is called at the initialization step or during the simulation (If first is true, no pressure field of previous iterations is required)

◆ assembleBoundaryInteractionVolume()

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::assembleBoundaryInteractionVolume ( InteractionVolume interactionVolume)
protectedinherited

◆ assembleInnerInteractionVolume()

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::assembleInnerInteractionVolume ( InteractionVolume interactionVolume)
protectedinherited

assembles the matrix entries of one interaction volume into the global matrix

◆ calculateVelocity() [1/2]

template<class TypeTag >
void Dumux::FvMpfaL3dPressureVelocity2p< TypeTag >::calculateVelocity

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.

◆ calculateVelocity() [2/2]

template<class TypeTag >
void Dumux::FvMpfaL3dPressureVelocity2p< 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.

Parameters
intersectionIntersection of two grid cells
cellDataObject containing all model relevant cell data

◆ calculateVelocityInTransport()

template<class TypeTag >
bool Dumux::FvMpfaL3dPressureVelocity2p< TypeTag >::calculateVelocityInTransport ( )
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.)

◆ calculateVelocityOnBoundary()

template<class TypeTag >
void Dumux::FvMpfaL3dPressureVelocity2p< TypeTag >::calculateVelocityOnBoundary ( const Intersection &  intersection,
CellData &  cellData 
)

Calculates the velocity at a boundary.

Calculates the velocity at a boundary from a given pressure field.

Parameters
intersectionBoundary intersection
cellDataObject containing all model relevant cell data

◆ deserializeEntity()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::deserializeEntity ( std::istream &  instream,
const Element &  element 
)
inlineinherited

Function for deserialization of the pressure field.

Function needed for restart option. Reads the pressure of a grid element from a restart file.

Parameters
instreamStream from the restart file.
elementGrid element

◆ evaluateErrorTerm()

template<class TypeTag >
Scalar Dumux::FvMpfaL3dPressure2p< TypeTag >::evaluateErrorTerm ( CellData &  cellData)
inlineinherited

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} \]

Parameters
cellDataThe IMPES CellData object of the current cell.
Returns
The scalar value of the error term.

◆ getFlux()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::getFlux ( EntryType entry,
const Intersection &  intersection,
const CellData &  cellData,
const bool  first 
)
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

Parameters
entryVector containing return values of the function
intersectionIntersection of two grid elements
cellDataObject containing all model relevant cell data
firstIndicates if function is called in the initialization step or during the simulation

◆ getFluxOnBoundary()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::getFluxOnBoundary ( EntryType entry,
const Intersection &  intersection,
const CellData &  cellData,
const bool  first 
)
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

Parameters
entryVector containing return values of the function
intersectionIntersection of two grid elements
cellDataObject containing all model relevant cell data
firstIndicates if function is called in the initialization step or during the simulation

◆ getSource()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::getSource ( EntryType entry,
const Element &  element,
const CellData &  cellData,
const bool  first 
)
inherited

Function which calculates the source entry.

Function computes the source term and writes it to the corresponding entry of the entry vector

Parameters
entryVector containing return values of the function
elementGrid element
cellDataObject containing all model relevant cell data
firstIndicates if function is called in the initialization step or during the simulation

◆ getStorage()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::getStorage ( EntryType entry,
const Element &  element,
const CellData &  cellData,
const bool  first 
)
inherited

Function which calculates the storage entry.

Function computes the storage term and writes it to the corresponding entry of the entry vector

Parameters
entryVector containing return values of the function
elementGrid element
cellDataObject containing all model relevant cell data
firstIndicates if function is called in the initialization step or during the simulation

◆ globalMatrix()

template<class TypeTag >
const Matrix & Dumux::FVPressure< TypeTag >::globalMatrix ( )
inlineinherited

Returns the global matrix of the last pressure solution step.

◆ initialize() [1/2]

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::initialize ( )
inlineinherited

Initialize pressure model.

Function initializes the sparse matrix to solve the global system of equations and sets/calculates the initial pressure

◆ initialize() [2/2]

template<class TypeTag >
void Dumux::FvMpfaL3dPressureVelocity2p< TypeTag >::initialize ( bool  solveTwice = true)
inline

Initializes pressure and velocity.

Function initializes the sparse matrix to solve the global system of equations and sets/calculates the initial pressure

◆ initializeMatrix()

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::initializeMatrix
protectedinherited

Initializes the sparse matrix for the pressure solution.

◆ initializeMatrixIndices()

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::initializeMatrixIndices
protectedinherited

Initializes the indices of the sparse matrix for the pressure solution.

◆ initializeMatrixRowSize()

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::initializeMatrixRowSize
protectedinherited

Initializes the row size of the sparse matrix for the pressure solution.

◆ initializePressure()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::initializePressure ( )
inlineprotectedinherited

Initialization of the pressure solution vector: Initialization with meaningful values may.

◆ interactionVolumes()

template<class TypeTag >
InteractionVolumeContainer & Dumux::FvMpfaL3dPressure2p< TypeTag >::interactionVolumes ( )
inlineinherited

Returns the global container of the stored interaction volumes.

◆ pressure() [1/3]

template<class TypeTag >
PressureSolution & Dumux::FVPressure< TypeTag >::pressure ( )
inlineprotectedinherited

Returns the vector containing the pressure solution.

◆ pressure() [2/3]

template<class TypeTag >
const PressureSolution & Dumux::FVPressure< TypeTag >::pressure ( ) const
inlineprotectedinherited

Returns the vector containing the pressure solution.

◆ pressure() [3/3]

template<class TypeTag >
const Scalar Dumux::FVPressure< TypeTag >::pressure ( const int  eIdxGlobal) const
inlineinherited

Public access function for the primary pressure variable.

Function returns the cell pressure value at index eIdxGlobal

Parameters
eIdxGlobalGlobal index of a grid cell

◆ resetFixPressureAtIndex()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::resetFixPressureAtIndex ( )
inlineinherited

◆ rightHandSide()

template<class TypeTag >
const RHSVector & Dumux::FVPressure< TypeTag >::rightHandSide ( )
inlineinherited

Returns the right hand side vector of the last pressure solution step.

◆ serializeEntity()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::serializeEntity ( std::ostream &  outstream,
const Element &  element 
)
inlineinherited

Function for serialization of the pressure field.

Function needed for restart option. Writes the pressure of a grid element to a restart file.

Parameters
outstreamStream into the restart file.
elementGrid element

◆ setFixPressureAtIndex()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::setFixPressureAtIndex ( Scalar  pressure,
int  eIdxGlobal 
)
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

Parameters
pressurePressure value at eIdxGlobal
eIdxGlobalGlobal index of a grid cell

◆ solve()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::solve
protectedinherited

Solves the global system of equations to get the spatial distribution of the pressure.

◆ storePressureSolution() [1/2]

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::storePressureSolution ( )
inlineinherited

Globally stores the pressure solution.

◆ storePressureSolution() [2/2]

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::storePressureSolution ( const Element &  element)
inlineinherited

Stores the pressure solution of a cell.

Parameters
elementDune grid element

◆ transmissibilityCalculator()

template<class TypeTag >
TransmissibilityCalculator & Dumux::FvMpfaL3dPressure2p< TypeTag >::transmissibilityCalculator ( )
inlineinherited

Returns the transmissibility calculator.

Object including methods for the MPFA transmissibility calculation

◆ unsetFixPressureAtIndex()

template<class TypeTag >
void Dumux::FVPressure< TypeTag >::unsetFixPressureAtIndex ( int  eIdxGlobal)
inlineinherited

Reset the fixed pressure state.

No pressure is fixed inside the domain until setFixPressureAtIndex() function is called again.

Parameters
eIdxGlobalGlobal index of a grid cell

◆ update()

template<class TypeTag >
void Dumux::FvMpfaL3dPressureVelocity2p< TypeTag >::update ( )
inline

Pressure and velocity update.

Function reassembles the system of equations and solves for a new pressure solution.

◆ updateMaterialLaws()

template<class TypeTag >
void Dumux::FvMpfaL3dPressure2p< TypeTag >::updateMaterialLaws
inherited

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

◆ updateVelocity()

template<class TypeTag >
void Dumux::FvMpfaL3dPressureVelocity2p< TypeTag >::updateVelocity ( )
inline

Function for updating the velocity field if iterations are necessary in the transport solution.

Member Data Documentation

◆ A_

template<class TypeTag >
Matrix Dumux::FVPressure< TypeTag >::A_
protectedinherited

Global stiffnes matrix (sparse matrix which is build by the initializeMatrix() function)

◆ f_

template<class TypeTag >
RHSVector Dumux::FVPressure< TypeTag >::f_
protectedinherited

Right hand side vector.

◆ interactionVolumes_

template<class TypeTag >
InteractionVolumeContainer Dumux::FvMpfaL3dPressure2p< TypeTag >::interactionVolumes_
protectedinherited

Global container of the stored interaction volumes

◆ transmissibilityCalculator_

template<class TypeTag >
TransmissibilityCalculator Dumux::FvMpfaL3dPressure2p< TypeTag >::transmissibilityCalculator_
protectedinherited

The transmissibility calculator including methods for the MPFA transmissibility calculation.


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