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.
weakly_compressible_navier_stokes.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 author: Ruben Zorrilla
11 // Jordi Cotela
12 //
13 
14 #ifndef KRATOS_WEAKLY_COMPRESSIBLE_NAVIER_STOKES_H
15 #define KRATOS_WEAKLY_COMPRESSIBLE_NAVIER_STOKES_H
16 
17 // System includes
18 
19 
20 // External indludes
21 
22 
23 // Project includes
24 #include "geometries/geometry.h"
25 #include "includes/cfd_variables.h"
26 #include "includes/define.h"
27 #include "includes/element.h"
28 #include "includes/serializer.h"
29 
30 // Application includes
34 
35 namespace Kratos
36 {
37 
40 
43 
47 
51 
55 
59 
60 template< class TElementData >
61 class WeaklyCompressibleNavierStokes : public FluidElement<TElementData>
62 {
63 public:
66 
69 
71  typedef Node NodeType;
72 
75 
78 
80  typedef Vector VectorType;
81 
83  typedef Matrix MatrixType;
84 
85  typedef std::size_t IndexType;
86 
87  typedef std::size_t SizeType;
88 
89  typedef std::vector<std::size_t> EquationIdVectorType;
90 
91  typedef std::vector< Dof<double>::Pointer > DofsVectorType;
92 
94 
97 
100 
103 
104  constexpr static unsigned int Dim = FluidElement<TElementData>::Dim;
105  constexpr static unsigned int NumNodes = FluidElement<TElementData>::NumNodes;
106  constexpr static unsigned int BlockSize = FluidElement<TElementData>::BlockSize;
107  constexpr static unsigned int LocalSize = FluidElement<TElementData>::LocalSize;
108 
109  constexpr static unsigned int StrainSize = (Dim-1)*3;
110 
114 
115  //Constructors.
116 
118 
122 
124 
129  IndexType NewId,
130  const NodesArrayType& ThisNodes);
131 
133 
138  IndexType NewId,
139  GeometryType::Pointer pGeometry);
140 
142 
148  IndexType NewId,
149  GeometryType::Pointer pGeometry,
150  Properties::Pointer pProperties);
151 
154 
157 
161 
164 
168 
170 
177  Element::Pointer Create(
178  IndexType NewId,
179  NodesArrayType const& ThisNodes,
180  Properties::Pointer pProperties) const override;
181 
183 
190  Element::Pointer Create(
191  IndexType NewId,
192  GeometryType::Pointer pGeom,
193  Properties::Pointer pProperties) const override;
194 
198 
199  int Check(const ProcessInfo &rCurrentProcessInfo) const override;
200 
204 
205  const Parameters GetSpecifications() const override;
206 
208  std::string Info() const override;
209 
210 
212  void PrintInfo(std::ostream& rOStream) const override;
213 
215 protected:
218 
219 
223 
224 
228 
230  TElementData& rData,
231  MatrixType& rLHS,
232  VectorType& rRHS) override;
233 
235  TElementData& rData,
236  MatrixType& rLHS) override;
237 
239  TElementData& rData,
240  VectorType& rRHS) override;
241 
242  void AddBoundaryTraction(
243  TElementData& rData,
244  const Vector& rUnitNormal,
245  MatrixType& rLHS,
246  VectorType& rRHS) override;
247 
249  TElementData& rData,
250  MatrixType& rLHS);
251 
253  TElementData& rData,
254  VectorType& rRHS);
255 
259 
260 
264 
265 
269 
270 
272 private:
275 
279 
283 
284  friend class Serializer;
285 
286  void save(Serializer& rSerializer) const override;
287 
288  void load(Serializer& rSerializer) override;
289 
293 
294 
298 
299 
303 
304 
308 
309 
313 
314 
316 }; // Class WeaklyCompressibleNavierStokes
317 
319 
322 
323 
327 
329 template< class TElementData >
330 inline std::istream& operator >>(
331  std::istream& rIStream,
333 {
334  return rIStream;
335 }
336 
338 template< class TElementData >
339 inline std::ostream& operator <<(
340  std::ostream& rOStream,
342 {
343  rThis.PrintInfo(rOStream);
344  rOStream << std::endl;
345  rThis.PrintData(rOStream);
346 
347  return rOStream;
348 }
349 
352 
353 } // namespace Kratos.
354 
355 #endif // KRATOS_WEAKLY_COMPRESSIBLE_NAVIER_STOKES_H
std::size_t IndexType
Definition: flags.h:74
Large Displacement Lagrangian Element for 3D and 2D geometries. (base class)
Definition: fluid_element.h:61
MatrixRow< Matrix > ShapeFunctionsType
Type for shape function values container.
Definition: fluid_element.h:95
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: fluid_element.hpp:584
Geometry base class.
Definition: geometry.h:71
This object defines an indexed object.
Definition: indexed_object.h:54
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Definition: weakly_compressible_navier_stokes.h:62
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: weakly_compressible_navier_stokes.h:91
std::vector< std::size_t > EquationIdVectorType
Definition: weakly_compressible_navier_stokes.h:89
Node NodeType
Node type (default is: Node)
Definition: weakly_compressible_navier_stokes.h:71
WeaklyCompressibleNavierStokes(IndexType NewId=0)
Default constuctor.
Definition: weakly_compressible_navier_stokes.cpp:33
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: weakly_compressible_navier_stokes.cpp:149
std::size_t IndexType
Definition: weakly_compressible_navier_stokes.h:85
std::string Info() const override
Turn back information as a string.
Definition: weakly_compressible_navier_stokes.cpp:141
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, Properties::Pointer pProperties) const override
Create a new element of this type.
Definition: weakly_compressible_navier_stokes.cpp:62
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition of nodes container type, redefined from GeometryType.
Definition: weakly_compressible_navier_stokes.h:77
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(WeaklyCompressibleNavierStokes)
Pointer definition of WeaklyCompressibleNavierStokes.
constexpr static unsigned int LocalSize
Definition: weakly_compressible_navier_stokes.h:107
WeaklyCompressibleNavierStokes & operator=(WeaklyCompressibleNavierStokes const &rOther)=delete
Assignment operator.
void ComputeGaussPointLHSContribution(TElementData &rData, MatrixType &rLHS)
Matrix MatrixType
Matrix type for local contributions to the linear system.
Definition: weakly_compressible_navier_stokes.h:83
void AddTimeIntegratedLHS(TElementData &rData, MatrixType &rLHS) override
Definition: weakly_compressible_navier_stokes.cpp:173
WeaklyCompressibleNavierStokes(WeaklyCompressibleNavierStokes const &rOther)=delete
Copy constructor.
constexpr static unsigned int Dim
Definition: weakly_compressible_navier_stokes.h:104
Vector VectorType
Vector type for local contributions to the linear system.
Definition: weakly_compressible_navier_stokes.h:80
constexpr static unsigned int StrainSize
Definition: weakly_compressible_navier_stokes.h:109
const Parameters GetSpecifications() const override
This method provides the specifications/requirements of the element.
Definition: weakly_compressible_navier_stokes.cpp:101
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: weakly_compressible_navier_stokes.cpp:84
constexpr static unsigned int NumNodes
Definition: weakly_compressible_navier_stokes.h:105
FluidElement< TElementData >::ShapeFunctionDerivativesType ShapeFunctionDerivativesType
Type for a matrix containing the shape function gradients.
Definition: weakly_compressible_navier_stokes.h:99
std::size_t SizeType
Definition: weakly_compressible_navier_stokes.h:87
Geometry< NodeType > GeometryType
Geometry type (using with given NodeType)
Definition: weakly_compressible_navier_stokes.h:74
void AddTimeIntegratedSystem(TElementData &rData, MatrixType &rLHS, VectorType &rRHS) override
Definition: weakly_compressible_navier_stokes.cpp:163
void ComputeGaussPointRHSContribution(TElementData &rData, VectorType &rRHS)
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: weakly_compressible_navier_stokes.h:93
constexpr static unsigned int BlockSize
Definition: weakly_compressible_navier_stokes.h:106
FluidElement< TElementData >::ShapeFunctionsType ShapeFunctionsType
Type for shape function values container.
Definition: weakly_compressible_navier_stokes.h:96
FluidElement< TElementData >::ShapeFunctionDerivativesArrayType ShapeFunctionDerivativesArrayType
Type for an array of shape function gradient matrices.
Definition: weakly_compressible_navier_stokes.h:102
void AddTimeIntegratedRHS(TElementData &rData, VectorType &rRHS) override
Definition: weakly_compressible_navier_stokes.cpp:181
virtual ~WeaklyCompressibleNavierStokes()
Destructor.
Definition: weakly_compressible_navier_stokes.cpp:56
void AddBoundaryTraction(TElementData &rData, const Vector &rUnitNormal, MatrixType &rLHS, VectorType &rRHS) override
Adds the boundary traction component along a cut plane for embedded formulations. This method adds th...
Definition: weakly_compressible_navier_stokes.cpp:189
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307