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

The finite volume model for the solution of the compositional pressure equation. More...

#include <dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh>

Inheritance diagram for Dumux::FV3dPressure2P2CAdaptive< TypeTag >:

Description

template<class TypeTag>
class Dumux::FV3dPressure2P2CAdaptive< TypeTag >

The finite volume model for the solution of the compositional pressure equation.

Provides a Finite Volume implementation for the pressure equation of a compressible system with two components. An IMPES-like method is used for the sequential solution of the problem. Diffusion is neglected, capillarity can be regarded. Isothermal conditions and local thermodynamic equilibrium are assumed. Gravity is included.

\[ c_{total}\frac{\partial p}{\partial t} + \sum_{\kappa} \frac{\partial v_{total}}{\partial C^{\kappa}} \nabla \cdot \left( \sum_{\alpha} X^{\kappa}_{\alpha} \varrho_{\alpha} \bf{v}_{\alpha}\right) = \sum_{\kappa} \frac{\partial v_{total}}{\partial C^{\kappa}} q^{\kappa}, \]

where \(\bf{v}_{\alpha} = - \lambda_{\alpha} \bf{K} \left(\nabla p_{\alpha} + \rho_{\alpha} \bf{g} \right) \). \( c_{total} \) represents the total compressibility, for constant porosity this yields \( - \frac{\partial V_{total}}{\partial p_{\alpha}} \), \(p_{\alpha} \) denotes the phase pressure, \( \bf{K} \) the absolute permeability, \( \lambda_{\alpha} \) the phase mobility, \( \rho_{\alpha} \) the phase density and \( \bf{g} \) the gravity constant and \( C^{\kappa} \) the total Component concentration. See paper SPE 99619 or "Analysis of a Compositional Model for Fluid Flow in Porous Media" by Chen, Qin and Ewing for derivation.

The pressure base class FVPressure assembles the matrix and right-hand-side vector and solves for the pressure vector, whereas this class provides the actual entries for the matrix and RHS vector. The partial derivatives of the actual fluid volume \( v_{total} \) are gained by using a secant method.

Template Parameters
TypeTagThe Type Tag

Public Member Functions

void update ()
 
void initializeMatrix ()
 initializes the matrix to store the system of equations More...
 
void initializeMatrixRowSize ()
 Initialize the row sizes of the sparse global matrix. More...
 
void initializeMatrixIndices ()
 Determine position of matrix entries. More...
 
void initialize (bool solveTwice=false)
 
void assemble (bool first)
 function which assembles the system of equations to be solved More...
 
void getMpfaFlux (const IntersectionIterator &, const CellData &)
 Compute flux through an irregular interface using a mpfa method. More...
 
void get1pMpfaFlux (const IntersectionIterator &, const CellData &)
 Compute single-phase flux through an irregular interface using a mpfa method. More...
 
void updateMaterialLaws (bool fromPostTimestep=false)
 
int computeTransmissibilities (const IntersectionIterator &, TransmissivityMatrix &, GlobalPosition &, int &, GlobalPosition &, int &)
 Computes the transmissibility coefficients for the MPFA-l method in 3D. More...
 
void adaptPressure ()
 Adapt primary variables vector after adapting the grid. More...
 
 FV3dPressure2P2CAdaptive (Problem &problem)
 Constructs a FVPressure2P2C object. More...
 
void get1pSource (EntryType &sourceEntry, const Element &elementI, const CellData &cellDataI)
 Assembles the source term. More...
 
void get1pStorage (EntryType &storageEntry, const Element &elementI, CellData &cellDataI)
 Assembles the storage term for a 1p cell in a multiphysics framework. More...
 
void get1pFlux (EntryType &entries, const Intersection &intersection, const CellData &cellDataI)
 The compositional single-phase flux in the multiphysics framework. More...
 
void get1pFluxOnBoundary (EntryType &entries, const Intersection &intersection, const CellData &cellDataI)
 The compositional single-phase flux in the multiphysics framework. More...
 
void initialize ()
 Initialize pressure model. 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 update1pMaterialLawsInElement (const Element &elementI, CellData &cellData, bool postTimeStep)
 updates secondary variables of one single phase cell More...
 
