HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpMaterialGeneralizedDualPorosity.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_MATERIAL_GENERALIZEDDUALPOROSITY_H_
26#define _GEMA_PLUGIN_HYDRAULIC_MATERIAL_GENERALIZEDDUALPOROSITY_H_
27
30
32{
33protected:
45
46public:
47
50 : GmpHydraulicMaterialDualPorosity(typeIndex, typeName, logger) {}
51
53 static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
54 {
55 Q_UNUSED(simulation);
56 return new GmpHydraulicMaterialGeneralizedDualPorosity(typeIndex, typeName, logger);
57 }
58
59 // set dual porosity material map
60 virtual const QVariantMap* materialMetaDataMap();
61
63 virtual GmVector fractureSetSpacing(const GmElement* e, const GmVector* coord, int ip) const
64 {
65 S_TRACE(); assert(e);
66 GmVector Sf;
67 GmCellAccessor* sfAc = propertyAc(Sfr_ID);
68 // fill property values
69 if (!vectorPropertyValue(e, sfAc, Sf, coord, ip)) {
70 Sf.set_size(1);
71 return Sf.fill(0);
72 }
73 return Sf;
74 }
75
77 virtual GmVector fractureSetAperture(const GmElement* e, const GmVector* coord, int ip) const
78 {
79 S_TRACE(); assert(e);
80 GmVector Bfr;
81 GmCellAccessor* bfAc = propertyAc(Bfr_ID);
82 // Fills property values
83 vectorPropertyValue(e, bfAc, Bfr, coord, ip);
84
85 return Bfr;
86 }
87
89 virtual GmVector fractureSetDip(const GmElement* e, const GmVector* coord, int ip) const
90 {
91 S_TRACE(); assert(e);
92 GmVector Dip;
93 GmCellAccessor* dipAc = propertyAc(DIP_ID);
94 // Fills property values
95 vectorPropertyValue(e, dipAc, Dip, coord, ip);
96
97 return Dip;
98 }
99
101 virtual GmVector fractureSetStrike(const GmElement* e, const GmVector* coord, int ip) const
102 {
103 S_TRACE(); assert(e);
104 GmVector Strike;
105 GmCellAccessor* strikeAc = propertyAc(STRIKE_ID);
106 // fill property values
107 if (!vectorPropertyValue(e, strikeAc, Strike, coord, ip)) {
108 Strike.set_size(1);
109 return Strike.fill(0);
110 }
111 return Strike;
112 }
113
115 virtual double fillFracturePorosity(const GmElement* e, const GmVector* coord, int ip) const;
116
118 virtual bool fillFracturePermeability(const GmElement* e, GmMatrix& Kper, const GmVector* coord, int ip) const;
119
121 virtual bool fillShapeFactor(const GmElement* e, double& ws, GmMatrix Km, const GmVector* coord, int ip)const;
122
124 virtual GmMatrix fillRotationMatrix(int dim, double dip, double strike) const
125 {
126 GmMatrix Rot(dim, dim);
127 Rot.fill(0);
128 if (dim == 2)
129 {
130 // fills bidimensional rotation matrix
131 Rot(0, 0) = cos(strike); Rot(0, 1) = sin(strike);
132 Rot(1, 0) = -sin(strike); Rot(1, 1) = cos(strike);
133 }
134 if (dim == 3)
135 {
136 // fills threedimensional rotation matrix
137 Rot(0, 0) = sin(strike);
138 Rot(0, 1) = cos(strike);
139 Rot(1, 0) = cos(dip)*cos(strike);
140 Rot(1, 1) = -cos(dip)*sin(strike);
141 Rot(1, 2) = -sin(dip);
142 Rot(2, 0) = -sin(dip)*cos(strike);
143 Rot(2, 1) = sin(dip)*sin(strike);
144 Rot(2, 2) = -cos(dip);
145 }
146
147 return Rot;
148
149 };
150
152 virtual GmMatrix fillFractureLocalPermeability(int dim, double bi, double si) const
153 {
154 GmMatrix Kfrl(dim, dim);
155 Kfrl.fill(0);
156 if (dim == 2)
157 {
158 // fills bidimensional rotation matrix
159 Kfrl(0, 0) = pow(bi, 3) / (12 * si);
160 }
161 if (dim == 3)
162 {
163 // fills threedimensional rotation matrix
164 Kfrl(0, 0) = pow(bi, 3) / (12 * si);
165 Kfrl(1, 1) = pow(bi, 3) / (12 * si);
166 }
167 return Kfrl;
168 };
169
170 bool GmpHydraulicMaterialGeneralizedDualPorosity::NormalFractureVector(GmVector& Vn, GmMatrix J)
171{
172 S_TRACE();
173
174 double J1 = 0.0, J2 = 0.0, J3 = 0.0;
175 J1 = J(0, 0)*J(1, 1) - J(1, 0)*J(0, 1);
176 J2 = J(0, 0)*J(1, 2) - J(1, 0)*J(0, 2);
177 J3 = J(0, 1)*J(1, 2) - J(1, 1)*J(0, 2);
178
179 double detJ2;
180 //Normal Vn at normal direction 3
181 detJ2 = sqrt(J1*J1 + J2 * J2 + J3 * J3);
182 Vn(0) = J3 / detJ2; // Vn(0)
183 Vn(1) = -J2 / detJ2; // Vn(1)
184 Vn(2) = J1 / detJ2; // Vn(2)
185
186 return true;
187}
188};
189
190
191#endif
Definition gmpMaterialDualPorosity.h:32
@ NUM_PROPERTY_IDS
The number of property ids above.
Definition gmpMaterialDualPorosity.h:52
virtual const QVariantMap * materialMetaDataMap()
Returns a pointer to the material attribute map, built when the function is called for the first time...
Definition gmpMaterialDualPorosity.cpp:19
virtual double fillFracturePorosity(const GmElement *e, const GmVector *coord, int ip) const
returns the fracture porosity
Definition gmpMaterialDualPorosity.cpp:125
virtual bool fillFracturePermeability(const GmElement *e, GmMatrix &Kper, const GmVector *coord, int ip) const
returns the fracture permeability
Definition gmpMaterialDualPorosity.cpp:159
virtual bool fillShapeFactor(const GmElement *e, double &ws, GmMatrix Km, const GmVector *coord, int ip) const
returns the shape factor
Definition gmpMaterialDualPorosity.cpp:211
Definition gmpMaterialGeneralizedDualPorosity.h:32
virtual GmMatrix fillRotationMatrix(int dim, double dip, double strike) const
returns the rotation matrix
Definition gmpMaterialGeneralizedDualPorosity.h:124
virtual GmMatrix fillFractureLocalPermeability(int dim, double bi, double si) const
returns the local fracture permeability matrix
Definition gmpMaterialGeneralizedDualPorosity.h:152
virtual GmVector fractureSetStrike(const GmElement *e, const GmVector *coord, int ip) const
Returns the angle of strike.
Definition gmpMaterialGeneralizedDualPorosity.h:101
DualPorosityElementPropertyIds
IDs for saturated material element properties.
Definition gmpMaterialGeneralizedDualPorosity.h:36
@ Bfr_ID
Id for retrieving the frature aperture accessor.
Definition gmpMaterialGeneralizedDualPorosity.h:38
@ DIP_ID
Id for retrieving the angle of dip accessor.
Definition gmpMaterialGeneralizedDualPorosity.h:39
@ STRIKE_ID
Id for retrieving the angle of strike accessor
Definition gmpMaterialGeneralizedDualPorosity.h:40
@ NUM_PROPERTY_IDS
The number of property ids above.
Definition gmpMaterialGeneralizedDualPorosity.h:43
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialGeneralizedDualPorosity.h:53
virtual GmVector fractureSetAperture(const GmElement *e, const GmVector *coord, int ip) const
Returns the fracture spacing.
Definition gmpMaterialGeneralizedDualPorosity.h:77
GmpHydraulicMaterialGeneralizedDualPorosity(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition gmpMaterialGeneralizedDualPorosity.h:49
virtual GmVector fractureSetDip(const GmElement *e, const GmVector *coord, int ip) const
Returns the angle of dip.
Definition gmpMaterialGeneralizedDualPorosity.h:89
virtual GmVector fractureSetSpacing(const GmElement *e, const GmVector *coord, int ip) const
Returns the fracture spacing.
Definition gmpMaterialGeneralizedDualPorosity.h:63
arma::mat GmMatrix
#define S_TRACE()
arma::vec GmVector
Declaration of the GmpHydraulicMaterial classes.
Declaration of the GmpHydraulicMaterialDualPorosity class.