HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpHydraulicTwoPhaseFlow.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_TWOPHASEFLOW_H_
25#define _GEMA_PLUGIN_HYDRAULIC_TWOPHASEFLOW_H_
26
28#include "gmpHydraulic.h"
29
30#include <gmpFemPhysicsCommon.h>
31#include <gmMathUtils.h>
32#include <gmTrace.h>
33
34class GmGaussAccessor;
35
36namespace tp = GmpHydraulicTwoPhaseUtils;
37
40class GMP_HYDRAULIC_PHYSICS_API_EXPORT GmpHydraulicTwoPhaseFlow : public GmpHydraulic
41{
42public:
43 // constructor
44 GmpHydraulicTwoPhaseFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
45 const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
46 // destructor
48
49 // set physic map
50 virtual const QVariantMap* physicsMetaDataMap();
51
52 // Comments on the base class
53 bool checkAndLoadAttributeAccessors(LuaTable& nodeTable, LuaTable& cellTable, LuaTable& gaussTable);
54 virtual bool beforeElementStiffnessLoop(const GmpFemMatrixSet& elemMatrices, const GmpFemVectorSet& elemVectors);
55
56 virtual GmpFemPhysics::FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
57
58 virtual bool fixedNodalForcesBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values) const;
59
60 virtual bool fixedNodalDofsBc (QVector<int>& nodes, QVector<int>&dof, QVector<double>& values, bool* constantValues) const;
61
62 virtual bool setInitialConditions();
63 virtual bool setInitialPorosity() const;
64 virtual bool computeInitialNodalAttributes();
65 virtual bool computeNodalAttributes();
66 virtual void gravityVector(const GmElement* e, const GmVector* coord, int ip, GmVector& grav) const;
67
68 // See comments on the base class
69 virtual bool calcDerivedResults(bool nonLinearSolver);
70 // Evaluates the hydraulic permeability matrix for each ip
71 virtual void evaluatePermeabilityMatrix(const GmElement* e, GmMatrix& Kh, GmMatrix& H, GmMatrix& Bp,
72 const GmVector* coord, int ip, double c) const;
73
74 virtual void fillElementGasPorePressure(const GmElement* e, GmVector& Pce) const;
75
76 virtual void fillElementOldGasPorePressure(const GmElement* e, GmVector& pgOld) const;
77
78 virtual void fillElementOldLiqPorePressure(const GmElement* e, GmVector& plOld) const;
79
80 virtual void fillElementPorePressureIncrement(const GmElement* e, GmVector& P, GmVector& dP) const;
81
82 virtual void fillElementPerturbedPorePressure(const GmElement* e, const GmVector& P, const GmVector& eps, GmVector& Pl, GmVector& Pg) const;
83
84 virtual void FillDofIndexPosition(const GmElement* e, QVector<int>& iPe, QVector<int>& iPfe) const;
85
86 // Evaluates nodal variables
87 virtual bool evaluateNodalVariables(const GmElement* e, tp::saturationTerms& Sat, tp::densityTerms& Den,
89
90 virtual bool assembleElementData(const GmElement* e, GmMatrix& J, GmVector& r, GmVector& Fil, GmVector& Fig,
92
93protected:
94 // See comments on the base class
95 virtual const GmElementDof* dofMapping(GmCellType type) const;
96
97
100 {
102
103 // --- NO ADDING BELOW THIS LINE
105 };
106
124
127 {
131
132 // ------ NO ADDING BELOW THIS LINE
134 };
135
138 {
139 FIXED_PG_BC_ID = GmpHydraulic::NUM_BC_IDS,
141
142 // --- NO ADDING BELOW THIS LINE
144 };
145
148 {
151
152 // --- NO ADDING BELOW THIS LINE
154 };
155//public:
156
157};
158
159#endif
Basic class for the hydraulic physics plugin object.
Definition gmpHydraulic.h:39
virtual bool calcDerivedResults(bool nonLinearSolver)
Calc velocity and flow on nodes and/or Gauss points.
Definition gmpHydraulic.cpp:515
@ NUM_NA_IDS
The number of node attribute ids above.
Definition gmpHydraulic.h:158
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the single Hydraulics attribute map, built when the function is called for th...
Definition gmpHydraulic.cpp:62
@ NUM_BC_IDS
The number of boundary conditions ids above.
Definition gmpHydraulic.h:200
virtual void gravityVector(const GmElement *e, const GmVector *coord, int ip, GmVector &grav) const
Returns the gravity accelaration vector.
Definition gmpHydraulic.cpp:925
@ NUM_STATEVAR_IDS
The number of property ids above.
Definition gmpHydraulic.h:147
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 gmpHydraulic.cpp:388
virtual bool checkAndLoadAttributeAccessors(LuaTable &nodeTable, LuaTable &cellTable, LuaTable &gaussTable)
Checks the loaded data.
Definition gmpHydraulic.cpp:219
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 gmpHydraulic.cpp:381
@ NUM_CA_IDS
The number of cell attribute ids above.
Definition gmpHydraulic.h:166
virtual FemResultType fillElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for a generic element.
Definition gmpHydraulic.cpp:236
@ NUM_BCV_IDS
The number of boundary conditions value ids above.
Definition gmpHydraulic.h:211
Basic class for the standard hydraulic physics plugin object.
Definition gmpHydraulicTwoPhaseFlow.h:41
TwoPhaseNodeAttributeIds
Definition gmpHydraulicTwoPhaseFlow.h:109
@ PgRef_NA_ID
Base Id for node attributes used to store reference gas pressure.
Definition gmpHydraulicTwoPhaseFlow.h:119
@ Pg_NA_ID
Base Id for node attributes used to store gas phase density.
Definition gmpHydraulicTwoPhaseFlow.h:112
@ PgOLD_NA_ID
Id for retrieving the previous gas pore pressure.
Definition gmpHydraulicTwoPhaseFlow.h:113
@ PlOLD_NA_ID
Id for retrieving the previous liquid pore pressure.
Definition gmpHydraulicTwoPhaseFlow.h:111
@ RHOlOLD_NA_ID
Base Id for node attributes used to store old liquid phase density.
Definition gmpHydraulicTwoPhaseFlow.h:115
@ RHOgOLD_NA_ID
Base Id for node attributes used to store old gas phase density.
Definition gmpHydraulicTwoPhaseFlow.h:117
@ RHOg_NA_ID
Base Id for node attributes used to store gas phase density.
Definition gmpHydraulicTwoPhaseFlow.h:116
@ RHOl_NA_ID
Base Id for node attributes used to store liquid phase density.
Definition gmpHydraulicTwoPhaseFlow.h:114
@ PlRef_NA_ID
Base Id for node attributes used to store reference liquid pressure.
Definition gmpHydraulicTwoPhaseFlow.h:118
@ NUM_NA_IDS
The number of state var ids above.
Definition gmpHydraulicTwoPhaseFlow.h:122
TwoPhaseStateVarIds
IDs fo physics state vars.
Definition gmpHydraulicTwoPhaseFlow.h:100
@ NUM_STATEVAR_IDS
The number of property ids above.
Definition gmpHydraulicTwoPhaseFlow.h:104
TwoPhaseCellAttributeIds
IDs for physics cell attributes.
Definition gmpHydraulicTwoPhaseFlow.h:127
@ NUM_CA_IDS
The number of node attribute ids above.
Definition gmpHydraulicTwoPhaseFlow.h:133
@ POROLD_CA_ID
Base Id for cell attributes used to store old porosity.
Definition gmpHydraulicTwoPhaseFlow.h:130
@ POR_CA_ID
Base Id for cell attributes used to store porosity.
Definition gmpHydraulicTwoPhaseFlow.h:129
TwoPhaseBoundaryConditionValueIds
IDs for property values from accepted boundary condition types.
Definition gmpHydraulicTwoPhaseFlow.h:148
@ BC_QG_ID
Nodal pore flow for fixed node gas pore flow boundary condition.
Definition gmpHydraulicTwoPhaseFlow.h:150
@ NUM_BCV_IDS
The number of boundary conditions value ids above.
Definition gmpHydraulicTwoPhaseFlow.h:153
TwoPhaseBoundaryConditionIds
IDs for accepted boundary condition types.
Definition gmpHydraulicTwoPhaseFlow.h:138
@ NUM_BC_IDS
The number of boundary conditions ids above.
Definition gmpHydraulicTwoPhaseFlow.h:143
@ FIXED_QG_BC_ID
Id for fixed node gas flow boundary condition.
Definition gmpHydraulicTwoPhaseFlow.h:140
GmCellType
arma::mat GmMatrix
arma::vec GmVector
Declaration of the gmpHydraulic classes.
Declaration of the GmpHydraulicTwoPhaseUtils class.
Definition gmpHydraulicTwoPhaseUtils.h:55
Definition gmpHydraulicTwoPhaseUtils.h:149
Definition gmpHydraulicTwoPhaseUtils.h:83
Definition gmpHydraulicTwoPhaseUtils.h:100
Definition gmpHydraulicTwoPhaseUtils.h:37
Definition gmpHydraulicTwoPhaseUtils.h:71