template<class MultiWriter >
void addOutputVtkFields (MultiWriter &writer)
 Write data files. More...
 
void getSource (EntryType &sourceEntry, const Element &elementI, const CellData &cellDataI, const bool first)
 Assembles the source term. More...
 
void getStorage (EntryType &storageEntry, const Element &elementI, const CellData &cellDataI, const bool first)
 Assembles the storage term. More...
 
void getFlux (EntryType &entries, const Intersection &intersection, const CellData &cellDataI, const bool first)
 Get flux at an interface between two cells. More...
 
void getFluxOnBoundary (EntryType &entries, const Intersection &intersection, const CellData &cellDataI, const bool first)
 Get flux on Boundary. More...
 
void updateMaterialLawsInElement (const Element &elementI, bool postTimeStep)
 Updates secondary variables of one cell. More...
 
void initialMaterialLaws (bool compositional)
 initializes the fluid distribution and hereby the variables container More...
 
void volumeDerivatives (const GlobalPosition &, const Element &ep)
 Partial derivatives of the volumes w.r.t. changes in total concentration and pressure. More...
 
const Scalar pressure (const int eIdxGlobal) const
 Public access function for the primary pressure variable. 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 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...
 
using ElementMapper = typename SolutionTypes::ElementMapper
 
using DataHandle = VectorCommDataHandleEqual< ElementMapper, Dune::BlockVector< Dune::FieldVector< int, 1 > >, 0 >
 
enum  { rhs = 1 , matrix = 0 }
 Indices of matrix and rhs entries. More...
 
enum  { pressEqIdx = Indices::pressureEqIdx }
 

Protected Member Functions

int transmissibilityAdapter_ (const IntersectionIterator &isIt, InteractionVolume &interactionVolume, const int &subVolumeFaceIdx, bool properFluxDirection, Element &additional2, Element &additional3, TransmissivityMatrix &additionalT)
 Adapter to use the general implementation of the mpfa-l for the compositional models. 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

std::map< int, std::vector< int > > irregularCellMap_
 Container to store all cell's Indice with a hanging node. More...
 
bool enableVolumeIntegral_
 Calculates the volume integral (on by default) More...
 
bool enableMPFA
 Enables mpfa on hanging nodes (on by default) More...
 
int maxInteractionVolumes
 Maximum number of interaction volumes considered (4 by default) More...
 
InteractionVolumeContainer * interactionVolumesContainer_
 A pointer to the adaptive interaction volumes container. More...
 
FvMpfaL3dTransmissibilityCalculator< TypeTag > mpfal3DTransmissibilityCalculator_
 The common implementation to calculate the Transmissibility with the mpfa-L-method. More...
 
Dune::BlockVector< Dune::FieldVector< int, 1 > > nextSubdomain
 vector holding next subdomain More...
 
const GlobalPosition & gravity_
 
Dune::Timer timer_
 A timer for the time spent on the multiphysics framework. More...
 
Problem & problem_
 
bool enableVolumeIntegral
 Enables the volume integral of the pressure equation. More...
 
bool regulateBoundaryPermeability
 Enables regulation of permeability in the direction of a Dirichlet Boundary Condition. More...
 
Scalar minimalBoundaryPermeability
 Minimal limit for the boundary permeability. More...
 
Scalar ErrorTermFactor_
 Handling of error term: relaxation factor. More...
 
Scalar ErrorTermLowerBound_
 Handling of error term: lower bound for error dampening. More...
 
Scalar ErrorTermUpperBound_
 
Matrix A_
 Global stiffnes matrix (sparse matrix which is build by the initializeMatrix() function) More...
 
RHSVector f_
 Right hand side vector. More...
 

Static Protected Attributes

static constexpr int pressureType = getPropValue<TypeTag, Properties::PressureFormulation>()
 gives kind of pressure used ( \( 0 = p_w \), \( 1 = p_n \), \( 2 = p_{global} \)) More...
 

general methods for output

TransportSolutionType updateEstimate_
 Update estimate for changes in volume for the pressure equation. More...
 
VtkMultiWriter< GridView > initializationOutputWriter_
 output for the initialization procedure More...
 
Scalar maxError_
 Maximum volume error of all cells. More...
 
Scalar incp_
 Increment for the volume derivative w.r.t pressure. More...
 
