Opm::ForchheimerExtensiveQuantities< TypeTag > Class Template Reference

Provides the Forchheimer flux module. More...

#include <forchheimerfluxmodule.hh>

Inheritance diagram for Opm::ForchheimerExtensiveQuantities< TypeTag >:
Inheritance graph

Public Member Functions

const Evaluation & ergunCoefficient () const
 Return the Ergun coefficent at the face's integration point. More...
 
Evaluation & mobilityPassabilityRatio (unsigned phaseIdx) const
 Return the ratio of the mobility divided by the passability at the face's integration point for a given fluid phase. More...
 
const DimMatrix & intrinsicPermability () const
 Returns the intrinsic permeability tensor for a given sub-control volume face. More...
 
const EvalDimVector & potentialGrad (unsigned phaseIdx) const
 Return the pressure potential gradient of a fluid phase at the face's integration point [Pa/m]. More...
 
const EvalDimVector & filterVelocity (unsigned phaseIdx) const
 Return the filter velocity of a fluid phase at the face's integration point [m/s]. More...
 
const Evaluation & volumeFlux (unsigned phaseIdx) const
 Return the volume flux of a fluid phase at the face's integration point $[m^3/s / m^2]$. More...
 

Protected Member Functions

void calculateGradients_ (const ElementContext &elemCtx, unsigned faceIdx, unsigned timeIdx)
 
template<class FluidState >
void calculateBoundaryGradients_ (const ElementContext &elemCtx, unsigned boundaryFaceIdx, unsigned timeIdx, const FluidState &fluidState)
 
