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.
axisymmetric_navier_stokes_data.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: Ruben Zorrilla
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 
18 // External includes
19 
20 
21 // Project includes
22 
23 // Application includes
27 
28 namespace Kratos {
29 
32 
35 
36 template< size_t TDim, size_t TNumNodes >
37 class AxisymmetricNavierStokesData : public FluidElementData<TDim,TNumNodes, true>
38 {
39 public:
40 
43 
44 static_assert(TDim == 2, "AxisymmetricNavierStokesData can only be instantiated with TDim equal to 2.");
45 
50 
54 
60 
62 
63 double Density;
65 double DeltaTime; // Time increment
66 double DynamicTau; // Dynamic tau considered in ASGS stabilization coefficients
67 
68 double bdf0;
69 double bdf1;
70 double bdf2;
71 
72 // Auxiliary containers for the symbolically-generated matrices
73 BoundedMatrix<double,TNumNodes*(TDim+1),TNumNodes*(TDim+1)> lhs;
74 array_1d<double,TNumNodes*(TDim+1)> rhs;
75 
76 double ElementSize;
77 
81 
82 void Initialize(const Element& rElement, const ProcessInfo& rProcessInfo) override
83 {
84  // Base class Initialize manages constitutive law parameters
86 
87  const auto& r_geometry = rElement.GetGeometry();
88  this->FillFromHistoricalNodalData(Velocity, VELOCITY, r_geometry);
89  this->FillFromHistoricalNodalData(Velocity_OldStep1, VELOCITY, r_geometry,1);
90  this->FillFromHistoricalNodalData(Velocity_OldStep2, VELOCITY, r_geometry,2);
91  this->FillFromHistoricalNodalData(MeshVelocity, MESH_VELOCITY, r_geometry);
92  this->FillFromHistoricalNodalData(BodyForce, BODY_FORCE, r_geometry);
93  this->FillFromHistoricalNodalData(Pressure, PRESSURE, r_geometry);
94 
95  const auto& r_properties = rElement.GetProperties();
96  this->FillFromProperties(Density, DENSITY, r_properties);
97  this->FillFromProperties(DynamicViscosity, DYNAMIC_VISCOSITY, r_properties);
98 
99  this->FillFromProcessInfo(DeltaTime, DELTA_TIME, rProcessInfo);
100  this->FillFromProcessInfo(DynamicTau, DYNAMIC_TAU, rProcessInfo);
101 
102  const auto& r_BDF_vector = rProcessInfo[BDF_COEFFICIENTS];
103  bdf0 = r_BDF_vector[0];
104  bdf1 = r_BDF_vector[1];
105  bdf2 = r_BDF_vector[2];
106 
108 
109  noalias(lhs) = ZeroMatrix(TNumNodes*(TDim+1),TNumNodes*(TDim+1));
110  noalias(rhs) = ZeroVector(TNumNodes*(TDim+1));
111 }
112 
114  const unsigned int IntegrationPointIndex,
115  double NewWeight,
116  const MatrixRowType& rN,
117  const BoundedMatrix<double, TNumNodes, TDim>& rDN_DX) override
118 {
120 
121 }
122 
123 static int Check(const Element& rElement, const ProcessInfo& rProcessInfo)
124 {
125  const auto& r_geometry = rElement.GetGeometry();
126  for (unsigned int i = 0; i < TNumNodes; i++)
127  {
128  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(VELOCITY, r_geometry[i]);
129  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(MESH_VELOCITY, r_geometry[i]);
130  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(BODY_FORCE, r_geometry[i]);
131  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(PRESSURE, r_geometry[i]);
132  }
133 
134  return 0;
135 }
136 
138 
139 };
140 
142 
144 
145 }
Definition: axisymmetric_navier_stokes_data.h:38
NodalVectorData MeshVelocity
Definition: axisymmetric_navier_stokes_data.h:58
void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo) override
Definition: axisymmetric_navier_stokes_data.h:82
BoundedMatrix< double, TNumNodes *(TDim+1), TNumNodes *(TDim+1)> lhs
Definition: axisymmetric_navier_stokes_data.h:73
double bdf0
Definition: axisymmetric_navier_stokes_data.h:68
static int Check(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: axisymmetric_navier_stokes_data.h:123
NodalVectorData BodyForce
Definition: axisymmetric_navier_stokes_data.h:59
NodalScalarData Pressure
Definition: axisymmetric_navier_stokes_data.h:61
typename FluidElementData< TDim, TNumNodes, true >::NodalScalarData NodalScalarData
Definition: axisymmetric_navier_stokes_data.h:46
void UpdateGeometryValues(const unsigned int IntegrationPointIndex, double NewWeight, const MatrixRowType &rN, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX) override
Definition: axisymmetric_navier_stokes_data.h:113
double bdf1
Definition: axisymmetric_navier_stokes_data.h:69
double Density
Definition: axisymmetric_navier_stokes_data.h:63
array_1d< double, TNumNodes *(TDim+1)> rhs
Definition: axisymmetric_navier_stokes_data.h:74
double ElementSize
Definition: axisymmetric_navier_stokes_data.h:76
double DeltaTime
Definition: axisymmetric_navier_stokes_data.h:65
typename FluidElementData< TDim, TNumNodes, true >::MatrixRowType MatrixRowType
Definition: axisymmetric_navier_stokes_data.h:49
NodalVectorData Velocity
Definition: axisymmetric_navier_stokes_data.h:55
typename FluidElementData< TDim, TNumNodes, true >::ShapeFunctionsType ShapeFunctionsType
Definition: axisymmetric_navier_stokes_data.h:48
double DynamicViscosity
Definition: axisymmetric_navier_stokes_data.h:64
NodalVectorData Velocity_OldStep2
Definition: axisymmetric_navier_stokes_data.h:57
NodalVectorData Velocity_OldStep1
Definition: axisymmetric_navier_stokes_data.h:56
typename FluidElementData< TDim, TNumNodes, true >::NodalVectorData NodalVectorData
Definition: axisymmetric_navier_stokes_data.h:47
double DynamicTau
Definition: axisymmetric_navier_stokes_data.h:66
double bdf2
Definition: axisymmetric_navier_stokes_data.h:70
Base class for all Elements.
Definition: element.h:60
PropertiesType & GetProperties()
Definition: element.h:1024
static double MinimumElementSize(const Geometry< Node > &rGeometry)
Minimum element size based on the geometry.
Base class for data containers used within FluidElement and derived types.
Definition: fluid_element_data.h:37
void FillFromProperties(double &rData, const Variable< double > &rVariable, const Properties &rProperties)
Definition: fluid_element_data.cpp:192
void FillFromHistoricalNodalData(NodalScalarData &rData, const Variable< double > &rVariable, const Geometry< Node > &rGeometry)
Definition: fluid_element_data.cpp:65
virtual void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: fluid_element_data.cpp:18
unsigned int IntegrationPointIndex
Definition: fluid_element_data.h:100
virtual void UpdateGeometryValues(unsigned int IntegrationPointIndex, double NewWeight, const MatrixRowType &rN, const ShapeDerivativesType &rDN_DX)
Definition: fluid_element_data.cpp:52
void FillFromProcessInfo(double &rData, const Variable< double > &rVariable, const ProcessInfo &rProcessInfo)
Definition: fluid_element_data.cpp:153
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Definition: amatrix_interface.h:41
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Short class definition.
Definition: array_1d.h:61
#define KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(TheVariable, TheNode)
Definition: checks.h:171
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
integer i
Definition: TensorModule.f:17