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

Compositional Transport step in a Finite Volume discretization for a adaptive 2D-grid. More...

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

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

Description

template<class TypeTag>
class Dumux::FV2dTransport2P2CAdaptive< TypeTag >

Compositional Transport step in a Finite Volume discretization for a adaptive 2D-grid.

The finite volume model for the solution of the transport equation for compositional two-phase flow.

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

where \( \bf{v}_{\alpha} = - \lambda_{\alpha} \bf{K} \left(\nabla p_{\alpha} + \rho_{\alpha} \bf{g} \right) \). \( 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.

Template Parameters
TypeTagThe Type Tag

Public Types

using EntryType = Dune::FieldVector< Scalar, 2 >
 
using TimeStepFluxType = Dune::FieldVector< Scalar, 2 >
 

Public Member Functions

virtual void update (const Scalar t, Scalar &dt, TransportSolutionType &updateVec, bool impes=false)
 Calculate the update vector and determine timestep size. More...
 
void getMpfaFlux (Dune::FieldVector< Scalar, 2 > &, Dune::FieldVector< Scalar, 2 > &, const IntersectionIterator &, CellData &)
 Compute flux over an irregular interface using a mpfa method. More...
 
 FV2dTransport2P2CAdaptive (Problem &problem)
 Constructs a FV2dTransport2P2CAdaptive object. More...
 
virtual ~FV2dTransport2P2CAdaptive ()
 
void updateTransportedQuantity (TransportSolutionType &updateVector)
 Updates the transported quantity once an update is calculated. More...
 
void updateTransportedQuantity (TransportSolutionType &updateVector, Scalar dt)
 Updates the transported quantity once an update is calculated. More...
 
void updateConcentrations (TransportSolutionType &updateVector, Scalar dt)
 Updates the concentrations once an update is calculated. More...
 
void getFlux (ComponentVector &fluxEntries, EntryType &timestepFlux, const Intersection &intersection, CellData &cellDataI)
 Get flux at an interface between two cells The flux through \( \gamma \) is calculated according to the underlying pressure field, calculated by the pressure model. More...
 
void getFluxOnBoundary (ComponentVector &fluxEntries, EntryType &timestepFlux, const Intersection &intersection, const CellData &cellDataI)
 Get flux on Boundary. More...
 
void evalBoundary (GlobalPosition globalPosFace, const Intersection &intersection, FluidState &BCfluidState, PhaseVector &pressBound)
 Evaluate the boundary conditions. More...
 
void initialize ()
 Set the initial values before the first pressure equation This method is called before first pressure equation is solved from IMPET. More...
 
template<class MultiWriter >
void addOutputVtkFields (MultiWriter &writer)
 Write transport variables into the output files. More...
 
void serializeEntity (std::ostream &outstream, const Element &element)
 Function needed for restart option of the transport model: Write out. More...
 
void deserializeEntity (std::istream &instream, const Element &element)
 Function needed for restart option of the transport model: Read in. More...
 

Protected Member Functions

void innerUpdate (TransportSolutionType &updateVec)
 

Protected Attributes

Problem & problem_
 
bool enableMPFA
 

Static Protected Attributes

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

Access functions for protected variables <br>

TransportSolutionType totalConcentration_
 private vector of transported primary variables More...
 
bool impet_
 indicating if we are in an estimate (false) or real impet (true) step. More...
 
int averagedFaces_
 number of faces were flux was restricted More...
 
int restrictFluxInTransport_
 Restriction of flux on new pressure field if direction reverses from 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...
 
bool switchNormals
 
Scalar accumulatedDt_
 Current time-interval in sub-time-stepping routine. More...
 
const Scalar dtThreshold_
 Threshold for sub-time-stepping routine. More...
 
std::vector< LocalTimesteppingData > timeStepData_
 Stores data for sub-time-stepping. More...
 
Scalar subCFLFactor_
 
bool localTimeStepping_
 
int verbosity_
 
void getTransportedQuantity (TransportSolutionType &transportedQuantity)
 Return the vector of the transported quantity For an immiscible IMPES scheme, this is the saturation. For compositional simulations, however, the total concentration of all components is transported. More...
 
Scalar & totalConcentration (int compIdx, int eIdxGlobal)
 Return the the total concentration stored in the transport vector To get real cell values, do not acess this method, but rather call the respective function in the cell data object. More...
 
void getSource (Scalar &update, const Element &element, CellData &cellDataI)
 
template<class DataEntry >
bool inPhysicalRange (DataEntry &entry)
 Function to control the abort of the transport-sub-time-stepping depending on a physical parameter range. More...
 
bool enableLocalTimeStepping ()
 Function to check if local time stepping is activated. More...
 
void updatedTargetDt_ (Scalar &dt)
 
void resetTimeStepData_ ()
 

Member Typedef Documentation

◆ EntryType

template<class TypeTag >
using Dumux::FVTransport2P2C< TypeTag >::EntryType = Dune::FieldVector<Scalar, 2>
inherited

Type of the vector of entries

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

◆ TimeStepFluxType

template<class TypeTag >
using Dumux::FVTransport2P2C< TypeTag >::TimeStepFluxType = Dune::FieldVector<Scalar, 2>
inherited

Constructor & Destructor Documentation

◆ FV2dTransport2P2CAdaptive()

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

Constructs a FV2dTransport2P2CAdaptive object.

The compositional transport scheme can not be applied with a global pressure / total velocity formulation. This is a 2D-specific implementation! In case of 3d, use the class FV3dTransport2P2CAdaptive

Parameters
problema problem class object

◆ ~FV2dTransport2P2CAdaptive()

template<class TypeTag >
virtual Dumux::FV2dTransport2P2CAdaptive< TypeTag >::~FV2dTransport2P2CAdaptive ( )
inlinevirtual

Member Function Documentation

◆ addOutputVtkFields()

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

Write transport variables into the output files.

Parameters
writerapplied VTK-writer

◆ deserializeEntity()

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

Function needed for restart option of the transport model: Read in.

◆ enableLocalTimeStepping()

template<class TypeTag >
bool Dumux::FVTransport2P2C< TypeTag >::enableLocalTimeStepping ( )
inlineinherited

Function to check if local time stepping is activated.

◆ evalBoundary()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::evalBoundary ( GlobalPosition  globalPosFace,
const Intersection &  intersection,
FluidState &  BCfluidState,
PhaseVector &  pressBound 
)
inherited

Evaluate the boundary conditions.

As the transport primary variable in this formulation is the total component concentration, \( C^{\kappa} \) it seems natural that the boundary values are also total concentrations. However, as for the initial conditions, it is possible to define boundaries by means of a saturation. This choice determines which version of flash calculation is necessary to get to the composition at the boundary.

Parameters
globalPosFaceThe global position of the face of the current boundary cell
intersectionThe current intersection
BCfluidStateFluidState object that is used for the boundary
pressBoundBoundary values of phase pressures

◆ getFlux()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::getFlux ( ComponentVector &  fluxEntries,
EntryType timestepFlux,
const Intersection &  intersection,
CellData &  cellDataI 
)
inherited

Get flux at an interface between two cells The flux through \( \gamma \) is calculated according to the underlying pressure field, calculated by the pressure model.

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

Here, \( \mathbf{d}_{ij} \) is the normalized vector connecting the cell centers, and \( \mathbf{n}_{\gamma} \) represents the normal of the face \( \gamma \). Due to the nature of the primay Variable, the (volume-)specific total mass concentration, this represents a mass flux per cell volume.

Parameters
fluxEntriesThe flux entries, mass influx from cell \(j\) to \(i\).
timestepFluxflow velocities for timestep estimation
intersectionThe intersection
cellDataIThe cell data for cell \(i\)

◆ getFluxOnBoundary()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::getFluxOnBoundary ( ComponentVector &  fluxEntries,
EntryType timestepFlux,
const Intersection &  intersection,
const CellData &  cellDataI 
)
inherited

Get flux on Boundary.

The flux through \( \gamma \) is calculated according to the underlying pressure field, calculated by the pressure model.

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

Here, \( \mathbf{u} \) is the normalized vector connecting the cell centers, and \( \mathbf{n}_{\gamma_{ij}} \) represents the normal of the face \( \gamma{ij} \).

Parameters
fluxEntriesThe flux entries, mass influx from cell \(j\) to \(i\).
timestepFluxflow velocities for timestep estimation
intersectionThe intersection
cellDataIThe cell data for cell \(i\)

◆ getMpfaFlux()

template<class TypeTag >
void Dumux::FV2dTransport2P2CAdaptive< TypeTag >::getMpfaFlux ( Dune::FieldVector< Scalar, 2 > &  fluxEntries,
Dune::FieldVector< Scalar, 2 > &  timestepFlux,
const IntersectionIterator &  intersectionIterator,
CellData &  cellDataI 
)

Compute flux over 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} \]

