ThermoFemPhysics
The GeMA Thermo FEM Physics Plugin
Loading...
Searching...
No Matches
gmpThermalFlow.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_THERMALFLOW_H_
25#define _GEMA_PLUGIN_THERMALFLOW_H_
26
27#include "gmpThermoFemPhysics.h"
28#include <gmTrace.h>
29#include <math.h>
30
31
33template <class T> class GmpThermalFlow : public T
34{
35public:
36 GmpThermalFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description, const GmLogCategory& logger)
37 : T(pluginType, simulation, id, description, logger)
38 {}
39
40protected:
42 virtual double axisymmetricFactor(const GmElement* e, const GmMatrix& X, const GmVector& N) const { Q_UNUSED(e); Q_UNUSED(X); Q_UNUSED(N); return 1.0; }
43
45 //virtual double fillBtMatrix(const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bp)
46 //{
47 // S_TRACE();
48 // Q_UNSED(N);
49 // assert(shape);
50 // double detJ = 0;
51 // if (issoParametric())
52 // {
53 // detJ = shape->shapeCartesianPartialsFromCoord(ip, X, B, true);
54 // }
55 // else
56 // {
57 // detJ = shape->shapeCartesianPartialsFromJacobian(ncoord, J, Bp, true);
58 // }
59
60 // return detJ;
61 //}
62
63};
64
66template <class T> class GmpThermalAxFlow: public T
67{
68public:
69 GmpThermalAxFlow(const char* pluginType, GmSimulationData* simulation, QString id, QString description, const GmLogCategory& logger)
70 : T(pluginType, simulation, id, description, logger)
71 {}
72
73protected:
75 virtual bool isAxisymmetric() { return true; }
76
77 // Comments on the base class
78 virtual double axisymmetricFactor(const GmElement* e, const GmMatrix& X, const GmVector& N) const
79 {
80 S_TRACE();
81 int n = e->numNodes();
82 // evaluate radio at integration points
83 double rGauss = 0.0;
84 for (int j = 0; j < n; ++j)
85 rGauss += N(j)*X(j, 0);
86
87 return 2 * arma::datum::pi * rGauss;
88 }
89};
90
91#endif
virtual int numNodes() const=0
Hydraulic Axissymetric.
Definition gmpThermalFlow.h:67
virtual bool isAxisymmetric()
Returns TRUE only for axisymmetric models.
Definition gmpThermalFlow.h:75
Hydraulic 2D & 3D for Quad, Tri, Hex and Tet.
Definition gmpThermalFlow.h:34
virtual double axisymmetricFactor(const GmElement *e, const GmMatrix &X, const GmVector &N) const
Returns the factor that should be applied when using axis symetric elements. 1.0 for other etypes.
Definition gmpThermalFlow.h:42
arma::mat GmMatrix
#define S_TRACE()
arma::vec GmVector
Declaration of the GmpThermoFemPhysics classes.