void initializationOutput (double pseudoTS=0.)
 Write additional debug info in a special writer. More...
 

Member Typedef Documentation

◆ DataHandle

template<class TypeTag >
using Dumux::FVPressure2P2CMultiPhysics< TypeTag >::DataHandle = VectorCommDataHandleEqual<ElementMapper, Dune::BlockVector<Dune::FieldVector<int, 1> >, 0>
protectedinherited

◆ ElementMapper

template<class TypeTag >
using Dumux::FVPressure2P2CMultiPhysics< TypeTag >::ElementMapper = typename SolutionTypes::ElementMapper
protectedinherited

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

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

◆ FV3dPressure2P2CAdaptive()

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

Constructs a FVPressure2P2C object.

Parameters
problema problem class object

Member Function Documentation

◆ adaptPressure()

template<class TypeTag >
void Dumux::FV3dPressure2P2CAdaptive< TypeTag >::adaptPressure ( )
inline

Adapt primary variables vector after adapting the grid.

◆ addOutputVtkFields()

template<class TypeTag >
template<class MultiWriter >
void Dumux::FVPressure2P2CMultiPhysics< TypeTag >::addOutputVtkFields ( MultiWriter &  writer)
inlineinherited

Write data files.

Parameters
writerThe writer

◆ assemble()

template<class TypeTag >
void Dumux::FV3dPressure2P2CAdaptive< TypeTag >::assemble ( bool  first)

function which assembles the system of equations to be solved

This function assembles the Matrix and the RHS vectors to solve for a pressure field with an Finite-Volume Discretization in an implicit fashion. Compared to the method in FVPressure, this implementation calculates fluxes near hanging nodes with the mpfa method using the method getMpfaFlux(). Matrix and Right-hand-side entries are done therein.

Parameters
firstFlag if pressure field is unknown

◆ calculateVelocity()

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

◆ computeTransmissibilities()

template<class TypeTag >
int Dumux::FV3dPressure2P2CAdaptive< TypeTag >::computeTransmissibilities ( const IntersectionIterator &  isIt,
TransmissivityMatrix &  T,
GlobalPosition &  globalPos4,
int &  eIdxGlobal4,
GlobalPosition &  globalPos6,
int &  eIdxGlobal6 
)

Computes the transmissibility coefficients for the MPFA-l method in 3D.

For faces with a hanging node in 3D, there are four sub-faces. The first subface contains a unique interaction volume, with is directly calculated by this method. For the remainder of the sub-faces, the interaction volumes are build and calculated by the common mpfa-l–implementation of the 2p models. The latter is established via the protected method FV3dPressure2P2CAdaptive::transmissibilityAdapter_(). The calculated Transmissivity Matrices are (along with some geometric information) stored for later use in Variableclass2p2cadaptive .

Parameters
isItIterator to the current intersection
TTransmissitivity matrix of the first unique interaction volume
globalPos4Position of the 3rd cell (with local Idx 4) of the unique interaction volume
eIdxGlobal4Index of the 3rd cell (with local Idx 4) of the unique interaction volume
globalPos6Position of the 4th cell (with local Idx 6) of the unique interaction volume
eIdxGlobal6Index of the 4th cell (with local Idx 6) of the unique interaction volume

1) get geometrical information of interaction triangle

2) Calculate omega, chi for matrices

3) Calculate A, B, C, D and solve for T

4) Store and/or calculate additional half edges

◆ deserializeEntity()

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

◆ get1pFlux()

template<class TypeTag >
void Dumux::FVPressure2P2CMultiPhysics< TypeTag >::get1pFlux ( EntryType entries,
const Intersection &  intersection,
const CellData &  cellDataI 
)
inherited

The compositional single-phase flux in the multiphysics framework.

If only single-phase conditions are encountered, the flux expression simplifies to (written for the case where the wetting phase is only present):

\[ A_{\gamma} \mathbf{n}_{\gamma}^T \mathbf{K} \lambda_w \mathbf{d}_{ij} \left( \frac{p_{w,j}^t - p^{t}_{w,i}}{\Delta x} + \varrho_{w} \mathbf{g}^T \mathbf{d}_{ij} \right) . \]

