Xfem
The Xfem Plugin
xfemHydroMechanicalMaterial.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2017 by Geomechanic group - Tecgraf/Puc-Rio
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_XFEM_HYDROMECHANICALMATERIAL_H_
25 #define _GEMA_XFEM_HYDROMECHANICALMATERIAL_H_
26 
27 #include <gmTrace.h>
28 #include <gmpHydraulicMaterial.h>
29 #include <gmpMechanicalMaterial.h>
30 
31 #include "xfemMaterial.h"
32 
35 //template <class T> class XfemHydroMechanicalMaterial : public T
37 {
38 public:
39  //enum ElemHMXfemGaussAttributeIds
40  //{
41  // Sw_GA_ID, //!< Base Id for Gauss attribute(s) used to store the wetting fluid saturation
42  //
43  // // --- NO ADDING BELOW THIS LINE
44  // NUM_GA_IDS, //!< The number of property ids above
45  //};
47  XfemHydroMechanicalMaterial(int typeIndex, QString typeName, const GmLogCategory& logger)
48  : XfemMaterial(typeIndex, typeName, logger)
49  {
50  _hydroMaterial = NULL;
51  _mechanoMaterial = NULL;
52  }
53 
54  // destructor
55  virtual ~XfemHydroMechanicalMaterial(){};
56 
58  static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
59  {
60  Q_UNUSED(simulation);
61  return new XfemHydroMechanicalMaterial(typeIndex, typeName, logger);
62  }
63 
64  // Returns a map with material associated properties.
65  virtual const QVariantMap* materialMetaDataMap();
66 
67  // Returns the constitutive tangent matrix
68  virtual void tangentModulus(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, unsigned nc, unsigned ips) const;
69 
70  // Returns the stresses according to the material behavior adopted
71  virtual void returnMapping(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, unsigned nc, unsigned ips) const;
72 
74  //virtual bool initialCondition(const GmElement* e, const GmVector* coord, int ip) const;
75 
76  // Returns a gauss atribute accessor
77  //virtual GmGaussAccessor* gaussAttributeAccessor(int gausAcc)const;
78 
79  // Returns a gauss atribute accessor
80  //virtual XfemGaussAccessor* enrichedGaussAttributeAccessor(int gausAcc)const;
81 
83  virtual double solidBulkModulus(const GmElement* e, const GmVector* coord, int ip) const
84  {
85  if (propertyAc(KSS_ID) == NULL)
86  {
87  return 1.0e25;
88  }
89  double Kss = propertyAc(KSS_ID)->scalarValueAt(e, coord, ip);
90  if (Kss <= 0.0) { Kss = 1.0e25; }
91 
92  return Kss;
93  }
94 
96  virtual double nonWettingBulkModulus(const GmElement* e, const GmVector* coord, int ip) const
97  {
98  if (propertyAc(Knw_ID) == NULL)
99  {
100  return 1.0e25;
101  }
102  double Kss = propertyAc(Knw_ID)->scalarValueAt(e, coord, ip);
103  if (Kss <= 0.0) { Kss = 1.0e25; }
104 
105  return Kss;
106  }
107 
109  virtual double fluidViscosity(const GmElement* e, const GmVector* coord, int ip) const
110  {
111  S_TRACE();
112  assert(e);
113  return propertyAc(UFw_ID)->scalarValueAt(e, coord, ip);
114  }
115 
117  virtual double interfaceBiotModulus(const GmElement* e, const GmVector* coord, int ip) const
118  {
119  S_TRACE();
120  assert(e);
121  if (propertyAc(MFw_ID) == NULL)
122  {
123  return 0;
124  }
125  return propertyAc(MFw_ID)->scalarValueAt(e, coord, ip);
126  }
127 
129  virtual double leakoffTop(const GmElement* e, const GmVector* coord, int ip) const
130  {
131  S_TRACE();
132  assert(e);
133  if (propertyAc(LKT_ID) == NULL)
134  {
135  return 0;
136  }
137  return propertyAc(LKT_ID)->scalarValueAt(e, coord, ip);
138  }
139 
141  virtual double leakoffBottom(const GmElement* e, const GmVector* coord, int ip) const
142  {
143  S_TRACE();
144  assert(e);
145  if (propertyAc(LKB_ID) == NULL)
146  {
147  return 0;
148  }
149  return propertyAc(LKB_ID)->scalarValueAt(e, coord, ip);
150  }
151 
152  virtual double initialWaterSaturation(const GmElement* e, const GmVector* coord, int ip) const
153  {
154  S_TRACE();
155  assert(e);
156  if (propertyAc(SIW_ID) == NULL)
157  {
158  return 0;
159  }
160  return propertyAc(SIW_ID)->scalarValueAt(e, coord, ip);
161  }
162 
163  virtual double residualWaterSaturation(const GmElement* e, const GmVector* coord, int ip) const
164  {
165  S_TRACE();
166  assert(e);
167  if (propertyAc(SRW_ID) == NULL)
168  {
169  return 0;
170  }
171  return propertyAc(SRW_ID)->scalarValueAt(e, coord, ip);
172  }
173 
174  virtual double bubblingPressure(const GmElement* e, const GmVector* coord, int ip) const
175  {
176  S_TRACE();
177  assert(e);
178  if (propertyAc(PBB_ID) == NULL)
179  {
180  return 0;
181  }
182  return propertyAc(PBB_ID)->scalarValueAt(e, coord, ip);
183  }
184 
185  virtual double nWFluidViscosity(const GmElement* e, const GmVector* coord, int ip) const
186  {
187  S_TRACE();
188  assert(e);
189  if (propertyAc(UFnw_ID) == NULL)
190  {
191  return 0;
192  }
193  return propertyAc(UFnw_ID)->scalarValueAt(e, coord, ip);
194  }
195 
196  virtual double intrinsicPermeability(const GmElement* e, const GmVector* coord, int ip) const
197  {
198  S_TRACE();
199  assert(e);
200  if (propertyAc(Kim_ID) == NULL)
201  {
202  return 0;
203  }
204  return propertyAc(Kim_ID)->scalarValueAt(e, coord, ip);
205  }
206 
207  virtual double wettingFluidDensity(const GmElement* e, const GmVector* coord, int ip) const
208  {
209  S_TRACE();
210  assert(e);
211  if (propertyAc(rhow_ID) == NULL)
212  {
213  return 0;
214  }
215  return propertyAc(rhow_ID)->scalarValueAt(e, coord, ip);
216  }
217 
218  virtual double nonWettingFluidDensity(const GmElement* e, const GmVector* coord, int ip) const
219  {
220  S_TRACE();
221  assert(e);
222  if (propertyAc(rhonw_ID) == NULL)
223  {
224  return 0;
225  }
226  return propertyAc(rhonw_ID)->scalarValueAt(e, coord, ip);
227  }
228 
229  virtual double solidDensity(const GmElement* e, const GmVector* coord, int ip) const
230  {
231  S_TRACE();
232  assert(e);
233  if (propertyAc(rhos_ID) == NULL)
234  {
235  return 0;
236  }
237  return propertyAc(rhos_ID)->scalarValueAt(e, coord, ip);
238  }
239 
240  virtual double gammaNonWettingFluid(const GmElement* e, const GmVector* coord, int ip) const
241  {
242  S_TRACE();
243  assert(e);
244  if (propertyAc(Gnw_ID) == NULL)
245  {
246  return 0;
247  }
248  return propertyAc(Gnw_ID)->scalarValueAt(e, coord, ip);
249  }
250 
251  virtual double specificHeatWettingFluid(const GmElement* e, const GmVector* coord, int ip) const
252  {
253  S_TRACE();
254  assert(e);
255  if (propertyAc(CTw_ID) == NULL)
256  {
257  return 0;
258  }
259  return propertyAc(CTw_ID)->scalarValueAt(e, coord, ip);
260  }
261 
262  virtual double specificHeatNonWettingFluid(const GmElement* e, const GmVector* coord, int ip) const
263  {
264  S_TRACE();
265  assert(e);
266  if (propertyAc(CTnw_ID) == NULL)
267  {
268  return 0;
269  }
270  return propertyAc(CTnw_ID)->scalarValueAt(e, coord, ip);
271  }
272 
273  virtual double specificHeatSolid(const GmElement* e, const GmVector* coord, int ip) const
274  {
275  S_TRACE();
276  assert(e);
277  if (propertyAc(CTs_ID) == NULL)
278  {
279  return 0;
280  }
281  return propertyAc(CTs_ID)->scalarValueAt(e, coord, ip);
282  }
283 
284  virtual double thermalConductivityWettingFluid(const GmElement* e, const GmVector* coord, int ip) const
285  {
286  S_TRACE();
287  assert(e);
288  if (propertyAc(KTw_ID) == NULL)
289  {
290  return 0;
291  }
292  return propertyAc(KTw_ID)->scalarValueAt(e, coord, ip);
293  }
294 
295  virtual double thermalConductivityNonWettingFluid(const GmElement* e, const GmVector* coord, int ip) const
296  {
297  S_TRACE();
298  assert(e);
299  if (propertyAc(KTnw_ID) == NULL)
300  {
301  return 0;
302  }
303  return propertyAc(KTnw_ID)->scalarValueAt(e, coord, ip);
304  }
305 
306  virtual double thermalConductivitySolid(const GmElement* e, const GmVector* coord, int ip) const
307  {
308  S_TRACE();
309  assert(e);
310  if (propertyAc(KTs_ID) == NULL)
311  {
312  return 0;
313  }
314  return propertyAc(KTs_ID)->scalarValueAt(e, coord, ip);
315  }
316 
317  virtual double thermalExpansionWettingFluid(const GmElement* e, const GmVector* coord, int ip) const
318  {
319  S_TRACE();
320  assert(e);
321  if (propertyAc(BTw_ID) == NULL)
322  {
323  return 0;
324  }
325  return propertyAc(BTw_ID)->scalarValueAt(e, coord, ip);
326  }
327 
328  virtual double thermalExpansionNonWettingFluid(const GmElement* e, const GmVector* coord, int ip) const
329  {
330  S_TRACE();
331  assert(e);
332  if (propertyAc(BTnw_ID) == NULL)
333  {
334  return 0;
335  }
336  return propertyAc(BTnw_ID)->scalarValueAt(e, coord, ip);
337  }
338 
339  virtual double thermalExpansionSolid(const GmElement* e, const GmVector* coord, int ip) const
340  {
341  S_TRACE();
342  assert(e);
343  if (propertyAc(BTs_ID) == NULL)
344  {
345  return 0;
346  }
347  return propertyAc(BTs_ID)->scalarValueAt(e, coord, ip);
348  }
349 
351  virtual double cubicLaw(const GmElement* e, const GmVector* coord, int ip, double wn, bool cubiclaw) const;
353  virtual double cubicLawMP(const GmElement* e, const GmVector* coord, int ip, double wn, bool cubiclaw) const;
354 
355 protected:
358  {
383  // --- NO ADDING BELOW THIS LINE
385  };
386 
387 
388 private:
389  GmpFemPhysicsCommonMaterial* _hydroMaterial;
390  GmpFemPhysicsCommonMaterial* _mechanoMaterial;
391 
392 };
393 #endif
virtual double interfaceBiotModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the discontinuity Biot's Modulus.
Definition: xfemHydroMechanicalMaterial.h:117
Id for retrieving the bubbling pressure.
Definition: xfemHydroMechanicalMaterial.h:366
Id for retrieving the solid density accessor.
Definition: xfemHydroMechanicalMaterial.h:372
Id for retrieving the thermal expansion coefficient of the wetting fluid accessor.
Definition: xfemHydroMechanicalMaterial.h:380
Id for retrieving the intrinsic permeability accessor.
Definition: xfemHydroMechanicalMaterial.h:369
ElemHMXfemPropertyIds
IDs for material element properties.
Definition: xfemHydroMechanicalMaterial.h:357
Id for retrieving the discontinuity Biot's Modulus.
Definition: xfemHydroMechanicalMaterial.h:361
Id for retrieving the non-wetting fluid density accessor.
Definition: xfemHydroMechanicalMaterial.h:371
#define S_TRACE()
virtual double solidBulkModulus(const GmElement *e, const GmVector *coord, int ip) const
Sets the initial conditions.
Definition: xfemHydroMechanicalMaterial.h:83
Id for retrieving the residual water saturation.
Definition: xfemHydroMechanicalMaterial.h:365
Id for retrieving the wetting fluid density accessor.
Definition: xfemHydroMechanicalMaterial.h:370
Basic class for the elastic xfem material plugin object.
Definition: xfemHydroMechanicalMaterial.h:36
Declaration of the xfemMaterial classes.
The number of property ids above.
Definition: xfemHydroMechanicalMaterial.h:384
Id for retrieving the Specific heat capacity of the solid accessor.
Definition: xfemHydroMechanicalMaterial.h:376
Id for retrieving the thermal conductivity of the solid accessor.
Definition: xfemHydroMechanicalMaterial.h:379
Id for retrieving the thermal expansion coefficient of the non-wetting fluid accessor.
Definition: xfemHydroMechanicalMaterial.h:381
Id for retrieving the dynamic fluid viscosity.
Definition: xfemHydroMechanicalMaterial.h:360
Id for retrieving the dynamic non-wetting fluid bulk's Modulus accessor.
Definition: xfemHydroMechanicalMaterial.h:368
virtual const QVariantMap * materialMetaDataMap()
Returns a pointer to the material attribute map, built when the function is called for the first time...
Definition: xfemHydroMechanicalMaterial.cpp:40
Id for retrieving the leakoff coefficient at the top.
Definition: xfemHydroMechanicalMaterial.h:362
XfemHydroMechanicalMaterial(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition: xfemHydroMechanicalMaterial.h:47
Basic class for the elastic xfem material plugin object.
Definition: xfemMaterial.h:34
Id for retrieving the initial water saturation.
Definition: xfemHydroMechanicalMaterial.h:364
Id for retrieving the thermal conductivity of the non-wetting fluid accessor.
Definition: xfemHydroMechanicalMaterial.h:378
The number of property ids above.
Definition: xfemMaterial.h:183
virtual double nonWettingBulkModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the solid bulk mudulus.
Definition: xfemHydroMechanicalMaterial.h:96
virtual double leakoffTop(const GmElement *e, const GmVector *coord, int ip) const
Returns the leakoff coefficient at the top.
Definition: xfemHydroMechanicalMaterial.h:129
Id for retrieving the thermal conductivity of the wetting fluid accessor.
Definition: xfemHydroMechanicalMaterial.h:377
virtual double cubicLaw(const GmElement *e, const GmVector *coord, int ip, double wn, bool cubiclaw) const
Returns the hydraulic conductivity according to the cubic Law.
Definition: xfemHydroMechanicalMaterial.cpp:136
GmpFemPhysicsCommonMaterial * _hydroMaterial
Hydraulic material.
Definition: xfemHydroMechanicalMaterial.h:389
virtual double fluidViscosity(const GmElement *e, const GmVector *coord, int ip) const
Returns the dynamic fluid viscosity.
Definition: xfemHydroMechanicalMaterial.h:109
GmpFemPhysicsCommonMaterial * _mechanoMaterial
Mechanical material. Ps: The mechanical plugin does not have a base class common to all materials.
Definition: xfemHydroMechanicalMaterial.h:390
Id for retrieving the Specific heat capacity of the wetting fluid accessor.
Definition: xfemHydroMechanicalMaterial.h:374
virtual double cubicLawMP(const GmElement *e, const GmVector *coord, int ip, double wn, bool cubiclaw) const
Returns the hydraulic conductivity according to the cubic Law.
Definition: xfemHydroMechanicalMaterial.cpp:167
Id for retrieving the thermal expansion coefficient of the solid accessor.
Definition: xfemHydroMechanicalMaterial.h:382
Id for retrieving the Specific weight of the non-wetting fluid accessor.
Definition: xfemHydroMechanicalMaterial.h:373
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: xfemHydroMechanicalMaterial.h:58
arma::vec GmVector
Id for retrieving the solid bulk's Modulus accessor.
Definition: xfemHydroMechanicalMaterial.h:359
arma::mat GmMatrix
Id for retrieving the dynamic non-wetting fluid viscosity.
Definition: xfemHydroMechanicalMaterial.h:367
Id for retrieving the leakoff coefficient at the bottom.
Definition: xfemHydroMechanicalMaterial.h:363
virtual double leakoffBottom(const GmElement *e, const GmVector *coord, int ip) const
Returns the leakoff coefficient at the Bottom.
Definition: xfemHydroMechanicalMaterial.h:141
Id for retrieving the Specific heat capacity of the non-wetting fluid accessor.
Definition: xfemHydroMechanicalMaterial.h:375