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_2d.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_2Dp_GLS_H_INCLUDED )
22 #define KRATOS_FLUID_2Dp_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 #include "includes/serializer.h"
38 
39 
40 namespace Kratos
41 {
42 
45 
49 
53 
57 
61 
63 
77  class QFluid2D
78  : public Element
79  {
80  public:
83 
86 
90 
92  QFluid2D(IndexType NewId, GeometryType::Pointer pGeometry);
93  QFluid2D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
94 
96  virtual ~QFluid2D() override;
97 
101 
102 
106 
107  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
108 
109  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
110 
111  void CalculateRightHandSide(VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
112 
113  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
114 
115  void GetDofList(DofsVectorType& ElementalDofList, const ProcessInfo& CurrentProcessInfo) const override;
116 
117  void InitializeSolutionStep(const ProcessInfo& CurrentProcessInfo) override;
118 
119  //void Calculate(const Variable<double>& rVariable, double& Output, const ProcessInfo& rCurrentProcessInfo);
120  //void CalculateViscousMatrix(MatrixType& K, const BoundedMatrix<double,3,2>& DN_DX, const double& nu);
121  void CalculateViscousMatrix(MatrixType& K , const BoundedMatrix<double,3,2>& DN_DX, const double& nu, const double& deltat, const double& bulk); //, const double& k);
122 
123  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
124 
128 
129 
133 
134 
138 
140 
141  virtual std::string Info() const override
142  {
143  return "QFluid2D #";
144  }
145 
147 
148  virtual void PrintInfo(std::ostream& rOStream) const override
149  {
150  rOStream << Info() << Id();
151  }
152 
154  // virtual void PrintData(std::ostream& rOStream) const;
155 
156 
160 
161 
163 
164  protected:
167 
168 
172 
173 
177 
178 
182 
183 
187 
188 
192 
193 
197 
198 
200 
201  private:
204 
208  IntegrationMethod mThisIntegrationMethod;
209  std::vector< Matrix > mInvJ0;
210  Vector mDetJ0;
211 
212 
216  void Stage1(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo);//, unsigned int ComponentIndex);
217  void Stage2(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo);
218  // inline double CalculateTau(BoundedMatrix<double, 3,2 > & DN_DX, array_1d<double, 2 > & vel_gauss, const double h, const double nu, const double norm_u, const ProcessInfo& CurrentProcessInfo);
219  double ComputeSmagorinskyViscosity(const BoundedMatrix<double, 3, 2 > & DN_DX,
220  const double& h,
221  const double& C,
222  const double nu
223  );
224 
228 
229 
233 
234 
238 
242 
243  friend class Serializer;
244 
245  // A private default constructor necessary for serialization
246 
247  QFluid2D() : Element()
248  {
249  }
250 
251  virtual void save(Serializer& rSerializer) const override
252  {
254  }
255 
256  virtual void load(Serializer& rSerializer) override
257  {
259  }
260 
264 
266  //QFluid2D& operator=(const QFluid2D& rOther);
267 
269  //QFluid2D(const QFluid2D& rOther);
270 
271 
273 
274  }; // Class QFluid2D
275 
277 
280 
281 
285 
286 
288  /* inline std::istream& operator >> (std::istream& rIStream,
289  QFluid2D& rThis);
290  */
292  /* inline std::ostream& operator << (std::ostream& rOStream,
293  const QFluid2D& rThis)
294  {
295  rThis.PrintInfo(rOStream);
296  rOStream << std::endl;
297  rThis.PrintData(rOStream);
298 
299  return rOStream;
300  }*/
302 
303 } // namespace Kratos.
304 
305 #endif // KRATOS_FLUID_2D_H_INCLUDED defined
Base class for all Elements.
Definition: element.h:60
Element(IndexType NewId=0)
Definition: element.h:121
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
IntegrationMethod
Definition: geometry_data.h:76
IndexType Id() const
Definition: indexed_object.h:107
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
This element implements a Multi-stage element (2D case) to be used in conjuntion with.
Definition: qfluid_2d.h:79
void GetDofList(DofsVectorType &ElementalDofList, const ProcessInfo &CurrentProcessInfo) const override
Definition: qfluid_2d.cpp:868
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: qfluid_2d.cpp:284
void InitializeSolutionStep(const ProcessInfo &CurrentProcessInfo) override
Definition: qfluid_2d.cpp:482
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: qfluid_2d.cpp:57
void CalculateViscousMatrix(MatrixType &K, const BoundedMatrix< double, 3, 2 > &DN_DX, const double &nu, const double &deltat, const double &bulk)
Definition: qfluid_2d.cpp:932
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Definition: qfluid_2d.cpp:840
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: qfluid_2d.cpp:987
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(QFluid2D)
Counted pointer of QFluid2D.
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: qfluid_2d.h:148
friend class Serializer
Definition: qfluid_2d.h:243
virtual ~QFluid2D() override
Destructor.
Definition: qfluid_2d.cpp:52
virtual std::string Info() const override
Turn back information as a string.
Definition: qfluid_2d.h:141
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: qfluid_2d.cpp:44
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
h
Definition: generate_droplet_dynamics.py:91
int C
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:27
nu
Definition: isotropic_damage_automatic_differentiation.py:135
def load(f)
Definition: ode_solve.py:307
K
Definition: sensitivityMatrix.py:73