HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
GmpHydraulicInterfaceTwoPhaseFlow Class Reference

Basic class for the hydraulic interface two phase flow element plugin object. More...

#include <gmpHydraulicInterfaceTwoPhaseFlow.h>

Inheritance diagram for GmpHydraulicInterfaceTwoPhaseFlow:
Collaboration diagram for GmpHydraulicInterfaceTwoPhaseFlow:

Public Member Functions

 GmpHydraulicInterfaceTwoPhaseFlow (const char *pluginType, GmSimulationData *simulation, QString id, QString description, const GmpFemPhysicsCommonMaterialFactory *matFactory, const GmLogCategory &logger)
 
virtual ~GmpHydraulicInterfaceTwoPhaseFlow ()
 Destructor.
 
virtual const QVariantMap * physicsMetaDataMap ()
 Returns a reference for the hydraulic interface attribute map, built when the function is called for the first time.
 
virtual bool checkAndLoadAttributeAccessors (LuaTable &nodeTable, LuaTable &cellTable, LuaTable &gaussTable)
 Reimplementation of the common function to init the _hmaterialPointAccessor structure.
 
virtual bool beforeElementStiffnessLoop (const GmpFemMatrixSet &elemMatrices, const GmpFemVectorSet &elemVectors)
 
virtual bool fixedNodalForcesBc (QVector< int > &nodes, QVector< int > &dof, QVector< double > &values) const
 See comments on base class. Fills vectors with prescribed nodal forces - flow.
 
virtual bool fixedNodalDofsBc (QVector< int > &nodes, QVector< int > &dof, QVector< double > &values, bool *constantValues) const
 See comments on base class. Fills vectors with prescribed node pore pressures.
 
