ChemicalFemPhysics
The GeMA Standard Chemical FEM Physics Plugin
Loading...
Searching...
No Matches
GmpChemicalInterface Class Reference

Basic class for the hydraulic interface element plugin object. More...

#include <gmpChemicalInterface.h>

Inheritance diagram for GmpChemicalInterface:
Collaboration diagram for GmpChemicalInterface:

Public Types

enum  InterfacePropertyIds { IOPEN_ID = GmpChemicalFemPhysics::NUM_PROPERTY_IDS , An_ID , NUM_PROPER_IDS }
 IDs for physics element properties. More...
 
enum  InterfaceGaussAttributeIds { An_GA_ID = GmpChemicalFemPhysics::NUM_GA_IDS , AnOLD_GA_ID , NUM_GA_IDS }
 
enum  BoundaryConditionIds { FIXED_C_BC_INT_ID = GmpChemicalFemPhysics::NUM_BC_IDS , FIXED_CF_BC_INT_ID }
 IDs for accepted boundary condition types. More...
 
enum  BoundaryConditionValueIds { BC_C_INT_ID = GmpChemicalFemPhysics::NUM_BCV_IDS , BC_Q_INT_ID , BC_C_POS_ID , BC_Q_POS_ID }
 IDs for property values from accepted boundary condition types. More...
 

