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_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: Jordi Cotela
11 // Ruben Zorrilla
12 //
13 
14 
15 #pragma once
16 
17 // System includes
18 
19 
20 // External includes
21 
22 
23 // Project includes
25 
26 // Application includes
30 
31 namespace Kratos {
32 
35 
38 
39 template< size_t TDim, size_t TNumNodes >
40 class WeaklyCompressibleNavierStokesData : public FluidElementData<TDim,TNumNodes, true>
41 {
42 public:
43 
46 
51 
55 
61 
67 
69 double DeltaTime; // Time increment
70 double DynamicTau; // Dynamic tau considered in ASGS stabilization coefficients
71 double Resistance; // Darcy's law resistance (permeability inverse)
72 
73 double bdf0;
74 double bdf1;
75 double bdf2;
76 
77 // Auxiliary containers for the symbolically-generated matrices
78 BoundedMatrix<double,TNumNodes*(TDim+1),TNumNodes*(TDim+1)> lhs;
79 array_1d<double,TNumNodes*(TDim+1)> rhs;
80 
81 double ElementSize;
82 
86 
87 void Initialize(const Element& rElement, const ProcessInfo& rProcessInfo) override
88 {
89  // Base class Initialize manages constitutive law parameters
91 
92  const Geometry< Node >& r_geometry = rElement.GetGeometry();
93  const Properties& r_properties = rElement.GetProperties();
94  this->FillFromHistoricalNodalData(Velocity,VELOCITY,r_geometry);
95  this->FillFromHistoricalNodalData(Velocity_OldStep1,VELOCITY,r_geometry,1);
96  this->FillFromHistoricalNodalData(Velocity_OldStep2,VELOCITY,r_geometry,2);
97  this->FillFromHistoricalNodalData(MeshVelocity,MESH_VELOCITY,r_geometry);
98  this->FillFromHistoricalNodalData(BodyForce,BODY_FORCE,r_geometry);
99  this->FillFromHistoricalNodalData(Pressure,PRESSURE,r_geometry);
100  this->FillFromHistoricalNodalData(Density,DENSITY,r_geometry);
101  this->FillFromHistoricalNodalData(Pressure_OldStep1,PRESSURE,r_geometry,1);
102  this->FillFromHistoricalNodalData(Pressure_OldStep2,PRESSURE,r_geometry,2);
103  this->FillFromNonHistoricalNodalData(SoundVelocity, SOUND_VELOCITY, r_geometry);
104  this->FillFromProperties(DynamicViscosity,DYNAMIC_VISCOSITY,r_properties); //TODO: This needs to be retrieved from the EffectiveViscosity of the constitutive law
105  this->FillFromProcessInfo(DeltaTime,DELTA_TIME,rProcessInfo);
106  this->FillFromProcessInfo(DynamicTau,DYNAMIC_TAU,rProcessInfo);
107 
108  const Vector& BDFVector = rProcessInfo[BDF_COEFFICIENTS];
109  bdf0 = BDFVector[0];
110  bdf1 = BDFVector[1];
111  bdf2 = BDFVector[2];
112 
113  // Get data from element database
114  this->FillFromElementData(Resistance, RESISTANCE, rElement);
115 
116  // Calculate element characteristic size
118 }
119 
121  const unsigned int IntegrationPointIndex,
122  double NewWeight,
123  const MatrixRowType& rN,
124  const BoundedMatrix<double, TNumNodes, TDim>& rDN_DX) override
125 {
127 }
128 
129 static int Check(const Element& rElement, const ProcessInfo& rProcessInfo)
130 {
131  const Geometry< Node >& r_geometry = rElement.GetGeometry();
132 
133  for (unsigned int i = 0; i < TNumNodes; i++)
134  {
135  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(VELOCITY,r_geometry[i]);
136  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(MESH_VELOCITY,r_geometry[i]);
137  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(BODY_FORCE,r_geometry[i]);
138  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(PRESSURE,r_geometry[i]);
139  }
140 
141  return 0;
142 }
143 
145 
146 };
147 
149 
151 
152 }
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
void FillFromElementData(double &rData, const Variable< double > &rVariable, const Element &rElement)
Definition: fluid_element_data.cpp:167
virtual void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: fluid_element_data.cpp:18
void FillFromNonHistoricalNodalData(NodalScalarData &rData, const Variable< double > &rVariable, const Geometry< Node > &rGeometry)
Definition: fluid_element_data.cpp:128
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
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
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
Definition: weakly_compressible_navier_stokes_data.h:41
void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo) override
Definition: weakly_compressible_navier_stokes_data.h:87
BoundedMatrix< double, TNumNodes *(TDim+1), TNumNodes *(TDim+1)> lhs
Definition: weakly_compressible_navier_stokes_data.h:78
typename FluidElementData< TDim, TNumNodes, true >::MatrixRowType MatrixRowType
Definition: weakly_compressible_navier_stokes_data.h:50
NodalScalarData Pressure_OldStep1
Definition: weakly_compressible_navier_stokes_data.h:63
typename FluidElementData< TDim, TNumNodes, true >::NodalVectorData NodalVectorData
Definition: weakly_compressible_navier_stokes_data.h:48
double bdf2
Definition: weakly_compressible_navier_stokes_data.h:75
NodalScalarData Pressure
Definition: weakly_compressible_navier_stokes_data.h:62
double ElementSize
Definition: weakly_compressible_navier_stokes_data.h:81
double bdf1
Definition: weakly_compressible_navier_stokes_data.h:74
NodalVectorData MeshVelocity
Definition: weakly_compressible_navier_stokes_data.h:59
NodalScalarData Density
Definition: weakly_compressible_navier_stokes_data.h:65
NodalVectorData Velocity_OldStep1
Definition: weakly_compressible_navier_stokes_data.h:57
typename FluidElementData< TDim, TNumNodes, true >::ShapeFunctionsType ShapeFunctionsType
Definition: weakly_compressible_navier_stokes_data.h:49
NodalScalarData Pressure_OldStep2
Definition: weakly_compressible_navier_stokes_data.h:64
void UpdateGeometryValues(const unsigned int IntegrationPointIndex, double NewWeight, const MatrixRowType &rN, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX) override
Definition: weakly_compressible_navier_stokes_data.h:120
NodalVectorData Velocity
Definition: weakly_compressible_navier_stokes_data.h:56
array_1d< double, TNumNodes *(TDim+1)> rhs
Definition: weakly_compressible_navier_stokes_data.h:79
double DynamicTau
Definition: weakly_compressible_navier_stokes_data.h:70
NodalVectorData Velocity_OldStep2
Definition: weakly_compressible_navier_stokes_data.h:58
double DeltaTime
Definition: weakly_compressible_navier_stokes_data.h:69
double DynamicViscosity
Definition: weakly_compressible_navier_stokes_data.h:68
NodalVectorData BodyForce
Definition: weakly_compressible_navier_stokes_data.h:60
static int Check(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: weakly_compressible_navier_stokes_data.h:129
typename FluidElementData< TDim, TNumNodes, true >::NodalScalarData NodalScalarData
Definition: weakly_compressible_navier_stokes_data.h:47
double Resistance
Definition: weakly_compressible_navier_stokes_data.h:71
double bdf0
Definition: weakly_compressible_navier_stokes_data.h:73
NodalScalarData SoundVelocity
Definition: weakly_compressible_navier_stokes_data.h:66
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
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