HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpMaterialCubicLaw.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_MATERIAL_CUBICLAW_H_
25#define _GEMA_PLUGIN_HYDRAULIC_MATERIAL_CUBICLAW_H_
26
27#include <gmTrace.h>
28#include <assert.h>
29
31
32class GMP_HYDRAULIC_PHYSICS_API_EXPORT GmpMaterialCubicLaw : public GmpMaterialInterfaceFlow
33{
34protected:
37 {
38 //GAP_ID = GmpMaterialInterfaceFlow::NUM_PROPERTY_IDS, //!< Id for retrieving the parameter that controls the shape of the curve Sw x pc
39
40 // --- NO ADDING BELOW THIS LINE
42 };
43
44public:
45
47 GmpMaterialCubicLaw(int typeIndex, QString typeName, const GmLogCategory& logger)
48 : GmpMaterialInterfaceFlow(typeIndex, typeName, logger) {}
49
51 static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
52 {
53 Q_UNUSED(simulation);
54 return new GmpMaterialCubicLaw(typeIndex, typeName, logger);
55 }
56
57
60 virtual double cubicLaw(const GmElement* e, const GmVector* coord, int ip) const
61 {
62 S_TRACE();
63 assert(e);
64
65 double kl = 0.0;
66 double d_n = gaussAttrAc(AnOLD_GA_ID)->scalarValueAt(e, ip, coord);
67 double uf = fluidViscosity(e, coord, ip);
68
69 // computes the cubic law
70 if (uf > 0.0)
71 {
72 if (d_n > 0.0)
73 {
74 kl = pow(d_n, 3.0) / (12.0 * uf);
75 }
76
77 }
78 else
79 {
80 assert(uf != 0 && "Ufw Dynamic viscosity must be different to zero");
81 }
82
83 return kl;
84 }
85
90 virtual void hydraulicConstitutiveModel(const GmElement* e, GmVector& flowParam, const GmVector* coord, int ip) const
91 {
92 S_TRACE();
93 assert(e);
94 flowParam.fill(0.0);
95
96 //Compute the longitudinal conductivity according to cubic's law.
97 flowParam(0) = cubicLaw(e, coord, ip);
98 //computes the leakoff coefficients
99 flowParam(1) = leakoffTop(e, coord, ip);
100 flowParam(2) = leakoffBottom(e, coord, ip);
101 }
102
103};
104
105#endif
Definition gmpMaterialCubicLaw.h:33
virtual double cubicLaw(const GmElement *e, const GmVector *coord, int ip) const
Returns hydraulic conductivity, according to the cubic law.
Definition gmpMaterialCubicLaw.h:60
GmpMaterialCubicLaw(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition gmpMaterialCubicLaw.h:47
virtual void hydraulicConstitutiveModel(const GmElement *e, GmVector &flowParam, const GmVector *coord, int ip) const
Fills the hydraulic conductivity for longitudinal and normal fluid flow. The longitudinal conductivit...
Definition gmpMaterialCubicLaw.h:90
CubicLawPropIds
IDs for saturated material element properties.
Definition gmpMaterialCubicLaw.h:37
@ NUM_PROPERTY_IDS
The number of property ids above.
Definition gmpMaterialCubicLaw.h:41
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 gmpMaterialCubicLaw.h:51
Definition gmpMaterialInterfaceFlow.h:33
virtual double leakoffTop(const GmElement *e, const GmVector *coord, int ip) const
Returns the leakoff coefficient at the top.
Definition gmpMaterialInterfaceFlow.h:98
virtual double fluidViscosity(const GmElement *e, const GmVector *coord, int ip) const
Returns the dynamic fluid viscosity.
Definition gmpMaterialInterfaceFlow.h:78
virtual double leakoffBottom(const GmElement *e, const GmVector *coord, int ip) const
Returns the leakoff coefficient at the Bottom.
Definition gmpMaterialInterfaceFlow.h:110
#define S_TRACE()
arma::vec GmVector
Declaration of the GmpMaterialInterfaceFlow class.