KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
steady_convection_diffusion_FIC_element.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Albert Puigferrat Perez
11 // Ignasi de Pouplana
12 //
13 
14 #if !defined(KRATOS_STEADY_CONVECTION_DIFFUSION_FIC_ELEMENT_H_INCLUDED )
15 #define KRATOS_STEADY_CONVECTION_DIFFUSION_FIC_ELEMENT_H_INCLUDED
16 
17 // Project includes
18 #include <cmath>
19 #include "containers/array_1d.h"
20 #include "includes/define.h"
21 #include "includes/element.h"
22 #include "includes/serializer.h"
23 #include "geometries/geometry.h"
24 #include "utilities/math_utils.h"
26 #include "custom_utilities/element_utilities.hpp"
28 
29 // Application includes
31 
32 namespace Kratos
33 {
34 
35 template< unsigned int TDim, unsigned int TNumNodes >
36 class KRATOS_API(FLUID_TRANSPORT_APPLICATION) SteadyConvectionDiffusionFICElement : public Element
37 {
38 
39 public:
40 
42 
43  typedef std::size_t IndexType;
45  typedef Node NodeType;
48  typedef Vector VectorType;
49  typedef Matrix MatrixType;
50 
51 
53 
56 
58  SteadyConvectionDiffusionFICElement(IndexType NewId, const NodesArrayType& ThisNodes) : Element(NewId, ThisNodes) {}
59 
61  SteadyConvectionDiffusionFICElement(IndexType NewId, GeometryType::Pointer pGeometry) : Element(NewId, pGeometry) {}
62 
64  SteadyConvectionDiffusionFICElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) : Element( NewId, pGeometry, pProperties ) {}
65 
68 
70 
71  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
72 
73  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override;
74 
75  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
76 
78 
79  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
80 
81  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
82 
84 
89  GeometryData::IntegrationMethod GetIntegrationMethod() const override;
90 
91  void GetDofList( DofsVectorType& rElementalDofList, const ProcessInfo& rCurrentProcessInfo ) const override;
92 
94 
95  virtual void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,VectorType& rRightHandSideVector,const ProcessInfo& rCurrentProcessInfo ) override;
96 
97  void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix,const ProcessInfo& rCurrentProcessInfo ) override;
98 
99  void CalculateRightHandSide(VectorType& rRightHandSideVector,const ProcessInfo& rCurrentProcessInfo ) override;
100 
101  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
102 
103  void CalculateOnIntegrationPoints(const Variable<double>& rVariable, std::vector<double>& rValues, const ProcessInfo& rCurrentProcessInfo) override;
104 
105  void CalculateOnIntegrationPoints(const Variable<array_1d<double,3>>& rVariable, std::vector<array_1d<double,3>>& rValues, const ProcessInfo& rCurrentProcessInfo) override;
106 
108 
109 protected:
110 
112  {
114  double rho_dot_c;
115  double Peclet;
116  double AlphaVBar;
117  double AlphaV;
118  double AlphaR;
119  double lv;
120  double lsc;
121  double OmegaV;
122  double OmegaVt;
123  double OmegaVBarra;
124  double SigmaV;
125  double SigmaVt;
126  double SigmaVBarra;
127  double LambdaV;
128  double XiV;
129  double Residual;
130  double NormAux2;
131  double Beta;
132  double NormGradPhi;
133  double absorption;
134  double DifSC;
135  double AuxDiffusion;
138  double LowTolerance;
140  double Courant;
141 
142  //Transient variables
145 
147 
154 
161 
163 
165 
168  //Contains components of nodal derivatives
173 
174  // array_1d<double,TNumNodes> Aux1;
175  // array_1d<double,TNumNodes> Aux2;
176 
177 
180  double QSource;
185 
186  //Auxiliary
187  //TODO: Some can be defined in situ
196 
197  };
198 
200 
202 
203  void SaveGPGradPhi(Matrix& rGradPhiContainer, const array_1d<double,TDim>& GradPhi, const unsigned int& GPoint);
204 
205  void ExtrapolateGPValues(const Matrix& GradPhiContainer);
206 
207 
208  virtual void CalculateAll( MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& CurrentProcessInfo );
209 
210  virtual void InitializeElementVariables(ElementVariables& rVariables, const GeometryType& Geom, const PropertiesType& Prop, const ProcessInfo& CurrentProcessInfo);
211 
213 
215 
216  virtual void CalculateDiffusivityVariables(ElementVariables& rVariables, const PropertiesType& Prop, const ProcessInfo& CurrentProcessInfo);
217 
218  virtual void CalculateHVector(ElementVariables& rVariables, const PropertiesType& Prop, const ProcessInfo& CurrentProcessInfo);
219 
220  void CalculatePeclet(ElementVariables& rVariables, const Geometry<Node >& rGeom, const double& NormVel, const ProcessInfo& CurrentProcessInfo,
221  const PropertiesType& Prop);
222 
224 
225  void CalculateFICBeta(ElementVariables& rVariables);
226 
227 
228  virtual void CalculateAndAddLHS(MatrixType& rLeftHandSideMatrix, ElementVariables& rVariables);
229 
230  virtual void CalculateAndAddAdvectionMatrix(MatrixType& rLeftHandSideMatrix, ElementVariables& rVariables);
231 
232  void CalculateAndAddDiffusiveMatrix(MatrixType& rLeftHandSideMatrix, ElementVariables& rVariables);
233 
234  void CalculateAndAddAbsorptionMatrix(MatrixType& rLeftHandSideMatrix, ElementVariables& rVariables);
235 
236  void CalculateAndAddFICMatrix(MatrixType& rLeftHandSideMatrix, ElementVariables& rVariables);
237 
238 
239 
240  virtual void CalculateAndAddRHS(VectorType& rRightHandSideVector, ElementVariables& rVariables);
241 
242  virtual void CalculateAndAddRHSAdvection(VectorType& rRightHandSideVector, ElementVariables& rVariables);
243 
244  void CalculateAndAddRHSDiffusive(VectorType& rRightHandSideVector, ElementVariables& rVariables);
245 
246  void CalculateAndAddRHSAbsorption(VectorType& rRightHandSideVector, ElementVariables& rVariables);
247 
248  void CalculateAndAddRHSFIC(VectorType& rRightHandSideVector, ElementVariables& rVariables);
249 
250  virtual void CalculateAndAddSourceForce(VectorType& rRightHandSideVector, ElementVariables& rVariables);
251 
252 
253  void CalculateIntegrationCoefficient(double& rIntegrationCoefficient, const double& detJ, const double& weight);
254 
255 
256  virtual void CalculateRHS( VectorType& rRightHandSideVector, const ProcessInfo& CurrentProcessInfo );
257 
258 
260 
261 private:
262 
264 
266 
268 
269  friend class Serializer;
270 
271  void save(Serializer& rSerializer) const override
272  {
274  }
275 
276  void load(Serializer& rSerializer) override
277  {
279  }
280 
282  SteadyConvectionDiffusionFICElement & operator=(SteadyConvectionDiffusionFICElement const& rOther);
283 
285  SteadyConvectionDiffusionFICElement(SteadyConvectionDiffusionFICElement const& rOther);
286 
287 }; // Class SteadyConvectionDiffusionFICElement
288 
289 } // namespace Kratos
290 
291 #endif // KRATOS_STEADY_CONVECTION_DIFFUSION_FIC_ELEMENT_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Elements.
Definition: element.h:60
std::size_t IndexType
Definition: flags.h:74
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
This class defines the node.
Definition: node.h:65
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Definition: steady_convection_diffusion_FIC_element.hpp:37
void ExtrapolateGPValues(const Matrix &GradPhiContainer)
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition: steady_convection_diffusion_FIC_element.hpp:47
void CalculateNormalsAngle(ElementVariables &rVariables)
Geometry< NodeType > GeometryType
Definition: steady_convection_diffusion_FIC_element.hpp:46
void CalculateBoundaryLv(ElementVariables &rVariables)
SteadyConvectionDiffusionFICElement(IndexType NewId=0)
Default Constructor.
Definition: steady_convection_diffusion_FIC_element.hpp:55
Vector VectorType
Definition: steady_convection_diffusion_FIC_element.hpp:48
void CalculateDifTerm(ElementVariables &rVariables)
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(SteadyConvectionDiffusionFICElement)
virtual ~SteadyConvectionDiffusionFICElement()
Destructor.
Definition: steady_convection_diffusion_FIC_element.hpp:67
SteadyConvectionDiffusionFICElement(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: steady_convection_diffusion_FIC_element.hpp:61
std::size_t IndexType
Definition: steady_convection_diffusion_FIC_element.hpp:43
Matrix MatrixType
Definition: steady_convection_diffusion_FIC_element.hpp:49
Node NodeType
Definition: steady_convection_diffusion_FIC_element.hpp:45
SteadyConvectionDiffusionFICElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor using Properties.
Definition: steady_convection_diffusion_FIC_element.hpp:64
SteadyConvectionDiffusionFICElement(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: steady_convection_diffusion_FIC_element.hpp:58
Properties PropertiesType
Definition: steady_convection_diffusion_FIC_element.hpp:44
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307
Definition: steady_convection_diffusion_FIC_element.hpp:112
double AuxDiffusion
Definition: steady_convection_diffusion_FIC_element.hpp:135
BoundedMatrix< double, TNumNodes, TNumNodes > FICMatrixAuxTwo
Definition: steady_convection_diffusion_FIC_element.hpp:195
array_1d< double, TDim > GradPhi
Definition: steady_convection_diffusion_FIC_element.hpp:152
double SigmaV
Definition: steady_convection_diffusion_FIC_element.hpp:124
double NormAux2
Definition: steady_convection_diffusion_FIC_element.hpp:130
array_1d< double, TDim > FICVectorAuxOne
Definition: steady_convection_diffusion_FIC_element.hpp:153
array_1d< double, TDim > HvVector
Definition: steady_convection_diffusion_FIC_element.hpp:149
BoundedMatrix< double, TDim, TNumNodes > FICMatrixAuxOne
Definition: steady_convection_diffusion_FIC_element.hpp:192
double XiV
Definition: steady_convection_diffusion_FIC_element.hpp:128
array_1d< double, TNumNodes > N
Definition: steady_convection_diffusion_FIC_element.hpp:181
int IterationNumber
Definition: steady_convection_diffusion_FIC_element.hpp:146
double LambdaV
Definition: steady_convection_diffusion_FIC_element.hpp:127
array_1d< double, TDim > HrVector
Definition: steady_convection_diffusion_FIC_element.hpp:150
double AlphaVBar
Definition: steady_convection_diffusion_FIC_element.hpp:116
double TransientResidual
Definition: steady_convection_diffusion_FIC_element.hpp:144
BoundedMatrix< double, TDim, TDim > DifMatrixK
Definition: steady_convection_diffusion_FIC_element.hpp:156
double Peclet
Definition: steady_convection_diffusion_FIC_element.hpp:115
BoundedMatrix< double, TDim, TDim > DifMatrix
Definition: steady_convection_diffusion_FIC_element.hpp:155
double IntegrationCoefficient
Variables computed at each GP.
Definition: steady_convection_diffusion_FIC_element.hpp:179
double OmegaVBarra
Definition: steady_convection_diffusion_FIC_element.hpp:123
BoundedMatrix< double, TDim, TDim > DifMatrixR
Definition: steady_convection_diffusion_FIC_element.hpp:159
array_1d< array_1d< double, TNumNodes >, TDim > NodalPhiGradient
Definition: steady_convection_diffusion_FIC_element.hpp:169
double Courant
Definition: steady_convection_diffusion_FIC_element.hpp:140
BoundedMatrix< double, TNumNodes, TNumNodes > MatrixAux
Definition: steady_convection_diffusion_FIC_element.hpp:191
BoundedMatrix< double, TDim, TDim > DifMatrixS
Definition: steady_convection_diffusion_FIC_element.hpp:158
BoundedMatrix< double, TNumNodes, TDim > DifMatrixAux
Definition: steady_convection_diffusion_FIC_element.hpp:190
array_1d< double, TNumNodes > NodalPhi
ProcessInfo variables.
Definition: steady_convection_diffusion_FIC_element.hpp:167
double CosinusGradPhi
Definition: steady_convection_diffusion_FIC_element.hpp:137
double OmegaV
Definition: steady_convection_diffusion_FIC_element.hpp:121
array_1d< array_1d< double, TDim >, TDim > SecondGradPhi
Definition: steady_convection_diffusion_FIC_element.hpp:170
double AlphaR
Definition: steady_convection_diffusion_FIC_element.hpp:118
double Beta
Definition: steady_convection_diffusion_FIC_element.hpp:131
BoundedMatrix< double, TNumNodes, TNumNodes > AbpMatrixAux
Definition: steady_convection_diffusion_FIC_element.hpp:189
BoundedMatrix< double, TDim, TDim > IdentityMatrix
Definition: steady_convection_diffusion_FIC_element.hpp:162
double DifSC
Definition: steady_convection_diffusion_FIC_element.hpp:134
BoundedMatrix< double, TDim, TDim > DifMatrixSC
Definition: steady_convection_diffusion_FIC_element.hpp:160
array_1d< double, TDim > HscVector
Definition: steady_convection_diffusion_FIC_element.hpp:151
double LowTolerance
Definition: steady_convection_diffusion_FIC_element.hpp:138
array_1d< double, TDim > VelInter
Definition: steady_convection_diffusion_FIC_element.hpp:182
double SigmaVt
Definition: steady_convection_diffusion_FIC_element.hpp:125
BoundedMatrix< double, TDim, TDim > DifMatrixV
Definition: steady_convection_diffusion_FIC_element.hpp:157
array_1d< double, TDim > HVector
Definition: steady_convection_diffusion_FIC_element.hpp:148
double HighTolerance
Definition: steady_convection_diffusion_FIC_element.hpp:139
array_1d< double, TDim > VelInterHat
Definition: steady_convection_diffusion_FIC_element.hpp:183
double lv
Definition: steady_convection_diffusion_FIC_element.hpp:119
double rho_dot_c
Properties variables.
Definition: steady_convection_diffusion_FIC_element.hpp:114
double AlphaV
Definition: steady_convection_diffusion_FIC_element.hpp:117
BoundedMatrix< double, TNumNodes, TNumNodes > DifMatrixAuxTwo
Definition: steady_convection_diffusion_FIC_element.hpp:194
double lsc
Definition: steady_convection_diffusion_FIC_element.hpp:120
double NormGradPhi
Definition: steady_convection_diffusion_FIC_element.hpp:132
double QSource
Definition: steady_convection_diffusion_FIC_element.hpp:180
double OmegaVt
Definition: steady_convection_diffusion_FIC_element.hpp:122
double CosinusNormals
Definition: steady_convection_diffusion_FIC_element.hpp:136
array_1d< double, TNumNodes > NodalQSource
Definition: steady_convection_diffusion_FIC_element.hpp:171
double SigmaVBarra
Definition: steady_convection_diffusion_FIC_element.hpp:126
BoundedMatrix< double, TNumNodes, TDim > GradNT
Definition: steady_convection_diffusion_FIC_element.hpp:184
BoundedMatrix< double, TNumNodes, TDim > AdvMatrixAux
Definition: steady_convection_diffusion_FIC_element.hpp:188
double TransientAbsorption
Definition: steady_convection_diffusion_FIC_element.hpp:143
double absorption
Definition: steady_convection_diffusion_FIC_element.hpp:133
BoundedMatrix< double, TNumNodes, TNumNodes > AdvMatrixAuxTwo
Definition: steady_convection_diffusion_FIC_element.hpp:193
double Residual
Definition: steady_convection_diffusion_FIC_element.hpp:129
array_1d< array_1d< double, 3 >, TNumNodes > NodalVel
Definition: steady_convection_diffusion_FIC_element.hpp:172