HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpHydraulicInterfaceTwoPhaseFlow.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_PLUGIN_HYDRAULIC_INTERFACE_TWOPHASEFLOW_H_
25#define _GEMA_PLUGIN_HYDRAULIC_INTERFACE_TWOPHASEFLOW_H_
26
29
30#include <gmpFemPhysicsCommon.h>
31#include <gmTrace.h>
32
33class GmGaussAccessor;
34
35namespace tp = GmpHydraulicTwoPhaseUtils;
36
40{
41public:
42 // constructor
43 GmpHydraulicInterfaceTwoPhaseFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
44 const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
45
46 // destructor
48
49 // set physic map
50 virtual const QVariantMap* physicsMetaDataMap();
51 // Comments on the base class
52 virtual bool checkAndLoadAttributeAccessors(LuaTable& nodeTable, LuaTable& cellTable, LuaTable& gaussTable);
53 virtual bool beforeElementStiffnessLoop(const GmpFemMatrixSet& elemMatrices, const GmpFemVectorSet& elemVectors);
54
55 virtual bool fixedNodalForcesBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values) const;
56 virtual bool fixedNodalDofsBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values, bool* constantValues) const;
57 virtual GmpFemPhysics::FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
58
59 // See comments on the base class
60 virtual bool addStateItemsToGroup(GmStateDump* state, bool fixedHint, int groupId);
61
62 virtual bool computeInitialNodalAttributes();
63 virtual bool computeNodalAttributes();
64
67 virtual void FillDofIndexPosition(const GmElement* e, QVector<int>& iPe, QVector<int>& iPfe) const;
68
71 virtual bool setInitialConditions() const;
72
76 virtual void fillElementOldLiqPorePressure(const GmElement* e, GmVector& plOld) const;
77
80 virtual void fillElementGasPorePressure(const GmElement* e, GmVector& pg) const;
81
82 virtual void fillElementOldGasPorePressure(const GmElement* e, GmVector& pgOld) const;
83
84 virtual void fillDofMappingMatrices(const GmElement* e, GmMatrix& Hb, GmMatrix& Ht, GmMatrix& Hm) const;
85
86 virtual bool evaluateNodalVariables(const GmElement* e, GmMatrix& midSurfMap, tp::saturationTerms& Sat,
88
89 virtual bool transversalAdvectiveFluxMatrix(const GmElement* e, GmMatrix& Ht, GmVector& Np,
90 GmMatrix& botSurfMap, GmMatrix& topSurfMap, GmMatrix& midSurfMap, const int nDof, double c) const;
91
92 virtual bool addMassStorage(GmVector& fil, GmVector& fig, tp::jacobianTerms& J, GmMatrix& midSurfMap,
93 GmVector& iNp, tp::massTerms& mass, double dt);
94
95 virtual bool addAdvectiveFlux(GmVector& fil, GmVector& fig, tp::jacobianTerms& J, GmMatrix& H, GmVector& fgravp,
97
98 virtual bool assembleElementData(const GmElement* e, GmMatrix& J, GmVector& r, GmVector& Fil, GmVector& Fig,
100
101protected:
102
103 virtual const GmElementDof* dofMapping(GmCellType type) const;
104
107 {
109
110 // --- NO ADDING BELOW THIS LINE
112 };
113
116 {
118
119
120 // ------ NO ADDING BELOW THIS LINE
122 };
123
141
144 {
148
149 // ------ NO ADDING BELOW THIS LINE
151 };
152
162
165 {
168
169 // --- NO ADDING BELOW THIS LINE
171 };
172
173 //public:
174
175};
176
177#endif
@ NUM_NA_IDS
The number of node attribute ids above.
Definition gmpHydraulic.h:158
@ NUM_ATTRI_IDS
The number of physics attribute ids above.
Definition gmpHydraulic.h:138
@ NUM_BC_IDS
The number of boundary conditions ids above.
Definition gmpHydraulic.h:200
@ NUM_STATEVAR_IDS
The number of property ids above.
Definition gmpHydraulic.h:147
@ NUM_CA_IDS
The number of cell attribute ids above.
Definition gmpHydraulic.h:166
@ NUM_BCV_IDS
The number of boundary conditions value ids above.
Definition gmpHydraulic.h:211
Basic class for the hydraulic interface element plugin object.
Definition gmpHydraulicInterface.h:38
Basic class for the hydraulic interface two phase flow element plugin object.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:40
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.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:721
virtual void FillDofIndexPosition(const GmElement *e, QVector< int > &iPe, QVector< int > &iPfe) const
Fills the position index of the two hydraulic degrees of freedom.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:1030
virtual void fillElementGasPorePressure(const GmElement *e, GmVector &pg) const
Given an element, fills the vector pg with nodal gas pore pressure.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:1012
TwoPhaseNodeAttributeIds
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:126
@ Pg_NA_ID
Base Id for node attributes used to store gas phase density.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:129
@ PgOLD_NA_ID
Id for retrieving the previous gas pore pressure.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:130
@ PlOLD_NA_ID
Id for retrieving the previous liquid pore pressure.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:128
@ RHOgOLD_NA_ID
Base Id for node attributes used to store old gas phase density.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:134
@ RHOl_NA_ID
Base Id for node attributes used to store liquid phase density.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:131
@ PgRef_NA_ID
Base Id for node attributes used to store reference gas pressure.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:136
@ NUM_NA_IDS
The number of state var ids above.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:139
@ PlRef_NA_ID
Base Id for node attributes used to store reference liquid pressure.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:135
@ RHOlOLD_NA_ID
Base Id for node attributes used to store old liquid phase density.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:132
@ Pl_NA_ID
Base Id for node attributes used to store liquid pore pressure.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:127
@ RHOg_NA_ID
Base Id for node attributes used to store gas phase density.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:133
TwoPhaseBoundaryConditionValueIds
IDs for property values from accepted boundary condition types.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:165
@ BC_PG_ID
Nodal pore pressure for fixed gas node pore pressure boundary condition.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:166
@ NUM_BCV_IDS
The number of boundary conditions value ids above.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:170
@ BC_QG_ID
Nodal pore flow for fixed node gas pore flow boundary condition.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:167
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.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:946
virtual bool computeInitialNodalAttributes()
Initialize the initial values of nodal attributes. Since the fluid densities do not depend on the par...
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:248
virtual GmpFemPhysics::FemResultType fillElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for a generic H2 Interface element.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:464
TwoPhaseStateVarIds
IDs fo physics state vars.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:107
@ PG_ID
Id for retrieving the accessor to the gas pore pressure state var.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:108
@ NUM_STATEVAR_IDS
The number of property ids above.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:111
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.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:739
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the hydraulic interface attribute map, built when the function is called for ...
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:56
virtual const GmElementDof * dofMapping(GmCellType type) const
Returns the hydraulic conductivity parameters: [kl, Lkt, Lkb].
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:378
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.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:781
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 ...
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:1003
TwoPhaseBoundaryConditionIds
IDs for accepted boundary condition types.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:155
@ FIXED_QG_BC_ID
Id for fixed node gas flow boundary condition.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:157
@ FIXED_PG_BC_ID
Id for fixed node gas pore pressure boundary condition.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:156
@ NUM_BC_IDS
The number of boundary conditions ids above.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:160
virtual bool setInitialConditions() const
sets the initial value of hydraulic gauss attributes.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:203
TwoPhaseCellAttributeIds
IDs for physics cell attributes.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:144
@ Sl_CA_ID
Base Id for node attribute(s) used to store the calculated water saturation.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:145
@ NUM_CA_IDS
The number of node attribute ids above.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:150
@ POROLD_CA_ID
Base Id for cell attributes used to store old porosity.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:147
@ POR_CA_ID
Base Id for cell attributes used to store porosity.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:146
virtual bool checkAndLoadAttributeAccessors(LuaTable &nodeTable, LuaTable &cellTable, LuaTable &gaussTable)
Reimplementation of the common function to init the _hmaterialPointAccessor structure.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:119
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.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:443
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.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:431
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.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:974
TwoPhasePhysicsAttributeIds
IDs for physics attributes.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:116
@ COMPUTENODALATTRS_ID
Id for retrieving the isoParametric physics attribute.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:117
@ NUM_ATTRI_IDS
The number of physics attribute ids above.
Definition gmpHydraulicInterfaceTwoPhaseFlow.h:121
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.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:1072
virtual ~GmpHydraulicInterfaceTwoPhaseFlow()
Destructor.
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:50
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...
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:1021
virtual bool computeNodalAttributes()
Compute the nodal attributes: fluid densities. Since the fluid densities do not depend on the paramet...
Definition gmpHydraulicInterfaceTwoPhaseFlow.cpp:315
GmCellType
arma::mat GmMatrix
arma::vec GmVector
Declaration of the GmpHydraulicInterface classes.
Declaration of the GmpHydraulicTwoPhaseUtils class.
Definition gmpHydraulicTwoPhaseUtils.h:55
Definition gmpHydraulicTwoPhaseUtils.h:149
Definition gmpHydraulicTwoPhaseUtils.h:83
Definition gmpHydraulicTwoPhaseUtils.h:119
Definition gmpHydraulicTwoPhaseUtils.h:100
Definition gmpHydraulicTwoPhaseUtils.h:37
Definition gmpHydraulicTwoPhaseUtils.h:71