3.2-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::FvMpfaL2dPressure2pAdaptive< TypeTag > Class Template Reference

Grid adaptive 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/2dpressureadaptive.hh>

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

Description

template<class TypeTag>
class Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >

Grid adaptive finite volume MPFA L-method discretization of a two-phase flow pressure equation of the sequential IMPES model.

Grid adaptive finite volume MPFA L-method discretization of the equations

\[ - \text{div}\, \boldsymbol v_t = - \text{div}\, (\lambda_t \boldsymbol K \textbf{grad}\, \Phi_w + f_n \lambda_t \boldsymbol K \textbf{grad}\, \Phi_{cap} ) = 0, \]

or

\[ - \text{div}\, \boldsymbol v_t = - \text{div}\, (\lambda_t \boldsymbol K \textbf{grad}\, \Phi_n - f_w \lambda_t \boldsymbol K \textbf{grad}\, \Phi_{cap} ) = 0. \]

At Dirichlet boundaries a two-point flux approximation is used.

\[ \Phi = g \; \text{on} \; \Gamma_1, \quad \text{and} \quad -\text{div}\, \boldsymbol v_t \cdot \mathbf{n} = J \; \text{on} \; \Gamma_2. \]

Here, \( \Phi_\alpha \) denotes the potential of phase \( \alpha \), \( \boldsymbol 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 2-D quadrilateral grid

Remark2: implemented for UGGrid, ALUGrid

Remark3: Allowed difference in grid levels of two neighboring cells: 1

Template Parameters
TypeTagThe problem Type Tag

Public Types

using InteractionVolume = FVMPFALInteractionVolume< TypeTag >
 Type of the interaction volume objects. More...
 
using TransmissibilityCalculator = FvMpfaL2dTransmissibilityCalculator< TypeTag >
 

Public Member Functions

void updateMaterialLaws ()
 constitutive functions are initialized and stored in the variables object More...
 
void updateInteractionVolumeInfo ()
 Updates interaction volumes. More...
 
void initialize ()
 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...
 
template<class MultiWriter >
void addOutputVtkFields (MultiWriter &writer)
 Adds pressure output to the output file. More...
 
 FvMpfaL2dPressure2pAdaptive (Problem &problem)
 Constructs a FvMpfaL2dPressure2pAdaptive 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 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 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 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

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...
 

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).

◆ InteractionVolume

template<class TypeTag >
using Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >::InteractionVolume = FVMPFALInteractionVolume<TypeTag>

Type of the interaction volume objects.

Type of the interaction volume objects used to store the geometric information which is needed to calculated the transmissibility matrices of one MPFA interaction volume.

◆ TransmissibilityCalculator

template<class TypeTag >
using Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >::TransmissibilityCalculator = FvMpfaL2dTransmissibilityCalculator<TypeTag>

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

◆ FvMpfaL2dPressure2pAdaptive()

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

Constructs a FvMpfaL2dPressure2pAdaptive object.

Parameters
problemA problem class object

Member Function Documentation

◆ addOutputVtkFields()

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

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

◆ assemble()

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)

◆ calculateVelocity()

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

◆ 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

◆ 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()

template<class TypeTag >
void Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >::initialize ( )
inline

Initializes the pressure model.

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

◆ initializeMatrixIndices()

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

Initialize the global matrix of the system of equations to solve.

◆ initializeMatrixRowSize()

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

Initialize the global matrix of the system of equations to solve.

◆ initializePressure()

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

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

◆ 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::FvMpfaL2dPressure2pAdaptive< TypeTag >::storePressureSolution ( )
inline

Globally stores the pressure solution.

◆ storePressureSolution() [2/2]

template<class TypeTag >
void Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >::storePressureSolution ( const Element &  element)
inline

Stores the pressure solution of a cell.

Parameters
elementDune grid element

◆ 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::FvMpfaL2dPressure2pAdaptive< TypeTag >::update ( )
inline

Pressure update.

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

◆ updateInteractionVolumeInfo()

template<class TypeTag >
void Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >::updateInteractionVolumeInfo ( )
inline

Updates interaction volumes.

Globally rebuilds the MPFA interaction volumes.

◆ updateMaterialLaws()

template<class TypeTag >
void Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >::updateMaterialLaws

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.

◆ updateVelocity()

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

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.

◆ innerBoundaryVolumeFaces_

template<class TypeTag >
InnerBoundaryVolumeFaces Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >::innerBoundaryVolumeFaces_
protected

Vector marking faces which intersect the boundary.

◆ interactionVolumes_

template<class TypeTag >
GlobalInteractionVolumeVector Dumux::FvMpfaL2dPressure2pAdaptive< TypeTag >::interactionVolumes_
protected

Global Vector of interaction volumes.


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