HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpHydraulicDualFlow.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
25#ifndef _GEMA_PLUGIN_HYDRAULIC_DUALFLOW_H_
26#define _GEMA_PLUGIN_HYDRAULIC_DUALFLOW_H_
27
28#include "gmpHydraulic.h"
29#include <gmpFemPhysicsCommon.h>
30#include <gmpFemPhysicsData.h>
31#include <gmSimulationData.h>
32#include <gmPropertySet.h>
33#include <gmTrace.h>
34#include <math.h>
35
36
37class GmGaussAccessor;
38
41{
42public:
43 // constructor
44 GmpHydraulicDualFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
45 const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
46
47 // destructor
48 virtual ~GmpHydraulicDualFlow();
49
50 // set physic map
51 virtual const QVariantMap* physicsMetaDataMap();
52
53 // fill elemental matrix and vectors (K, Fi)
54 virtual GmpFemPhysics::FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
55
56 virtual bool fixedNodalForcesBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values) const;
57 virtual bool fixedNodalDofsBc (QVector<int>& nodes, QVector<int>&dof, QVector<double>& values, bool* constantValues) const;
58 virtual void fillFractureStorageCompMatrix(const GmElement* e, const GmVector* coord, int ip, GmMatrix& Sfc, const GmVector& N, double c) const;
59 virtual void fillTransferMatrix(const GmElement* e, const GmVector* coord, int ip, GmMatrix& Wfm, const GmVector& N, double c) const;
60 virtual void fillFluidFlowMatrix(const GmElement* e, const GmVector* coord, int ip, GmMatrix& Kfc, const GmMatrix& Bp, double c) const;
61 virtual void fillElementFluidPorePressure(const GmElement* e, GmVector& Pfe);
62 virtual void fillDampingMatrix(const GmElement* e, GmMatrix& C, const GmMatrix& Sc, const GmMatrix& Sfc, const QVector<int>& iPe, const QVector<int>& iPfe) const;
63 virtual void fillStiffnessMatrix(const GmElement* e, GmMatrix& K, const GmMatrix& Kc, const GmMatrix& Kfc, const GmMatrix& Wfm, const QVector<int>& iPe, const QVector<int>& iPfe) const;
64 virtual void fillInternalForceVector(const GmElement* e, GmVector& Fi, const GmMatrix& Kc, const GmMatrix& Kfc,
65 const GmMatrix& Wfm, const GmVector& pe, const GmVector& pfe, const QVector<int>& iPe, const QVector<int>& iPfe) const;
66 virtual void FillDofIndexPosition(const GmElement* e, QVector<int>& iPe, QVector<int>& iPfe) const;
67 virtual bool calcDerivedResults(bool nonLinearSolver);
68 // Returns the fracture property set
69 virtual GmPropertySet* fracturePropertySet(int id) const;
70
71protected:
72 // See comments on the base class
73 virtual const GmElementDof* dofMapping(GmCellType type) const;
74
75 // See comments on the base class
76 virtual bool checkAndLoadPrivateData(LuaTable& table);
77
80 {
82
83 // --- NO ADDING BELOW THIS LINE
85 };
86
89 {
92
93 // ------ NO ADDING BELOW THIS LINE
95 };
96
99 {
101
102 // --- NO ADDING BELOW THIS LINE
104 };
105
115
118 {
121
122 // --- NO ADDING BELOW THIS LINE
124 };
125
128 {
130
131 // ------ NO ADDING BELOW THIS LINE
133 };
134
135
136 virtual void calcElementDerivedResultAtPoints(const GmElement* e, int resultId, const GmMatrix& evalPoints, bool evalAtIp, GmMatrix& result);
137
138 void calcElementVelocityAtPoints(const GmElement* e, const GmMatrix& evalPoints, GmMatrix& v);
139 void calcElementFlowAtPoints(const GmElement* e, const GmMatrix& evalPoints, bool evalAtIp, GmMatrix& q);
140
141//private:
142 GmpFemPhysicsData _fractureData;
144};
145
146#endif
Dual flow hydraulic 2D & 3D for Quad, Tri, Hex and Tet.
Definition gmpHydraulicDualFlow.h:41
virtual void FillDofIndexPosition(const GmElement *e, QVector< int > &iPe, QVector< int > &iPfe) const
Fills the position index of the two hydraulic degrees of freedom. the implementation supports order o...
Definition gmpHydraulicDualFlow.cpp:640
DualFlowNodeAttributeIds
IDs for physics node attributes.
Definition gmpHydraulicDualFlow.h:89
@ VFF_NA_ID
Base Id for node attribute(s) used to store the calculated reaction volume flux.
Definition gmpHydraulicDualFlow.h:90
@ VEF_NA_ID
Base Id for node attribute(s) used to store the calculated fracture velocity.
Definition gmpHydraulicDualFlow.h:91
@ NUM_NA_IDS
The number of node attribute ids above.
Definition gmpHydraulicDualFlow.h:94
virtual void fillStiffnessMatrix(const GmElement *e, GmMatrix &K, const GmMatrix &Kc, const GmMatrix &Kfc, const GmMatrix &Wfm, const QVector< int > &iPe, const QVector< int > &iPfe) const
Fills the Stiffness matrix with the computed "permeability" Matrizes Returns K = Kc + Kfc,...
Definition gmpHydraulicDualFlow.cpp:553
GmValueAccessor * _anAcc
fracture aperture accessor
Definition gmpHydraulicDualFlow.h:143
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 = ...
Definition gmpHydraulicDualFlow.cpp:730
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the Hydraulics dual flow attribute map, built when the function is called for...
Definition gmpHydraulicDualFlow.cpp:60
GmpFemPhysicsData _fractureData
fracture data
Definition gmpHydraulicDualFlow.h:142
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,...
Definition gmpHydraulicDualFlow.cpp:872
DualFlowGaussAttributeIds
IDs for physics Gauss attributes.
Definition gmpHydraulicDualFlow.h:99
@ NUM_GA_IDS
The number of Gauss attribute ids above.
Definition gmpHydraulicDualFlow.h:103
@ VEF_GA_ID
Base Id for Gauss attribute(s) used to store the calculated fracture velocity.
Definition gmpHydraulicDualFlow.h:100
virtual void fillFractureStorageCompMatrix(const GmElement *e, const GmVector *coord, int ip, GmMatrix &Sfc, const GmVector &N, double c) const
Calculates the stiffness matrix of "storage / compressibility of fluid" for element 'e' at the given ...
Definition gmpHydraulicDualFlow.cpp:442
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 gmpHydraulicDualFlow.cpp:411
DualFlowBoundaryConditionIds
IDs for accepted boundary condition types.
Definition gmpHydraulicDualFlow.h:108
@ NUM_BC_IDS
The number of boundary conditions ids above.
Definition gmpHydraulicDualFlow.h:113
@ FIXED_QF_BC_ID
Id for fixed node fracture flow boundary condition.
Definition gmpHydraulicDualFlow.h:110
@ FIXED_PF_BC_ID
Id for fixed node fracture pore pressure boundary condition.
Definition gmpHydraulicDualFlow.h:109
virtual ~GmpHydraulicDualFlow()
Destructor.
Definition gmpHydraulicDualFlow.cpp:53
virtual bool calcDerivedResults(bool nonLinearSolver)
Calc velocity and flow on nodes and/or Gauss points.
Definition gmpHydraulicDualFlow.cpp:676
DualFlowPhysicsAttributeIds
IDs for physics attributes.
Definition gmpHydraulicDualFlow.h:128
@ FRACPROPSET_ID
Id for retrieving the fracture property attribute.
Definition gmpHydraulicDualFlow.h:129
@ NUM_ATTRI_IDS
The number of physics attribute ids above.
Definition gmpHydraulicDualFlow.h:132
virtual void fillTransferMatrix(const GmElement *e, const GmVector *coord, int ip, GmMatrix &Wfm, const GmVector &N, double c) const
Fills the Transfer matrix with the computed scalar "shape factor" Returns Wfm = ws * c * N * N....
Definition gmpHydraulicDualFlow.cpp:615
DualFlowBoundaryConditionValueIds
IDs for property values from accepted boundary condition types.
Definition gmpHydraulicDualFlow.h:118
@ BC_PF_ID
Nodal pore pressure for fixed node fracture pore pressure boundary condition.
Definition gmpHydraulicDualFlow.h:119
@ NUM_BCV_IDS
The number of boundary conditions value ids above.
Definition gmpHydraulicDualFlow.h:123
@ BC_QWF_ID
Nodal pore flow for fixed node fracture pore flow boundary condition.
Definition gmpHydraulicDualFlow.h:120
virtual GmpFemPhysics::FemResultType fillElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for a generic dual flow element.
Definition gmpHydraulicDualFlow.cpp:223
virtual void fillInternalForceVector(const GmElement *e, GmVector &Fi, const GmMatrix &Kc, const GmMatrix &Kfc, const GmMatrix &Wfm, const GmVector &pe, const GmVector &pfe, const QVector< int > &iPe, const QVector< int > &iPfe) const
Fills the Internal force vector for both fluids Returns fi = Kc*pe + Kfc*pfe, where: Kc is the permea...
Definition gmpHydraulicDualFlow.cpp:584
virtual void fillFluidFlowMatrix(const GmElement *e, const GmVector *coord, int ip, GmMatrix &Kfc, const GmMatrix &Bp, double c) const
Calculates the flow stiffness matrix of fluid 2 due to permeability contribution or permeability matr...
Definition gmpHydraulicDualFlow.cpp:491
void calcElementVelocityAtPoints(const GmElement *e, const GmMatrix &evalPoints, GmMatrix &v)
The function responsible for effectivelly calculating the velocity at the given evaluation points,...
Definition gmpHydraulicDualFlow.cpp:763
DualFlowStateVarIds
IDs fo physics state vars.
Definition gmpHydraulicDualFlow.h:80
@ PF_ID
Id for retrieving the accessor to the fracture pore pressure state var.
Definition gmpHydraulicDualFlow.h:81
@ NUM_STATEVAR_IDS
The number of property ids above.
Definition gmpHydraulicDualFlow.h:84
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 gmpHydraulicDualFlow.cpp:393
virtual void fillElementFluidPorePressure(const GmElement *e, GmVector &Pfe)
Given an element, fills the vector pfe with nodal pore pressureof the seconf fluid....
Definition gmpHydraulicDualFlow.cpp:386
virtual void fillDampingMatrix(const GmElement *e, GmMatrix &C, const GmMatrix &Sc, const GmMatrix &Sfc, const QVector< int > &iPe, const QVector< int > &iPfe) const
Fills the Damping matrix with the computed "storage/compressibility" Matrizes Returns C = Sc + Sfc,...
Definition gmpHydraulicDualFlow.cpp:525
Basic class for the hydraulic physics plugin object.
Definition gmpHydraulic.h:39
@ NUM_GA_IDS
The number of Gauss attribute ids above.
Definition gmpHydraulic.h:178
@ 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_BCV_IDS
The number of boundary conditions value ids above.
Definition gmpHydraulic.h:211
GmCellType
arma::mat GmMatrix
arma::vec GmVector
Declaration of the gmpHydraulic classes.