Parameters
entriesThe Matrix and RHS entries
intersectionIntersection between cell I and J
cellDataIData of cell I

◆ get1pFluxOnBoundary()

template<class TypeTag >
void Dumux::FVPressure2P2CMultiPhysics< TypeTag >::get1pFluxOnBoundary ( EntryType entries,
const Intersection &  intersection,
const CellData &  cellDataI 
)
inherited

The compositional single-phase flux in the multiphysics framework.

If only single-phase conditions are encountered, the flux expression simplifies to (written for the case where the wetting phase is only present):

\[ A_{\gamma} \mathbf{n}_{\gamma}^T \mathbf{K} \varrho_w \lambda_w \mathbf{d}_{i-Boundary} \left( \frac{p_{w,Boundary}^t - p^{t}_{w,i}}{\Delta x} + \varrho_{w} \mathbf{g}^T \mathbf{d}_{i-Boundary} \right) . \]

If a Neumann BC is set, the given (mass-)flux is directly multiplied by the volume derivative and inserted.

Parameters
entriesThe Matrix and RHS entries
intersectionIntersection between cell I and J
cellDataIData of cell I

◆ get1pMpfaFlux()

template<class TypeTag >
void Dumux::FV3dPressure2P2CAdaptive< TypeTag >::get1pMpfaFlux ( const IntersectionIterator &  isIt,
const CellData &  cellDataI 
)

Compute single-phase flux through an irregular interface using a mpfa method.

A mpfa l-method is applied to calculate fluxes near hanging nodes for multiphysics models, using:

\[ - \lambda_{\alpha} \left( \sum_k \tau_{2k} p^t_{\alpha,k} + \varrho_{\alpha} \sum_k \tau_{2k} \mathbf{g}^T \mathbf{x}_{k} \right) \sum_{\kappa} X^{\kappa}_{\alpha} \]

Depending on the applied interaction volumes (e.g. on the boundary only a single interaction volume might be applied), the stencil also spans over neighboring cells. The contribution in other cells than I or J make it necessary that the matrix and rhs entries are filled up within this function.

Parameters
isItIterator of the intersection between cell I and J
cellDataIData of cell I

get geometrical Info, transmissibility matrix

compute matrix entry: advective fluxes

compute matrix entry: advective fluxes

◆ get1pSource()

template<class TypeTag >
void Dumux::FVPressure2P2CMultiPhysics< TypeTag >::get1pSource ( EntryType sourceEntry,
const Element &  elementI,
const CellData &  cellDataI 
)
inherited

Assembles the source term.

The source is translated into a volumentric source term:

\[ V_i \sum_{\kappa} \frac{1}{\varrho} q^{\kappa}_i \; , \]

because under singlephase conditions

\[ \frac{\partial v_{t}}{\partial C^{\kappa}} \approx \frac{1}{\varrho} \]

.

Parameters
sourceEntryThe Matrix and RHS entries
elementIThe element I
cellDataIData of cell I

◆ get1pStorage()

template<class TypeTag >
void Dumux::FVPressure2P2CMultiPhysics< TypeTag >::get1pStorage ( EntryType storageEntry,
const Element &  elementI,
CellData &  cellDataI 
)
inherited

Assembles the storage term for a 1p cell in a multiphysics framework.

The storage term comprises the (single-phase) compressibility (due to a change in pressure from last timestep):

\[ V_i c_{i} \frac{p^t_i - p^{t-\Delta t}_i}{\Delta t} \]

and the damped error introduced by the incorrect transport of the last timestep:

\[ V_i \alpha_r \frac{v_{t} - \phi}{\Delta t} \]

. The latter is damped according to Fritz 2011.

Parameters
storageEntryThe Matrix and RHS entries
elementIThe element I
cellDataIData of cell I

◆ getFlux()

template<class TypeTag >
void Dumux::FVPressure2P2C< TypeTag >::getFlux ( EntryType entries,
const Intersection &  intersection,
const CellData &  cellDataI,
const bool  first 
)
inherited

Get flux at an interface between two cells.

for first == true, the flux is calculated in traditional fractional-flow forn as in FVPressure2P. for first == false, the flux thorugh \( \gamma \) is calculated via a volume balance formulation

