HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpHydraulicFlow.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
26#ifndef _GEMA_PLUGIN_HYDRAULICFLOW_H_
27#define _GEMA_PLUGIN_HYDRAULICFLOW_H_
28
29#include "gmpHydraulic.h"
30#include <gmTrace.h>
31#include <math.h>
32
33
35template <class T> class GmpHydraulicFlow : public T
36{
37public:
38 GmpHydraulicFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
39 const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger)
40 : T(pluginType, simulation, id, description, matFactory, logger)
41 {}
42
43protected:
44 // Comments on the base class
45 virtual double fillBpMatrix(const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bp)
46 {
47 S_TRACE();
48 Q_UNUSED(X); Q_UNUSED(N);
49
50 return shape->shapeCartesianPartialsFromJacobian(ncoord, J, Bp, true);
51 }
52};
53
55template <class T> class GmpHydraulicAxFlow : public T
56{
57public:
58 GmpHydraulicAxFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
59 const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger)
60 : T(pluginType, simulation, id, description, matFactory, logger)
61 {}
62
63protected:
65 virtual bool isAxisymmetric() { return true; }
66
67 // Comments on the base class
68 virtual double fillBpMatrix(const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bp)
69 {
70 S_TRACE();
71 Q_UNUSED(X); Q_UNUSED(N);
72 return shape->shapeCartesianPartialsFromJacobian(ncoord, J, Bp, true);
73 }
74
75 // Comments on the base class
76 virtual double axisymmetricFactor(const GmElement* e, const GmMatrix& X, const GmVector& N) const
77 {
78 S_TRACE();
79 int n = e->numNodes();
80 // evaluate radio at integration points
81 double rGauss = 0.0;
82 for (int j = 0; j < n; ++j)
83 rGauss += N(j)*X(j, 0);
84
85 return 2 * arma::datum::pi * rGauss;
86 }
87};
88
90template <class T> class GmpHydraulicBrinkman : public T
91{
92public:
93 GmpHydraulicBrinkman(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
94 const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger)
95 : T(pluginType, simulation, id, description, matFactory, logger)
96 {}
97
98protected:
99 // Comments on the base class
100 virtual double fillBpMatrix(const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bp)
101 {
102 S_TRACE();
103 Q_UNUSED(X); Q_UNUSED(N);
104
105 // fill the elemental shape cartesian partials
106 double detJ = shape->shapeCartesianPartialsFromJacobian(ncoord, J, Bp, true);
107
108 return detJ;
109 }
110};
111
112#endif
virtual int numNodes() const=0
virtual double shapeCartesianPartialsFromJacobian(const GmVector &ncoord, const GmMatrix &J, GmMatrix &dN, bool transposed=false) const
Hydraulic Axissymetric.
Definition gmpHydraulicFlow.h:56
virtual bool isAxisymmetric()
Returns TRUE only for axisymmetric models.
Definition gmpHydraulicFlow.h:65
Hydraulic 2D & 3D for Quad, Tri, Hex and Tet.
Definition gmpHydraulicFlow.h:91
Hydraulic 2D & 3D for Quad, Tri, Hex and Tet.
Definition gmpHydraulicFlow.h:36
arma::mat GmMatrix
#define S_TRACE()
arma::vec GmVector
Declaration of the gmpHydraulic classes.