virtual GmpFemPhysics::FemResultType fillElementData (const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
 Fills the element matrices and vectors for a generic H2 Interface element.
 
virtual bool addStateItemsToGroup (GmStateDump *state, bool fixedHint, int groupId)
 
virtual bool computeInitialNodalAttributes ()
 Initialize the initial values of nodal attributes. Since the fluid densities do not depend on the parameters of the cell, we can compute they only once at each node.
 
virtual bool computeNodalAttributes ()
 Compute the nodal attributes: fluid densities. Since the fluid densities do not depend on the parameters of the cell, we can compute they only once at each node.
 
virtual void FillDofIndexPosition (const GmElement *e, QVector< int > &iPe, QVector< int > &iPfe) const
 Fills the position index of the two hydraulic degrees of freedom.
 
virtual bool setInitialConditions () const
 sets the initial value of hydraulic gauss attributes.
 
virtual void fillElementOldLiqPorePressure (const GmElement *e, GmVector &plOld) const
 Given an element, fills the vector plOld with old nodal liquid pore pressure. The vector should have size equal to the number of calculated nodes.
 
virtual void fillElementGasPorePressure (const GmElement *e, GmVector &pg) const
 Given an element, fills the vector pg with nodal gas pore pressure.
 
virtual void fillElementOldGasPorePressure (const GmElement *e, GmVector &pgOld) const
 Given an element, fills the vector pgOld with the old nodal gas pore pressure. The vector should have size equal to the number of calculated nodes.
 
virtual void fillDofMappingMatrices (const GmElement *e, GmMatrix &Hb, GmMatrix &Ht, GmMatrix &Hm) const
 Fills the matrices that maps the dofs associated with each plane of the element.
 
virtual bool evaluateNodalVariables (const GmElement *e, GmMatrix &midSurfMap, tp::saturationTerms &Sat, tp::densityTerms &Den, tp::viscosityTerms &Mu, tp::massTerms &Ms, tp::pressureTerms &Pres)
 Evaluates nodal variables.
 
virtual bool transversalAdvectiveFluxMatrix (const GmElement *e, GmMatrix &Ht, GmVector &Np, GmMatrix &botSurfMap, GmMatrix &topSurfMap, GmMatrix &midSurfMap, const int nDof, double c) const
 Compute the transversal flux permeability matrix.
 
virtual bool addMassStorage (GmVector &fil, GmVector &fig, tp::jacobianTerms &J, GmMatrix &midSurfMap, GmVector &iNp, tp::massTerms &mass, double dt)
 Add the contribution of the mass storage terms to the linear system.
 
virtual bool addAdvectiveFlux (GmVector &fil, GmVector &fig, tp::jacobianTerms &J, GmMatrix &H, GmVector &fgravp, tp::densityTerms &den, tp::viscosityTerms &mu, tp::permeabilityTerms &kr, tp::pressureTerms &pres, bool needsGrav)
 Add the contribution of the advective flux terms to the linear system.
 
virtual bool assembleElementData (const GmElement *e, GmMatrix &J, GmVector &r, GmVector &Fil, GmVector &Fig, tp::jacobianTerms &K, QVector< int > &iPl, QVector< int > &iPg)
 Assembly the element left hand side matrix and right hand side vector: J * dx = -r.
 
- Public Member Functions inherited from GmpHydraulicInterface
 GmpHydraulicInterface (const char *pluginType, GmSimulationData *simulation, QString id, QString description, const GmpFemPhysicsCommonMaterialFactory *matFactory, const GmLogCategory &logger)
 
virtual ~GmpHydraulicInterface ()
 Destructor.
 
virtual bool calcDerivedResults (bool nonLinearSolver)
 Calc velocity and flow on nodes and/or Gauss points.
 
virtual void fillStorageCompMatrix (const GmElement *e, const GmVector *coord, int ip, GmMatrix &Sc, const GmVector &N, double c)
 Calculates the compressibility matrix inside the fracture.
 
virtual void fillFlowMatrix (const GmElement *e, GmMatrix &Kc, const GmMatrix &Bp, const GmVector &flowParam, const GmVector &N, double c) const
 Calculates the flow stiffness matrix according to the cubic law.
 
virtual void fillElementPorePressure (const GmElement *e, GmVector &pe)
 Given an element, fills the vector pe with nodal pore pressure.
 
- Public Member Functions inherited from GmpHydraulic
 GmpHydraulic (const char *pluginType, GmSimulationData *simulation, QString id, QString description, const GmpFemPhysicsCommonMaterialFactory *matFactory, const GmLogCategory &logger)
 Constructor. Will be called by the plugin loading code.
 
virtual ~GmpHydraulic ()
 Destructor.
 
virtual const char * pluginName () const
 
virtual const char * pluginType () const
 
virtual bool supportsStateDumping ()
 
virtual FemResultType fillElementDataForBc (const GmElement *e, const GmBoundaryCondition *bc, int bcIndex, int bcListIndex, int border, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
 
virtual FemResultType fillElementDataBc (const GmElement *e, const GmBoundaryCondition *bc, int bcIndex, int bcListIndex, int border, GmMatrix &elemMat, GmVector &elemVec)
 
virtual void fillFlowMatrix (const GmElement *e, const GmVector *coord, int ip, GmMatrix &Kc, const GmMatrix &Bp, double c) const
 Calculates the flow stiffness matrix due to permeability contribution or permeability matrix for element 'e' at the given integration point (coord, ip) storing the result at the Kc matrix. Bp is the strain pore pressure matrix and c a constant equal to w * h * detJ.
 
virtual void fillFluidVelocity (const GmElement *e, const GmVector *coord, int ip, GmVector &Vip, const GmVector &Pe, const GmMatrix &Bp) const
 Evaluates velocity at integration points (it should be improved to consider gravity effect)
 
virtual void gravitySupplyFluid (const GmElement *e, const GmVector *coord, int ip, GmVector &qext_gsf, GmMatrix &Bp, double c)
 
virtual void fillSourceTermVector (const GmElement *e, const GmVector *coord, int ip, GmVector &St, const GmVector &N, double c)
 Calculates the source term due the porosity rate of porous eskeleton for element 'e' at the given integration point (coord, ip) storing the result at external vector. N is the shape function vector and c a constant equal to w * h * detJ.
 
virtual double fillBpMatrix (const GmShape *shape, const GmVector &ncoord, const GmMatrix &X, const GmVector &N, const GmMatrix &J, GmMatrix &Bp)=0
 Given a point 'ncoord', the element coordinate matrix 'X', the point shape functions 'N' and the transformation Jacobian 'J', fills the matrix with cartesian partial derivatives Bp using the provided shape function and returns the scaled jacobian determinant.
 
virtual void gravityVector (const GmElement *e, const GmVector *coord, int ip, GmVector &grav) const
 Returns the gravity accelaration vector.
 
virtual bool isAxisymmetric ()
 Returns TRUE only for axisymmetric models.
 
virtual double axisymmetricFactor (const GmElement *e, const GmMatrix &X, const GmVector &N) const
 Returns the factor that should be applied when using axis symetric elements. 1.0 for other etypes.
 
HMaterialPointAccessorshydraulicMaterialPoint ()
 Returns the hydraulic material point accessor.
 

Protected Types

enum  TwoPhaseStateVarIds { PG_ID = GmpHydraulic::NUM_STATEVAR_IDS , NUM_STATEVAR_IDS }
 IDs fo physics state vars. More...
 
enum  TwoPhasePhysicsAttributeIds { COMPUTENODALATTRS_ID = GmpHydraulicInterface::NUM_ATTRI_IDS , NUM_ATTRI_IDS }
 IDs for physics attributes. More...
 
enum  TwoPhaseNodeAttributeIds {
  Pl_NA_ID = GmpHydraulic::NUM_NA_IDS , PlOLD_NA_ID , Pg_NA_ID , PgOLD_NA_ID ,
  RHOl_NA_ID , RHOlOLD_NA_ID , RHOg_NA_ID , RHOgOLD_NA_ID ,
  PlRef_NA_ID , PgRef_NA_ID , NUM_NA_IDS
}
 
enum  TwoPhaseCellAttributeIds { Sl_CA_ID = GmpHydraulic::NUM_CA_IDS , POR_CA_ID , POROLD_CA_ID , NUM_CA_IDS }
 IDs for physics cell attributes. More...
 
enum  TwoPhaseBoundaryConditionIds { FIXED_PG_BC_ID = GmpHydraulic::NUM_BC_IDS , FIXED_QG_BC_ID , NUM_BC_IDS }
 IDs for accepted boundary condition types. More...
 
enum  TwoPhaseBoundaryConditionValueIds { BC_PG_ID = GmpHydraulic::NUM_BCV_IDS , BC_QG_ID , NUM_BCV_IDS }
 IDs for property values from accepted boundary condition types. More...
 

Protected Member Functions

virtual const GmElementDofdofMapping (GmCellType type) const
 Returns the hydraulic conductivity parameters: [kl, Lkt, Lkb].
 
- Protected Member Functions inherited from GmpHydraulicInterface
- Protected Member Functions inherited from GmpHydraulic
virtual void calcElementDerivedResultAtPoints (const GmElement *e, int resultId, const GmMatrix &evalPoints, bool evalAtIp, GmMatrix &result)
 The virtual function used by calcDerivedResults() to effectivelly calculate the velocity (resultId = 0) or the flow (resultId = 1) at the given evaluation points.
 
void calcElementVelocityAtPoints (const GmElement *e, const GmMatrix &evalPoints, GmMatrix &v)
 The function responsible for effectivelly calculating the velocity at the given evaluation points, filling v.
 
void calcElementFlowAtPoints (const GmElement *e, const GmMatrix &evalPoints, bool evalAtIp, GmMatrix &q)
 The function responsible for effectivelly calculating the flow at the given evaluation points, filling q.
 

Additional Inherited Members

- Public Types inherited from GmpHydraulic
enum  HMaterialPointStates { saturated , unsaturated }
 
enum  PhysicsAttributeIds {
  ISOPARAMETRIC_ID , POROSITY_UPDATE_ID , PERMEABILITY_UPDATE_ID , USE_CONSISTENT_MATRIX_ID ,
  VELOCITY_MODE_ID , FLOW_MODE_ID , DIRECT_ID , CGRAV_ID ,
  VF_MODE_ID , NUM_ATTRI_IDS
}
 IDs for physics attributes. More...
 
enum  StateVarIds { P_ID , NUM_STATEVAR_IDS }
 IDs fo physics state vars. More...
 
enum  NodeAttributeIds { V_NA_ID , Q_NA_ID , VF_NA_ID , NUM_NA_IDS }
 IDs for physics node attributes. More...
 
enum  cellAttributeIds { NUM_CA_IDS }
 IDs for physics Cell attributes. More...
 
enum  GaussAttributeIds {
  V_GA_ID , Q_GA_ID , FT_GA_ID , FTOLD_GA_ID ,
  NUM_GA_IDS
}
 IDs for physics Gauss attributes. More...
 
enum  ElementPropertyIds { THICKNESS_ID , GRAV_ID , SOURTERM_ID , NUM_PROPER_IDS }
 IDs for physics element properties. More...
 
enum  BoundaryConditionIds { FIXED_P_BC_ID , FIXED_Q_BC_ID , FIXED_SPF_BC_ID , NUM_BC_IDS }
 IDs for accepted boundary condition types. More...
 
enum  BoundaryConditionValueIds { BC_P_ID , BC_QW_ID , BC_IF_ID , NUM_BCV_IDS }
 IDs for property values from accepted boundary condition types. More...
 
- Protected Attributes inherited from GmpHydraulic
HMaterialPointAccessors _hmaterialPointAccessor
 Access to hydraulic material point.
 
bool _setInitialCond
 Sets the initial conditions required by the physics.
 

Detailed Description

Basic class for the hydraulic interface two phase flow element plugin object.

This physics plugin calculates pore pressure for two fluids in the fracture

Member Enumeration Documentation

◆ TwoPhaseBoundaryConditionIds

IDs for accepted boundary condition types.

Enumerator
FIXED_PG_BC_ID 

Id for fixed node gas pore pressure boundary condition.

FIXED_QG_BC_ID 

Id for fixed node gas flow boundary condition.

NUM_BC_IDS 

The number of boundary conditions ids above.

◆ TwoPhaseBoundaryConditionValueIds

IDs for property values from accepted boundary condition types.

Enumerator
BC_PG_ID 

Nodal pore pressure for fixed gas node pore pressure boundary condition.

BC_QG_ID 

Nodal pore flow for fixed node gas pore flow boundary condition.

NUM_BCV_IDS 

The number of boundary conditions value ids above.

◆ TwoPhaseCellAttributeIds

IDs for physics cell attributes.

Enumerator
Sl_CA_ID 

Base Id for node attribute(s) used to store the calculated water saturation.

POR_CA_ID 

Base Id for cell attributes used to store porosity.

POROLD_CA_ID 

Base Id for cell attributes used to store old porosity.

NUM_CA_IDS 

The number of node attribute ids above.

◆ TwoPhaseNodeAttributeIds

Enumerator
Pl_NA_ID 

Base Id for node attributes used to store liquid pore pressure.

PlOLD_NA_ID 

Id for retrieving the previous liquid pore pressure.

Pg_NA_ID 

Base Id for node attributes used to store gas phase density.

PgOLD_NA_ID 

Id for retrieving the previous gas pore pressure.

RHOl_NA_ID 

Base Id for node attributes used to store liquid phase density.

RHOlOLD_NA_ID 

Base Id for node attributes used to store old liquid phase density.

RHOg_NA_ID 

Base Id for node attributes used to store gas phase density.

RHOgOLD_NA_ID 

Base Id for node attributes used to store old gas phase density.

PlRef_NA_ID 

Base Id for node attributes used to store reference liquid pressure.

PgRef_NA_ID 

Base Id for node attributes used to store reference gas pressure.

NUM_NA_IDS 

The number of state var ids above.

◆ TwoPhasePhysicsAttributeIds

IDs for physics attributes.

Enumerator
COMPUTENODALATTRS_ID 

Id for retrieving the isoParametric physics attribute.

NUM_ATTRI_IDS 

The number of physics attribute ids above.

◆ TwoPhaseStateVarIds

IDs fo physics state vars.

Enumerator
PG_ID 

Id for retrieving the accessor to the gas pore pressure state var.

NUM_STATEVAR_IDS 

The number of property ids above.

Member Function Documentation

◆ addStateItemsToGroup()

bool GmpHydraulicInterfaceTwoPhaseFlow::addStateItemsToGroup ( GmStateDump * state,
bool fixedHint,
int groupId )
virtual

Reimplemented from GmpHydraulicInterface.

◆ assembleElementData()

bool GmpHydraulicInterfaceTwoPhaseFlow::assembleElementData ( const GmElement * e,
GmMatrix & J,
GmVector & r,
GmVector & rl,
GmVector & rg,
tp::jacobianTerms & K,
QVector< int > & iPl,
QVector< int > & iPg )
virtual

Assembly the element left hand side matrix and right hand side vector: J * dx = -r.

  • The right hand side vector, r, is assembled as minus the residual vector
    • The left hand side matrix, J, is assembled as the jacobian matrix

◆ beforeElementStiffnessLoop()

bool GmpHydraulicInterfaceTwoPhaseFlow::beforeElementStiffnessLoop ( const GmpFemMatrixSet & elemMatrices,
const GmpFemVectorSet & elemVectors )
virtual

Reimplemented from GmpHydraulicInterface.

◆ checkAndLoadAttributeAccessors()

bool GmpHydraulicInterfaceTwoPhaseFlow::checkAndLoadAttributeAccessors ( LuaTable & nodeTable,
LuaTable & cellTable,
LuaTable & gaussTable )
virtual

Reimplementation of the common function to init the _hmaterialPointAccessor structure.

Reimplemented from GmpHydraulicInterface.

◆ dofMapping()

const GmElementDof * GmpHydraulicInterfaceTwoPhaseFlow::dofMapping ( GmCellType type) const
protectedvirtual

Returns the hydraulic conductivity parameters: [kl, Lkt, Lkb].

Reimplemented from GmpHydraulicInterface.

◆ FillDofIndexPosition()

void GmpHydraulicInterfaceTwoPhaseFlow::FillDofIndexPosition ( const GmElement * e,
QVector< int > & iPe,
QVector< int > & iPfe ) const
virtual

Fills the position index of the two hydraulic degrees of freedom.

Fills the position index of the two hydraulic degrees of freedom. the implementation supports order of the defined state variables i.e {Pl, Pg} or {Pg, Pl}.

◆ fillDofMappingMatrices()

void GmpHydraulicInterfaceTwoPhaseFlow::fillDofMappingMatrices ( const GmElement * e,
GmMatrix & Hb,
GmMatrix & Ht,
GmMatrix & Hm ) const
virtual

Fills the matrices that maps the dofs associated with each plane of the element.

  • Hb that maps the bottom plane pressures nodes (pb = Hb * p);
  • Ht that maps the top plane pressures nodes (pt = Ht * p);
  • Hm that maps the middle plane pressures nodes (pm = Hm * p).

◆ fillElementData()

GmpFemPhysics::FemResultType GmpHydraulicInterfaceTwoPhaseFlow::fillElementData ( const GmElement * e,
GmpFemMatrixSet & elemMatrices,
GmpFemVectorSet & elemVectors )
virtual

Fills the element matrices and vectors for a generic H2 Interface element.

Reimplemented from GmpHydraulicInterface.

◆ fillElementGasPorePressure()

void GmpHydraulicInterfaceTwoPhaseFlow::fillElementGasPorePressure ( const GmElement * e,
GmVector & pg ) const
virtual

Given an element, fills the vector pg with nodal gas pore pressure.

Given an element, fills the vector pg with nodal gas pore pressure. The vector should have size equal to the number of calculated nodes.

◆ fixedNodalDofsBc()

bool GmpHydraulicInterfaceTwoPhaseFlow::fixedNodalDofsBc ( QVector< int > & nodes,
QVector< int > & dof,
QVector< double > & values,
bool * constantValues ) const
virtual

See comments on base class. Fills vectors with prescribed node pore pressures.

Reimplemented from GmpHydraulic.

◆ fixedNodalForcesBc()

bool GmpHydraulicInterfaceTwoPhaseFlow::fixedNodalForcesBc ( QVector< int > & nodes,
QVector< int > & dof,
QVector< double > & values ) const
virtual

See comments on base class. Fills vectors with prescribed nodal forces - flow.

Reimplemented from GmpHydraulic.

◆ physicsMetaDataMap()

const QVariantMap * GmpHydraulicInterfaceTwoPhaseFlow::physicsMetaDataMap ( )
virtual

Returns a reference for the hydraulic interface attribute map, built when the function is called for the first time.

Reimplemented from GmpHydraulicInterface.

◆ setInitialConditions()

bool GmpHydraulicInterfaceTwoPhaseFlow::setInitialConditions ( ) const
virtual

sets the initial value of hydraulic gauss attributes.

Sets the initial conditions required by interface elements.

Reimplemented from GmpHydraulicInterface.


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