\[ - A_{\gamma} \mathbf{n}^T_{\gamma} \mathbf{K} \sum_{\alpha} \varrho_{\alpha} \lambda_{\alpha} \mathbf{d}_{ij} \left( \frac{p_{\alpha,j}^t - p^{t}_{\alpha,i}}{\Delta x} + \varrho_{\alpha} \mathbf{g}^T \mathbf{d}_{ij} \right) \sum_{\kappa} X^{\kappa}_{\alpha} \frac{\partial v_{t}}{\partial C^{\kappa}} + V_i \frac{A_{\gamma}}{U_i} \mathbf{d}^T \mathbf{K} \sum_{\alpha} \varrho_{\alpha} \lambda_{\alpha} \mathbf{d}_{ij} \left( \frac{p_{\alpha,j}^t - p^{t}_{\alpha,i}}{\Delta x} + \varrho_{\alpha} \mathbf{g}^T \mathbf{d}_{ij} \right) \sum_{\kappa} X^{\kappa}_{\alpha} \frac{\frac{\partial v_{t,j}}{\partial C^{\kappa}_j}-\frac{\partial v_{t,i}}{\partial C^{\kappa}_i}}{\Delta x} \]

This includes a boundary integral and a volume integral, because \( \frac{\partial v_{t,i}}{\partial C^{\kappa}_i} \) is not constant. Here, \( \mathbf{d}_{ij} \) is the normalized vector connecting the cell centers, and \( \mathbf{n}_{\gamma} \) represents the normal of the face \( \gamma \).

Parameters
entriesThe Matrix and RHS entries
intersectionIntersection between cell I and J
cellDataIData of cell I
firstFlag if pressure field is unknown

◆ getFluxOnBoundary()

template<class TypeTag >
void Dumux::FVPressure2P2C< TypeTag >::getFluxOnBoundary ( EntryType entries,
const Intersection &  intersection,
const CellData &  cellDataI,
const bool  first 
)
inherited

Get flux on Boundary.

for first == true, the flux is calculated in traditional fractional-flow forn as in FVPressure2P. for first == false, the flux thorugh \( \gamma \) is calculated via a volume balance formulation

\[ - A_{\gamma} \mathbf{n}^T_{\gamma} \mathbf{K} \sum_{\alpha} \varrho_{\alpha} \lambda_{\alpha} \mathbf{d}_{ij} \left( \frac{p_{\alpha,j}^t - p^{t}_{\alpha,i}}{\Delta x} + \varrho_{\alpha} \mathbf{g}^T \mathbf{d}_{ij} \right) \sum_{\kappa} \frac{\partial v_{t}}{\partial C^{\kappa}} X^{\kappa}_{\alpha} \;, \]

where we skip the volume integral assuming \( \frac{\partial v_{t,i}}{\partial C^{\kappa}_i} \) to be constant at the boundary. Here, \( \mathbf{d}_{ij} \) is the normalized vector connecting the cell centers, and \( \mathbf{n}_{\gamma} \) represents the normal of the face \( \gamma \).

If a Neumann BC is set, the given (mass-)flux is directly multiplied by the volume derivative and inserted.

Parameters
entriesThe Matrix and RHS entries
intersectionIntersection between cell I and J
cellDataIData of cell I
firstFlag if pressure field is unknown

◆ getMpfaFlux()

template<class TypeTag >
void Dumux::FV3dPressure2P2CAdaptive< TypeTag >::getMpfaFlux ( const IntersectionIterator &  isIt,
const CellData &  cellDataI 
)

Compute flux through an irregular interface using a mpfa method.

A mpfa l-method is applied to calculate fluxes near hanging nodes, using:

\[ - \sum_{\alpha} \varrho_{\alpha} \lambda_{\alpha} \left( \sum_k \tau_{2k} p^t_{\alpha,k} + \varrho_{\alpha} \sum_k \tau_{2k} \mathbf{g}^T \mathbf{x}_{k} \right) \sum_{\kappa} X^{\kappa}_{\alpha} \frac{\partial v_{t}}{\partial C^{\kappa}} + \frac{ V_i}{U_i} \sum_{\alpha} \varrho_{\alpha} \lambda_{\alpha} \left( \sum_k \tau_{2k} p^t_{\alpha,k} + \varrho_{\alpha} \sum_k \tau_{2k} \mathbf{g}^T \mathbf{x}_{k} \right) \sum_{\kappa} X^{\kappa}_{\alpha} \frac{\frac{\partial v_{t,j}}{\partial C^{\kappa}_j} -\frac{\partial v_{t,i}}{\partial C^{\kappa}_i}}{\Delta x} \]