We provide two options: Calculating the flux expressed by twice the flux through the one unique interaction region on the hanging node if one halfedge is stored (eg on boundaries). Or using the second interaction region covering neighboring cells.

Parameters
fluxEntriesThe flux entries, mass influx from cell \(j\) to \(i\).
timestepFluxflow velocities for timestep estimation
intersectionIteratorIterator of the intersection between cell I and J
cellDataIThe cell data for cell \(i\)

get geometrical Info, transmissibility matrix

◆ getSource()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::getSource ( Scalar &  update,
const Element &  element,
CellData &  cellDataI 
)
inlineinherited

◆ getTransportedQuantity()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::getTransportedQuantity ( TransportSolutionType &  transportedQuantity)
inlineinherited

Return the vector of the transported quantity For an immiscible IMPES scheme, this is the saturation. For compositional simulations, however, the total concentration of all components is transported.

Parameters
transportedQuantityVector of both transported components

◆ initialize()

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

Set the initial values before the first pressure equation This method is called before first pressure equation is solved from IMPET.

◆ innerUpdate()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::innerUpdate ( TransportSolutionType &  updateVec)
protectedinherited

◆ inPhysicalRange()

template<class TypeTag >
template<class DataEntry >
bool Dumux::FVTransport2P2C< TypeTag >::inPhysicalRange ( DataEntry &  entry)
inlineinherited

