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.
qfluid_3d.h
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: Author Julio Marti
11 //
12 
13 
14 //#define FIRST
15 
16 // System includes
17 
18 // External includes
19 
20 
21 #if !defined(KRATOS_FLUID_3Dp_GLS_H_INCLUDED )
22 #define KRATOS_FLUID_3Dp_GLS_H_INCLUDED
23 
24 
25 
26 // System includes
27 
28 
29 // External includes
30 #include "boost/smart_ptr.hpp"
31 
32 
33 // Project includes
34 #include "includes/define.h"
35 #include "includes/element.h"
37 
38 
39 namespace Kratos
40 {
41 
44 
48 
52 
56 
60 
62 
64  class QFluid3D
65  : public Element
66  {
67  public:
70 
73 
77 
79  QFluid3D(IndexType NewId, GeometryType::Pointer pGeometry);
80  QFluid3D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
81 
83  virtual ~QFluid3D() override;
84 
85 
89 
90 
94 
95  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
96 
97  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
98 
99  void CalculateRightHandSide(VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
100  //virtual void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix, ProcessInfo& rCurrentProcessInfo) override;
101 
102  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
103 
104  void GetDofList(DofsVectorType& ElementalDofList,const ProcessInfo& CurrentProcessInfo) const override;
105 
106  void InitializeSolutionStep(const ProcessInfo& CurrentProcessInfo) override;
107 
111 
112 
116 
117 
121 
123  // virtual String Info() const;
124 
126  // virtual void PrintInfo(std::ostream& rOStream) const;
127 
129  // virtual void PrintData(std::ostream& rOStream) const;
130 
131 
135 
136 
138 
139  protected:
142 
143 
147 
148 
152 
153 
157 
158 
162 
163 
167 
168 
172 
173 
175 
176  private:
179  static BoundedMatrix<double,4,4> msaux_matrix;
180  static BoundedMatrix<double,4,4> msMassFactors;
181  static BoundedMatrix<double,4,3> msDN_DX; //cartesian coords
182  static array_1d<double,4> msN; //dimension = number of nodes
183  static array_1d<double,3> ms_aux; //dimesion coincides with space dimension
184  static array_1d<double,3> ms_vel_gauss; //dimesion coincides with space dimension
185  static array_1d<double,4> ms_temp_vec_np; //dimension = number of nodes
186  static array_1d<double,4> ms_u_DN;
187 
188  static void InitializeAuxiliaries()
189  {
190  msMassFactors = ZeroMatrix(4,4);
191  msMassFactors(0,0) = 0.25;
192  msMassFactors(1,1) = 0.25;
193  msMassFactors(2,2) = 0.25;
194  msMassFactors(3,3) = 0.25;
195  }
196 
200 
201 
205 
206  friend class Serializer;
207 
208  QFluid3D() {}
209 
210 
214  void Stage1(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo);
215  void Stage2(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo);
216 
217  inline double CalculateH(double Volume);
218 
219  void CalculateViscousMatrix(MatrixType& K, const BoundedMatrix<double,4,3>& DN_DX, const double& nu,const double& dt );
220 
221  inline void ExpandAndAddReducedMatrix(MatrixType& Destination, BoundedMatrix<double,4,4>& ReducedMatrix, const unsigned int dimension);
225 
226 
230 
231 
235 
236 
240 
242  //QFluid3DCoupled& operator=(const QFluid3DCoupled& rOther);
243 
245  //QFluid3DCoupled(const QFluid3DCoupled& rOther);
246 
247 
249 
250  }; // Class QFluid3DCoupled
251 
253 
256 
257 
261 
262 
264  /* inline std::istream& operator >> (std::istream& rIStream,
265  QFluid3DCoupled& rThis);
266  */
268  /* inline std::ostream& operator << (std::ostream& rOStream,
269  const QFluid3DCoupled& rThis)
270  {
271  rThis.PrintInfo(rOStream);
272  rOStream << std::endl;
273  rThis.PrintData(rOStream);
274 
275  return rOStream;
276  }*/
278 
279 } // namespace Kratos.
280 
281 #endif // KRATOS_FLUID_3D_COUPLED_H_INCLUDED defined
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
Matrix MatrixType
Definition: element.h:90
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
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
Short class definition.
Definition: qfluid_3d.h:66
virtual ~QFluid3D() override
Destructor.
Definition: qfluid_3d.cpp:50
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: qfluid_3d.cpp:43
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: qfluid_3d.cpp:74
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: qfluid_3d.cpp:55
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(QFluid3D)
Counted pointer of QFluid3DCoupled.
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Definition: qfluid_3d.cpp:703
void InitializeSolutionStep(const ProcessInfo &CurrentProcessInfo) override
Definition: qfluid_3d.cpp:362
void GetDofList(DofsVectorType &ElementalDofList, const ProcessInfo &CurrentProcessInfo) const override
Definition: qfluid_3d.cpp:732
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
dt
Definition: DEM_benchmarks.py:173
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
nu
Definition: isotropic_damage_automatic_differentiation.py:135
K
Definition: sensitivityMatrix.py:73