Depending on the applied interaction volumes (e.g. on the boundary only a single interaction volume might be applied), the stencil also spans over neighboring cells. The contribution in other cells than I or J make it necessary that the matrix and rhs entries are filled up within this function.

Parameters
isItIterator of the intersection between cell I and J
cellDataIData of cell I

◆ getSource()

template<class TypeTag >
void Dumux::FVPressure2P2C< TypeTag >::getSource ( EntryType sourceEntry,
const Element &  elementI,
const CellData &  cellDataI,
const bool  first 
)
inherited

Assembles the source term.

for first == true, a source is implemented as in FVPressure2P. for first == false, the source is translated into a volumentric source term:

\[ V_i \sum_{\kappa} \frac{\partial v_{t}}{\partial C^{\kappa}} q^{\kappa}_i \]

.

Parameters
sourceEntryThe Matrix and RHS entries
elementIThe element I
cellDataIData of cell I
firstFlag if pressure field is unknown

◆ getStorage()

template<class TypeTag >
void Dumux::FVPressure2P2C< TypeTag >::getStorage ( EntryType storageEntry,
const Element &  elementI,
const CellData &  cellDataI,
const bool  first 
)
inherited

Assembles the storage term.

for first == true, there is no storage contribution. for first == false, the storage term comprises the compressibility (due to a change in pressure from last timestep):

\[ V_i c_{t,i} \frac{p^t_i - p^{t-\Delta t}_i}{\Delta t} \]

and the damped error introduced by the incorrect transport of the last timestep:

\[ V_i \alpha_r \frac{v_{t} - \phi}{\Delta t} \]

. The latter is damped according to Fritz 2011.

Parameters
storageEntryThe Matrix and RHS entries
elementIThe element I
cellDataIData of cell I
firstFlag if pressure field is unknown

◆ globalMatrix()

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

Returns the global matrix of the last pressure solution step.

◆ initializationOutput()

template<class TypeTag >
void Dumux::FVPressureCompositional< TypeTag >::initializationOutput ( double  pseudoTS = 0.)
inlineinherited

Write additional debug info in a special writer.

To visualize the different steps through the initialization procedure, we use very small pseudo time steps only for the writer! This is only for debugging of the initialization procedure.

Parameters
pseudoTSTime steps that only appear in the writer, not real.

◆ 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::FV3dPressure2P2CAdaptive< TypeTag >::initialize ( bool  solveTwice = false)
inline

◆ initializeMatrix()

template<class TypeTag >
void Dumux::FV3dPressure2P2CAdaptive< TypeTag >::initializeMatrix

initializes the matrix to store the system of equations

In comparison with the Tpfa method, an mpfa uses a larger flux stencil, hence more matrix entries are required if not only the unique interaction region on the hanging nodes are considered. The method checks weather the additonally regarded cells through mpfa are already "normal" neighbors for fluxes through other interfaces, or if they need to be added.

◆ initializeMatrixIndices()

template<class TypeTag >
void Dumux::FV3dPressure2P2CAdaptive< TypeTag >::initializeMatrixIndices

Determine position of matrix entries.

◆ initializeMatrixRowSize()

template<class TypeTag >
void Dumux::FV3dPressure2P2CAdaptive< TypeTag >::initializeMatrixRowSize

Initialize the row sizes of the sparse global matrix.

◆ initializePressure()

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

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

◆ initialMaterialLaws()

template<class TypeTag >
void Dumux::FVPressureCompositional< TypeTag >::initialMaterialLaws ( bool  compositional)
inherited

initializes the fluid distribution and hereby the variables container

It differs from updateMaterialLaws() because there are two possible initial conditions: saturations and concentration.

Parameters
compositionalflag that determines if compositional effects are regarded, i.e. a reasonable pressure field is known with which compositions can be calculated.