void calculateFluxes_ (const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
 Calculate the volumetric fluxes of all phases. More...
 
void calculateBoundaryFluxes_ (const ElementContext &elemCtx, unsigned bfIdx, unsigned timeIdx)
 Calculate the volumetric flux rates of all phases at the domain boundary. More...
 
void calculateForchheimerFlux_ (unsigned phaseIdx)
 
void forchheimerResid_ (DimEvalVector &residual, unsigned phaseIdx) const
 
void gradForchheimerResid_ (DimEvalVector &residual, DimEvalMatrix &gradResid, unsigned phaseIdx)
 
bool isDiagonal_ (const DimMatrix &K) const
 Check whether all off-diagonal entries of a tensor are zero. More...
 
short upstreamIndex_ (unsigned phaseIdx) const
 
short downstreamIndex_ (unsigned phaseIdx) const
 
void calculateFilterVelocity_ (unsigned phaseIdx)
 

Protected Attributes

DimVector sqrtK_
 
Evaluation ergunCoefficient_
 
Evaluation mobilityPassabilityRatio_ [numPhases]
 
Evaluation density_ [numPhases]
 
DimMatrix K_
 
Evaluation mobility_ [numPhases]
 
EvalDimVector filterVelocity_ [numPhases]
 
Evaluation volumeFlux_ [numPhases]
 
EvalDimVector potentialGrad_ [numPhases]
 
short upstreamDofIdx_ [numPhases]
 
short downstreamDofIdx_ [numPhases]
 
short interiorDofIdx_
 
short exteriorDofIdx_
 

Detailed Description

template<class TypeTag>
class Opm::ForchheimerExtensiveQuantities< TypeTag >

Provides the Forchheimer flux module.

The commonly used Darcy relation looses its validity for Reynolds numbers $ Re <
  1$. If one encounters flow velocities in porous media above this threshold, the Forchheimer approach can be used. Like the Darcy approach, it is a relation of with the fluid velocity in terms of the gradient of pressure potential. However, this relation is not linear (as in the Darcy case) any more.

Therefore, the Newton scheme is used to solve the Forchheimer equation. This velocity is then used like the Darcy velocity e.g. by the local residual.

Note that for Reynolds numbers above $\approx 500$ the standard Forchheimer relation also looses it's validity.

The Forchheimer equation is given by the following relation:

\[
 \nabla p_\alpha - \rho_\alpha \vec{g} =
 - \frac{\mu_\alpha}{k_{r,\alpha}} K^{-1}\vec{v}_\alpha
 - \frac{\rho_\alpha C_E}{\eta_{r,\alpha}} \sqrt{K}^{-1}
 \left| \vec{v}_\alpha \right| \vec{v}_\alpha
\]

Where $C_E$ is the modified Ergun parameter and $\eta_{r,\alpha}$ is the passability which is given by a closure relation (usually it is assumed to be identical to the relative permeability). To avoid numerical problems, the relation implemented by this class multiplies both sides with $\frac{k_{r_alpha}}{mu} K$, so we get

\[
 \frac{k_{r_alpha}}{mu} K \left( \nabla p_\alpha - \rho_\alpha \vec{g}\right) =
 - \vec{v}_\alpha
 - \frac{\rho_\alpha C_E}{\eta_{r,\alpha}}  \frac{k_{r_alpha}}{mu} \sqrt{K}
 \left| \vec{v}_\alpha \right| \vec{v}_\alpha
\]

Member Function Documentation

◆ calculateBoundaryFluxes_()

template<class TypeTag >
void Opm::ForchheimerExtensiveQuantities< TypeTag >::calculateBoundaryFluxes_ ( const ElementContext &  elemCtx,
unsigned  bfIdx,
unsigned  timeIdx 
)
inlineprotected

◆ calculateBoundaryGradients_()

◆ calculateFilterVelocity_()

◆ calculateFluxes_()

template<class TypeTag >
void Opm::ForchheimerExtensiveQuantities< TypeTag >::calculateFluxes_ ( const ElementContext &  elemCtx,
unsigned  scvfIdx,
unsigned  timeIdx 
)
inlineprotected

Calculate the volumetric fluxes of all phases.

The pressure potentials and upwind directions must already be determined before calling this method!

References Opm::ForchheimerExtensiveQuantities< TypeTag >::calculateForchheimerFlux_(), Opm::ForchheimerExtensiveQuantities< TypeTag >::ergunCoefficient_, Opm::DarcyExtensiveQuantities< TypeTag >::filterVelocity_, and Opm::DarcyExtensiveQuantities< TypeTag >::volumeFlux_.

◆ calculateForchheimerFlux_()

◆ calculateGradients_()

◆ downstreamIndex_()

template<class TypeTag >
short Opm::DarcyExtensiveQuantities< TypeTag >::downstreamIndex_ ( unsigned  phaseIdx) const
inlineprotectedinherited

◆ ergunCoefficient()

template<class TypeTag >
const Evaluation & Opm::ForchheimerExtensiveQuantities< TypeTag >::ergunCoefficient ( ) const
inline

Return the Ergun coefficent at the face's integration point.

References Opm::ForchheimerExtensiveQuantities< TypeTag >::ergunCoefficient_.

◆ filterVelocity()

template<class TypeTag >
const EvalDimVector & Opm::DarcyExtensiveQuantities< TypeTag >::filterVelocity ( unsigned  phaseIdx) const
inlineinherited

Return the filter velocity of a fluid phase at the face's integration point [m/s].

Parameters
phaseIdxThe index of the fluid phase

References Opm::DarcyExtensiveQuantities< TypeTag >::filterVelocity_.

◆ forchheimerResid_()

◆ gradForchheimerResid_()

template<class TypeTag >
void Opm::ForchheimerExtensiveQuantities< TypeTag >::gradForchheimerResid_ ( DimEvalVector &  residual,
DimEvalMatrix &  gradResid,
unsigned  phaseIdx 
)
inlineprotected

◆ intrinsicPermability()

template<class TypeTag >
const DimMatrix & Opm::DarcyExtensiveQuantities< TypeTag >::intrinsicPermability ( ) const
inlineinherited

Returns the intrinsic permeability tensor for a given sub-control volume face.

References Opm::DarcyExtensiveQuantities< TypeTag >::K_.

◆ isDiagonal_()

template<class TypeTag >
bool Opm::ForchheimerExtensiveQuantities< TypeTag >::isDiagonal_ ( const DimMatrix &  K) const
inlineprotected

Check whether all off-diagonal entries of a tensor are zero.

Parameters
Kthe tensor that is to be checked.
Returns
True iff all off-diagonals are zero.

Referenced by Opm::ForchheimerExtensiveQuantities< TypeTag >::calculateBoundaryGradients_(), Opm::ForchheimerExtensiveQuantities< TypeTag >::calculateGradients_(), and Opm::ForchheimerExtensiveQuantities< TypeTag >::forchheimerResid_().

◆ mobilityPassabilityRatio()

template<class TypeTag >
Evaluation & Opm::ForchheimerExtensiveQuantities< TypeTag >::mobilityPassabilityRatio ( unsigned  phaseIdx) const
inline

Return the ratio of the mobility divided by the passability at the face's integration point for a given fluid phase.

Usually, that's the inverse of the viscosity.

References Opm::ForchheimerExtensiveQuantities< TypeTag >::mobilityPassabilityRatio_.

Referenced by Opm::ForchheimerExtensiveQuantities< TypeTag >::forchheimerResid_().

◆ potentialGrad()

template<class TypeTag >
const EvalDimVector & Opm::DarcyExtensiveQuantities< TypeTag >::potentialGrad ( unsigned  phaseIdx) const
inlineinherited

Return the pressure potential gradient of a fluid phase at the face's integration point [Pa/m].

Parameters
phaseIdxThe index of the fluid phase

References Opm::DarcyExtensiveQuantities< TypeTag >::potentialGrad_.

◆ upstreamIndex_()

template<class TypeTag >
short Opm::DarcyExtensiveQuantities< TypeTag >::upstreamIndex_ ( unsigned  phaseIdx) const
inlineprotectedinherited

◆ volumeFlux()

template<class TypeTag >
const Evaluation & Opm::DarcyExtensiveQuantities< TypeTag >::volumeFlux ( unsigned  phaseIdx) const
inlineinherited

Return the volume flux of a fluid phase at the face's integration point $[m^3/s / m^2]$.

This is the fluid volume of a phase per second and per square meter of face area.

Parameters
phaseIdxThe index of the fluid phase

References Opm::DarcyExtensiveQuantities< TypeTag >::volumeFlux_.

Member Data Documentation

◆ density_

◆ downstreamDofIdx_

◆ ergunCoefficient_

◆ exteriorDofIdx_

◆ filterVelocity_

◆ interiorDofIdx_

◆ K_

◆ mobility_

◆ mobilityPassabilityRatio_

◆ potentialGrad_

◆ sqrtK_

◆ upstreamDofIdx_

◆ volumeFlux_


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