Public Member Functions

 GmpChemicalInterface (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 
virtual ~GmpChemicalInterface ()
 Destructor.
 
virtual const QVariantMap * physicsMetaDataMap ()
 Returns a reference for the chemical interface attribute map, built when the function is called for the first time.
 
virtual const char * pluginType () const
 
virtual bool checkAndLoadAttributeAccessors (LuaTable &nodeTable, LuaTable &cellTable, LuaTable &gaussTable)
 Reimplementation of the common function to set initial gauss attributes.
 
virtual GmpFemPhysics::FemResultType fillElementData (const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
 Fills the element matrices and vectors for a generic Interface element.
 
virtual FemResultType fillElementDataForBc (const GmElement *e, const GmBoundaryCondition *bc, int bcIndex, int bcListIndex, int border, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
 Fills the element force vector elemF for element 'e', taking into account fixed flux boundary conditions.
 
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 concentrations

 
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 phi, double k, double c) const
 Calculates the compressibility matrix inside the fracture.
 
virtual void fillDiffusionMatrix (const GmElement *e, GmMatrix &Kc, const GmMatrix &Bp, const GmMatrix &D, const GmVector &v, const GmVector &N, double phi, double c, int ns)
 Calculates the flow stiffness matrix according to the cubic law.
 
virtual bool setInitialConditions () const
 sets the initial value of chemical gauss attributes.
 
virtual void fillElementConcentration (const GmElement *e, GmVector &pe)
 Given an element, fills the vector pe with nodal pore pressure.
 
virtual double initiallyOpenElem (const GmElement *e, const GmVector *coord, int ip) const
 Returns the initially open element

 
- Public Member Functions inherited from GmpChemicalFemPhysics
 GmpChemicalFemPhysics (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor. Will be called by the plugin loading code.
 
virtual ~GmpChemicalFemPhysics ()
 Destructor.
 
virtual const char * pluginName () const
 
virtual bool checkLoadedData ()
 Checks the existance of the velocity accessor, and also sizes for the dispersion and retardation coefficients, as well as sizes for the prescribed concentration and prescribed flux boundary conditions.
 
virtual bool fillFixedNodalDofsBCAlkalinity (QVector< int > &nodes, QVector< int > &dof, QVector< double > &values, bool *constantValues) const
 See comments on base class. Fills vectors with prescribed node concentrations.
 
virtual bool fillFixedNodalDofsBCbasalt (QVector< int > &nodes, QVector< int > &dof, QVector< double > &values, bool *constantValues) const
 

Protected Member Functions

virtual const GmElementDofdofMapping (GmCellType type) const
 
void fillMiddleCoordinates (const GmElement *e, const GmMatrix &Xnode, GmMatrix &MX) const
 Computes the coordinate at the middle plane of the interface element . Given an element 'e' and the nodal coordinates 'Xnode', fills and returns the matrix with coordinates at the middle plane 'MX'.
 
virtual bool reactionRate (const GmElement *e, const GmVector *ip, int ipIndex, const GmVector &N, const GmVector &C, double wtJ, GmVector &elemFe, GmMatrix &elemK, bool needsFe, bool needsK)
 Reaction rate term based on a fixed element property. See the parameters description on the base class.
 
- Protected Member Functions inherited from GmpChemicalFemPhysics

Additional Inherited Members

- Protected Types inherited from GmpChemicalFemPhysics
enum  PhysicsAttributeIds {
  ISOPARAMETRIC_ID , MULTI_DISPERSION_ID , MULTI_RETARDATION_ID , ALKALINITY_ID ,
  BASALTRXN_ID , NUM_ATTRIBUTE_IDS
}
 IDs for physics attributes. More...
 
enum  StateVarIds { C_ID }
 IDs fo physics state vars. More...
 
enum  NodeAttributeIds { NUM_NA_IDS }
 IDs for physics node attributes. More...
 
enum  GaussAttributeIds { V_GA_ID , NUM_GA_IDS }
 IDs for physics Gauss attributes. More...
 
enum  ElementPropertyIds {
  D_ID , K_ID , V_ID , PHI_ID ,
  THICKNESS_ID , NUM_PROPERTY_IDS
}
 IDs for physics element properties. More...
 
enum  BoundaryConditionIds {
  PRESCRIBED_C_BC_ID , PRESCRIBED_FLUX_BC_ID , PRESCRIBED_MIXED_BC_ID , PRESCRIBED_CN_BC_ID ,
  NUM_BC_IDS
}
 IDs for accepted boundary condition types. More...
 
enum  BoundaryConditionValueIds {
  BC_C_ID , BC_CN_ID , BC_Q_ID , BC_QDIR_ID ,
  BC_MX_ID , NUM_BCV_IDS
}
 IDs for property values from accepted boundary condition types. More...
 
- Protected Attributes inherited from GmpChemicalFemPhysics
GmVector _data
 Save alkalinity data for boundary condition.
 
GmVector _Cglobal
 

Detailed Description

Basic class for the hydraulic interface element plugin object.

This physics plugin calculates concentrations in the fracture

Member Enumeration Documentation

◆ BoundaryConditionIds

IDs for accepted boundary condition types.

Enumerator
FIXED_C_BC_INT_ID 

Id for prescribed concentration boundary condition on cell.

FIXED_CF_BC_INT_ID 

Id for prescribed flux boundary condition on cell.

◆ BoundaryConditionValueIds

IDs for property values from accepted boundary condition types.

Enumerator
BC_C_INT_ID 

Nodal concentration for fixed concentration boundary condition on cell.

BC_Q_INT_ID 

Concentration flux for fixed concentration flux boundary condition on cell.

BC_C_POS_ID 

BC Id for edge/face on cell where is fixed the concentration.

BC_Q_POS_ID 

BC Id for edge/face on cell where is fixed the flux.

◆ InterfaceGaussAttributeIds

Enumerator
An_GA_ID 

Base Id for Gauss attribute(s) used to store the normal aperture.

NUM_GA_IDS 

The number of property ids above.

◆ InterfacePropertyIds

IDs for physics element properties.

Enumerator
IOPEN_ID 

Id for retrieving the initially open element accessor.

NUM_PROPER_IDS 

The number of property ids above.

Member Function Documentation

◆ calcDerivedResults()

bool GmpChemicalInterface::calcDerivedResults ( bool nonLinearSolver)
virtual

Calc velocity and flow on nodes and/or Gauss points.

Reimplemented from GmpChemicalFemPhysics.

◆ fillDiffusionMatrix()

void GmpChemicalInterface::fillDiffusionMatrix ( const GmElement * e,
GmMatrix & Kc,
const GmMatrix & Bp,
const GmMatrix & D,
const GmVector & v,
const GmVector & Np,
double phi,
double c,
int ns )
virtual

Calculates the flow stiffness matrix according to the cubic law.

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 = w * h * detJ. This function can operate either in an iso parametric setting (Kc = n x n) or in a super parametric setting (Kc = nf x nf) where n is the number of element nodes and nf the number of element corner nodes.

Returns Kc = c * B.t() * {phi * D * B - v.v() * N.t()};

◆ fillElementConcentration()

void GmpChemicalInterface::fillElementConcentration ( const GmElement * e,
GmVector & pe )
virtual

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

Given an element, fills the vector pe with nodal concentration. The vector should have size equal to the number of calculated nodes.

◆ fillElementData()

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

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

Reimplemented from GmpChemicalFemPhysics.

◆ fillElementDataForBc()

GmpFemPhysics::FemResultType GmpChemicalInterface::fillElementDataForBc ( const GmElement * e,
const GmBoundaryCondition * bc,
int bcIndex,
int bcListIndex,
int border,
GmpFemMatrixSet & elemMatrices,
GmpFemVectorSet & elemVectors )
virtual

Fills the element force vector elemF for element 'e', taking into account fixed flux boundary conditions.

Reference: "Fundamentals of the Finite Element Method for Heat and Fluid Flow", Lewis et al, section 3.4.1, equations 3.260 and 3.261

Definition of q flux concentration vector

Its different of v fluid vector.

Boundary Conditions Treatment for Adv-Diff Problem

  1. Prescribed of concentration variable, c.
  1. Prescribed of flux of concentration variable, q = -D grad(c) = qb
  1. Third kind boundary condition (Robin/Cauchy), alpha * v * c + beta x q = gamma

Reimplemented from GmpChemicalFemPhysics.

◆ fillMiddleCoordinates()

void GmpChemicalInterface::fillMiddleCoordinates ( const GmElement * e,
const GmMatrix & Xnode,
GmMatrix & MX ) const
protected

Computes the coordinate at the middle plane of the interface element . Given an element 'e' and the nodal coordinates 'Xnode', fills and returns the matrix with coordinates at the middle plane 'MX'.

See comments on base class. Fills matrix with middle coordinates.

◆ fillStorageCompMatrix()

void GmpChemicalInterface::fillStorageCompMatrix ( const GmElement * e,
const GmVector * coord,
int ip,
GmMatrix & Sc,
const GmVector & Np,
double phi,
double k,
double c ) const
virtual

Calculates the compressibility matrix inside the fracture.

Calculates the Coupling matrix of "storage / compressibility" for element 'e' at the given integration point (coord, ip) storing the result at the Sc matrix.
N is the shape function vector and c = w * h * detJ.

This function can operate either in an iso parametric setting (Sc = n x n) or in a super parametric setting (Sc = nf x nf) where n is the number of element corner nodes at middle point.

Returns Sc = N * phi*k * N.t() * w * h * detJ;

◆ fixedNodalDofsBc()

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

See comments on base class. Fills vectors with prescribed node concentrations

Reimplemented from GmpChemicalFemPhysics.

◆ physicsMetaDataMap()

const QVariantMap * GmpChemicalInterface::physicsMetaDataMap ( )
virtual

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

Reimplemented from GmpChemicalFemPhysics.

◆ reactionRate()

bool GmpChemicalInterface::reactionRate ( const GmElement * e,
const GmVector * ip,
int ipIndex,
const GmVector & N,
const GmVector & C,
double wtJ,
GmVector & elemFe,
GmMatrix & elemK,
bool needsFe,
bool needsK )
protectedvirtual

Reaction rate term based on a fixed element property. See the parameters description on the base class.

Implements GmpChemicalFemPhysics.

◆ setInitialConditions()

bool GmpChemicalInterface::setInitialConditions ( ) const
virtual

sets the initial value of chemical gauss attributes.

Sets the initial conditions required by interface elements. An = fracture aperture Returns true.


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