◆ 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::FVPressure2P2CMultiPhysics< 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.

◆ transmissibilityAdapter_()

template<class TypeTag >
int Dumux::FV3dPressure2P2CAdaptive< TypeTag >::transmissibilityAdapter_ ( const IntersectionIterator &  isIt,
InteractionVolume &  interactionVolume,
const int &  subVolumeFaceIdx,
bool  properFluxDirection,
Element &  additional2,
Element &  additional3,
TransmissivityMatrix &  additionalT 
)
protected

Adapter to use the general implementation of the mpfa-l for the compositional models.

Depending on the subVolumeFaceIdx, the appropriate method in FvMpfaL2dTransmissibilityCalculator (potentially specifying certain cases) gets called and the transmissibility and geometric information of the applied additional cells of the interaction regions are passed back.

Parameters
isItIterator to the current intersection
interactionVolumeThe current interaction Volume object of interest
subVolumeFaceIdxThe local index of the intersection of interest in the interaction volume
properFluxDirectionTrue if the intersection normal coincides with the local indexing in the interaction volume
[out]additional2The 3rd cell's element in the interaction volume
[out]additional3The 4th cell's element in the interaction volume
[out]additionalTTransmissitivity matrix calculated

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

update of interaction volumes

Todo:
maybe only do this if the grid changed

◆ update1pMaterialLawsInElement()

template<class TypeTag >
void Dumux::FVPressure2P2CMultiPhysics< TypeTag >::update1pMaterialLawsInElement ( const Element &  elementI,
CellData &  cellData,
bool  postTimeStep 
)
inherited

updates secondary variables of one single phase cell

For each element, the secondary variables are updated according to the primary variables. Only a simple flash calulation has to be carried out, as phase distribution is already known: single-phase.

Parameters
elementIThe element
cellDataThe cell data of the current element
postTimeStepFlag indicating if we have just completed a time step

◆ updateMaterialLaws()

template<class TypeTag >
void Dumux::FV3dPressure2P2CAdaptive< TypeTag >::updateMaterialLaws ( bool  fromPostTimestep = false)

constitutive functions are updated once if new concentrations are calculated and stored in the variables container

In contrast to the standard sequential 2p2c model, this method also holds routines to adapt the subdomain. The subdomain indicates weather we are in 1p domain (value = 1) or in the two phase subdomain (value = 2). After the grid adaption, update of the subdomain is explicitly avoided.

◆ updateMaterialLawsInElement()

template<class TypeTag >
void Dumux::FVPressure2P2C< TypeTag >::updateMaterialLawsInElement ( const Element &  element,
bool  postTimeStep 
)
inherited

Updates secondary variables of one cell.

For each element, the secondary variables are updated according to the primary variables. In case the method is called after the Transport, i.e. at the end / post time step, CellData2p2c.reset() resets the volume derivatives for the next time step.

Parameters
elementThe element
postTimeStepFlag indicating if we have just completed a time step

◆ updateVelocity()

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

◆ volumeDerivatives()

template<class TypeTag >
void Dumux::FVPressureCompositional< TypeTag >::volumeDerivatives ( const GlobalPosition &  globalPos,
const Element &  element 
)
inherited

Partial derivatives of the volumes w.r.t. changes in total concentration and pressure.

This method calculates the volume derivatives via a secant method, where the secants are gained in a pre-computational step via the transport equation and the last TS size. The partial derivatives w.r.t. mass are defined as \( \frac{\partial v}{\partial C^{\kappa}} = \frac{\partial V}{\partial m^{\kappa}}\)

Parameters
globalPosThe global position of the current element
elementThe current element

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)

◆ enableMPFA

template<class TypeTag >
bool Dumux::FV3dPressure2P2CAdaptive< TypeTag >::enableMPFA
protected

Enables mpfa on hanging nodes (on by default)

◆ enableVolumeIntegral

template<class TypeTag >
bool Dumux::FVPressure2P2C< TypeTag >::enableVolumeIntegral
protectedinherited

Enables the volume integral of the pressure equation.

◆ enableVolumeIntegral_

template<class TypeTag >
bool Dumux::FV3dPressure2P2CAdaptive< TypeTag >::enableVolumeIntegral_
protected

Calculates the volume integral (on by default)