Function to control the abort of the transport-sub-time-stepping depending on a physical parameter range.

Parameters
entryCell entries of the update vector

◆ resetTimeStepData_()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::resetTimeStepData_ ( )
inlineprotectedinherited

◆ serializeEntity()

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

Function needed for restart option of the transport model: Write out.

◆ totalConcentration()

template<class TypeTag >
Scalar & Dumux::FVTransport2P2C< TypeTag >::totalConcentration ( int  compIdx,
int  eIdxGlobal 
)
inlineinherited

Return the the total concentration stored in the transport vector To get real cell values, do not acess this method, but rather call the respective function in the cell data object.

Parameters
compIdxThe index of the component
eIdxGlobalThe global index of the current cell.

◆ update()

template<class TypeTag >
void Dumux::FV2dTransport2P2CAdaptive< TypeTag >::update ( const Scalar  t,
Scalar &  dt,
TransportSolutionType &  updateVec,
bool  impet = false 
)
virtual

Calculate the update vector and determine timestep size.

This method calculates the update vector \( u \) of the discretized equation

\[ C^{\kappa , new} = C^{\kappa , old} + u, \]

where \( u = \sum_{\gamma} \boldsymbol{v}_{\alpha} * \varrho_{\alpha} * X^{\kappa}_{\alpha} * \boldsymbol{n} * A_{\gamma} \), \( \boldsymbol{n} \) is the face normal and \( A_{\gamma} \) is the face area of face \( \gamma \). In addition to the update vector, the recommended time step size dt is calculated employing a CFL condition. This method uses a standard Tpfa method for regular fluxes, and a MPFA can be used near hanging nodes. The lengths of the vectors are resized to agree with the current grid resolution.

Parameters
tCurrent simulation time \(\mathrm{[s]}\)
[out]dtTime step size \(\mathrm{[s]}\)
[out]updateVecUpdate vector, or update estimate for secants, resp. Here in \(\mathrm{[kg/m^3]}\)
impetFlag that determines if it is a real impet step or an update estimate for volume derivatives

Reimplemented from Dumux::FVTransport2P2C< TypeTag >.

◆ updateConcentrations()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::updateConcentrations ( TransportSolutionType &  updateVector,
Scalar  dt 
)
inherited

Updates the concentrations once an update is calculated.

This method updates both, the internal transport solution vector and the entries in the cellData.

Parameters
updateVectorUpdate vector, or update estimate for secants, resp. Here in \(\mathrm{[kg/m^3]}\)
dtTime step size \(\mathrm{[s]}\)

◆ updatedTargetDt_()

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::updatedTargetDt_ ( Scalar &  dt)
protectedinherited

◆ updateTransportedQuantity() [1/2]

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::updateTransportedQuantity ( TransportSolutionType &  updateVector)
inherited

Updates the transported quantity once an update is calculated.

This method updates both, the internal transport solution vector and the entries in the cellData.

Parameters
updateVectorUpdate vector, or update estimate for secants, resp. Here in \(\mathrm{[kg/m^3]}\)

◆ updateTransportedQuantity() [2/2]

template<class TypeTag >
void Dumux::FVTransport2P2C< TypeTag >::updateTransportedQuantity ( TransportSolutionType &  updateVector,
Scalar  dt 
)
inherited

Updates the transported quantity once an update is calculated.

This method updates both, the internal transport solution vector and the entries in the cellData.

Parameters
updateVectorUpdate vector, or update estimate for secants, resp. Here in \(\mathrm{[kg/m^3]}\)
dtTime step size \(\mathrm{[s]}\)

Member Data Documentation

◆ accumulatedDt_

template<class TypeTag >
Scalar Dumux::FVTransport2P2C< TypeTag >::accumulatedDt_
protectedinherited

Current time-interval in sub-time-stepping routine.

◆ averagedFaces_

template<class TypeTag >
int Dumux::FVTransport2P2C< TypeTag >::averagedFaces_
protectedinherited

number of faces were flux was restricted

◆ dtThreshold_

template<class TypeTag >
const Scalar Dumux::FVTransport2P2C< TypeTag >::dtThreshold_
protectedinherited

Threshold for sub-time-stepping routine.

◆ enableMPFA

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

◆ impet_

template<class TypeTag >
bool Dumux::FVTransport2P2C< TypeTag >::impet_
protectedinherited

indicating if we are in an estimate (false) or real impet (true) step.

◆ localTimeStepping_

template<class TypeTag >
bool Dumux::FVTransport2P2C< TypeTag >::localTimeStepping_
protectedinherited

◆ minimalBoundaryPermeability

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

Minimal limit for the boundary permeability.

◆ pressureType

template<class TypeTag >
const int Dumux::FV2dTransport2P2CAdaptive< TypeTag >::pressureType = getPropValue<TypeTag, Properties::PressureFormulation>()
staticprotected

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

‍Specifies if the MPFA is used on hanging nodes

◆ problem_

template<class TypeTag >
Problem& Dumux::FV2dTransport2P2CAdaptive< TypeTag >::problem_
protected

◆ regulateBoundaryPermeability

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

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

◆ restrictFluxInTransport_

template<class TypeTag >
int Dumux::FVTransport2P2C< TypeTag >::restrictFluxInTransport_
protectedinherited

Restriction of flux on new pressure field if direction reverses from the pressure equation.

◆ subCFLFactor_

template<class TypeTag >
Scalar Dumux::FVTransport2P2C< TypeTag >::subCFLFactor_
protectedinherited

◆ switchNormals

template<class TypeTag >
bool Dumux::FVTransport2P2C< TypeTag >::switchNormals
protectedinherited

◆ timeStepData_

template<class TypeTag >
std::vector<LocalTimesteppingData> Dumux::FVTransport2P2C< TypeTag >::timeStepData_
protectedinherited

Stores data for sub-time-stepping.

◆ totalConcentration_

template<class TypeTag >
TransportSolutionType Dumux::FVTransport2P2C< TypeTag >::totalConcentration_
protectedinherited

private vector of transported primary variables

◆ verbosity_

template<class TypeTag >
int Dumux::FVTransport2P2C< TypeTag >::verbosity_
protectedinherited

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