◆ ErrorTermFactor_

template<class TypeTag >
Scalar Dumux::FVPressure2P2C< TypeTag >::ErrorTermFactor_
protectedinherited

Handling of error term: relaxation factor.

◆ ErrorTermLowerBound_

template<class TypeTag >
Scalar Dumux::FVPressure2P2C< TypeTag >::ErrorTermLowerBound_
protectedinherited

Handling of error term: lower bound for error dampening.

◆ ErrorTermUpperBound_

template<class TypeTag >
Scalar Dumux::FVPressure2P2C< TypeTag >::ErrorTermUpperBound_
protectedinherited

Handling of error term: upper bound for error dampening

◆ f_

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

Right hand side vector.

◆ gravity_

template<class TypeTag >
const GlobalPosition& Dumux::FVPressure2P2CMultiPhysics< TypeTag >::gravity_
protectedinherited

vector including the gravity constant

◆ incp_

template<class TypeTag >
Scalar Dumux::FVPressureCompositional< TypeTag >::incp_
protectedinherited

Increment for the volume derivative w.r.t pressure.

◆ initializationOutputWriter_

template<class TypeTag >
VtkMultiWriter<GridView> Dumux::FVPressureCompositional< TypeTag >::initializationOutputWriter_
protectedinherited

output for the initialization procedure

◆ interactionVolumesContainer_

template<class TypeTag >
InteractionVolumeContainer* Dumux::FV3dPressure2P2CAdaptive< TypeTag >::interactionVolumesContainer_
protected

A pointer to the adaptive interaction volumes container.

◆ irregularCellMap_

template<class TypeTag >
std::map<int, std::vector<int> > Dumux::FV3dPressure2P2CAdaptive< TypeTag >::irregularCellMap_
protected

Container to store all cell's Indice with a hanging node.

◆ maxError_

template<class TypeTag >
Scalar Dumux::FVPressureCompositional< TypeTag >::maxError_
protectedinherited

Maximum volume error of all cells.

◆ maxInteractionVolumes

template<class TypeTag >
int Dumux::FV3dPressure2P2CAdaptive< TypeTag >::maxInteractionVolumes
protected

Maximum number of interaction volumes considered (4 by default)

◆ minimalBoundaryPermeability

template<class TypeTag >
Scalar Dumux::FVPressure2P2C< TypeTag >::minimalBoundaryPermeability
protectedinherited

Minimal limit for the boundary permeability.

◆ mpfal3DTransmissibilityCalculator_

template<class TypeTag >
FvMpfaL3dTransmissibilityCalculator<TypeTag> Dumux::FV3dPressure2P2CAdaptive< TypeTag >::mpfal3DTransmissibilityCalculator_
protected

The common implementation to calculate the Transmissibility with the mpfa-L-method.

◆ nextSubdomain

template<class TypeTag >
Dune::BlockVector<Dune::FieldVector<int,1> > Dumux::FVPressure2P2CMultiPhysics< TypeTag >::nextSubdomain
protectedinherited

vector holding next subdomain

◆ pressureType

template<class TypeTag >
constexpr int Dumux::FVPressure2P2CMultiPhysics< TypeTag >::pressureType = getPropValue<TypeTag, Properties::PressureFormulation>()
staticconstexprprotectedinherited

gives kind of pressure used ( \( 0 = p_w \), \( 1 = p_n \), \( 2 = p_{global} \))

◆ problem_

template<class TypeTag >
Problem& Dumux::FVPressure2P2C< TypeTag >::problem_
protectedinherited

◆ regulateBoundaryPermeability

template<class TypeTag >
bool Dumux::FVPressure2P2C< TypeTag >::regulateBoundaryPermeability
protectedinherited

Enables regulation of permeability in the direction of a Dirichlet Boundary Condition.

◆ timer_

template<class TypeTag >
Dune::Timer Dumux::FVPressure2P2CMultiPhysics< TypeTag >::timer_
protectedinherited

A timer for the time spent on the multiphysics framework.

◆ updateEstimate_

template<class TypeTag >
TransportSolutionType Dumux::FVPressureCompositional< TypeTag >::updateEstimate_
protectedinherited

Update estimate for changes in volume for the pressure equation.


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