14 #if !defined(KRATOS_TWO_FLUID_NAVIER_STOKES_DATA_ALPHA_METHOD_H)
15 #define KRATOS_TWO_FLUID_NAVIER_STOKES_DATA_ALPHA_METHOD_H
32 template<
size_t TDim,
size_t TNumNodes >
152 for (
unsigned int i = 0;
i < TNumNodes;
i++){
167 if (previous_dt < 1.0e-12) {
168 previous_dt = rProcessInfo[DELTA_TIME];
201 noalias(this->DN_DXenr) = rDN_DXenr;
209 for (
unsigned int i = 0;
i < TNumNodes;
i++)
242 const double c1 = 2.0*
mu;
243 const double c2 =
mu;
252 if constexpr (TDim == 2)
255 const double volumetric_part = trace/2.0;
262 else if constexpr (TDim == 3)
265 const double volumetric_part = trace/3.0;
279 const double alpha_f= 1/(rho_inf+1);
285 if constexpr (TDim == 3)
290 this->
StrainRate[3] =
DN(0,0)*
v(0,1) +
DN(0,1)*
v(0,0) +
DN(1,0)*
v(1,1) +
DN(1,1)*
v(1,0) +
DN(2,0)*
v(2,1) +
DN(2,1)*
v(2,0) +
DN(3,0)*
v(3,1) +
DN(3,1)*
v(3,0);
291 this->
StrainRate[4] =
DN(0,1)*
v(0,2) +
DN(0,2)*
v(0,1) +
DN(1,1)*
v(1,2) +
DN(1,2)*
v(1,1) +
DN(2,1)*
v(2,2) +
DN(2,2)*
v(2,1) +
DN(3,1)*
v(3,2) +
DN(3,2)*
v(3,1);
292 this->
StrainRate[5] =
DN(0,0)*
v(0,2) +
DN(0,2)*
v(0,0) +
DN(1,0)*
v(1,2) +
DN(1,2)*
v(1,0) +
DN(2,0)*
v(2,2) +
DN(2,2)*
v(2,0) +
DN(3,0)*
v(3,2) +
DN(3,2)*
v(3,0);
295 else if constexpr (TDim == 2)
299 this->
StrainRate[2] =
DN(0,1)*
v(0,0) +
DN(0,0)*
v(0,1) +
DN(1,1)*
v(1,0) +
DN(1,0)*
v(1,1) +
DN(2,1)*
v(2,0) +
DN(2,0)*
v(2,1);
305 double strain_rate_norm;
307 if constexpr (TDim == 3)
309 strain_rate_norm = std::sqrt(2.*
S[0] *
S[0] + 2.*
S[1] *
S[1] + 2.*
S[2] *
S[2] +
310 S[3] *
S[3] +
S[4] *
S[4] +
S[5] *
S[5]);
313 else if constexpr (TDim == 2)
315 strain_rate_norm = std::sqrt(2.*
S[0] *
S[0] + 2.*
S[1] *
S[1] +
S[2] *
S[2]);
317 return strain_rate_norm;
323 for (
unsigned int i = 0;
i < TNumNodes;
i++)
324 dist += this->
N[
i] * Distance[
i];
328 for (
unsigned int i = 0;
i < TNumNodes;
i++)
343 for (
unsigned int i = 0;
i < TNumNodes;
i++)
344 dist += this->
N[
i] * Distance[
i];
347 double dynamic_viscosity = 0.0;
348 for (
unsigned int i = 0;
i < TNumNodes;
i++)
Base class for all Elements.
Definition: element.h:60
static double GradientsElementSize(const BoundedMatrix< double, 3, 2 > &rDN_DX)
Element size based on the shape functions gradients. Triangle element version.
Definition: element_size_calculator.cpp:1456
Base class for data containers used within FluidElement and derived types.
Definition: fluid_element_data.h:37
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
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
ShapeFunctionsType N
Definition: fluid_element_data.h:104
Vector StrainRate
Strain rate (symmetric gradient of velocity) vector in Voigt notation.
Definition: fluid_element_data.h:110
Vector ShearStress
Shear stress vector in Voigt notation.
Definition: fluid_element_data.h:114
virtual void UpdateGeometryValues(unsigned int IntegrationPointIndex, double NewWeight, const MatrixRowType &rN, const ShapeDerivativesType &rDN_DX)
Definition: fluid_element_data.cpp:52
double EffectiveViscosity
Effective viscosity (in dynamic units) produced by the constitutive law.
Definition: fluid_element_data.h:124
ShapeDerivativesType DN_DX
Definition: fluid_element_data.h:106
void FillFromProcessInfo(double &rData, const Variable< double > &rVariable, const ProcessInfo &rProcessInfo)
Definition: fluid_element_data.cpp:153
Matrix C
Constitutive tensor C (expressed as a Matrix).
Definition: fluid_element_data.h:118
static void GetNewtonianConstitutiveMatrix(const double DynamicViscosity, BoundedMatrix< double, VoigtVector2DSize, VoigtVector2DSize > &rConstitutiveMatrix)
Definition: fluid_element_utilities.cpp:58
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometry.h:627
bool Has(const Variable< TDataType > &rThisVariable) const
Definition: geometry.h:609
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
void clear()
Definition: amatrix_interface.h:284
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
ProcessInfo & GetPreviousTimeStepInfo(IndexType StepsBefore=1)
Definition: process_info.h:187
Definition: two_fluid_navier_stokes_alpha_method_data.h:34
ShapeFunctionsType Nenr
Definition: two_fluid_navier_stokes_alpha_method_data.h:101
typename FluidElementData< TDim, TNumNodes, true >::MatrixRowType MatrixRowType
Definition: two_fluid_navier_stokes_alpha_method_data.h:44
void UpdateGeometryValues(unsigned int IntegrationPointIndex, double NewWeight, const MatrixRowType &rN, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX, const MatrixRowType &rNenr, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DXenr)
Definition: two_fluid_navier_stokes_alpha_method_data.h:190
typename FluidElementData< TDim, TNumNodes, true >::NodalScalarData NodalScalarData
Definition: two_fluid_navier_stokes_alpha_method_data.h:40
BoundedMatrix< double, TNumNodes *(TDim+1), TNumNodes *(TDim+1)> lhs
Definition: two_fluid_navier_stokes_alpha_method_data.h:81
NodalVectorData MeshVelocityOldStep
Definition: two_fluid_navier_stokes_alpha_method_data.h:58
typename FluidElementData< TDim, TNumNodes, true >::ShapeFunctionsType ShapeFunctionsType
Definition: two_fluid_navier_stokes_alpha_method_data.h:42
double DeltaTime
Definition: two_fluid_navier_stokes_alpha_method_data.h:74
NodalVectorData Velocity_OldStep1
Definition: two_fluid_navier_stokes_alpha_method_data.h:53
size_t NumNegativeNodes
Definition: two_fluid_navier_stokes_alpha_method_data.h:105
NodalVectorData MeshVelocity
Definition: two_fluid_navier_stokes_alpha_method_data.h:57
ShapeFunctionsGradientsType DN_DX_pos_side
Definition: two_fluid_navier_stokes_alpha_method_data.h:92
BoundedMatrix< double, TNumNodes, TNumNodes > Enr_Pos_Interp
Definition: two_fluid_navier_stokes_alpha_method_data.h:95
void CalculateAirMaterialResponse()
Definition: two_fluid_navier_stokes_alpha_method_data.h:229
Vector ShearStressOldStep
Definition: two_fluid_navier_stokes_alpha_method_data.h:70
NodalVectorData BodyForce_OldStep1
Definition: two_fluid_navier_stokes_alpha_method_data.h:61
GeometryType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: two_fluid_navier_stokes_alpha_method_data.h:46
Matrix N_pos_side
Definition: two_fluid_navier_stokes_alpha_method_data.h:90
double MaxSpectralRadius
Definition: two_fluid_navier_stokes_alpha_method_data.h:77
double VolumeErrorRate
Definition: two_fluid_navier_stokes_alpha_method_data.h:76
ShapeFunctionsGradientsType DN_DX_neg_side
Definition: two_fluid_navier_stokes_alpha_method_data.h:93
double ComputeStrainNorm()
Definition: two_fluid_navier_stokes_alpha_method_data.h:303
Vector w_gauss_pos_side
Definition: two_fluid_navier_stokes_alpha_method_data.h:98
Vector w_gauss_neg_side
Definition: two_fluid_navier_stokes_alpha_method_data.h:99
void CalculateEffectiveViscosityAtGaussPoint()
Definition: two_fluid_navier_stokes_alpha_method_data.h:340
array_1d< double, TNumNodes > rhs_ee
Definition: two_fluid_navier_stokes_alpha_method_data.h:86
bool IsAir()
Definition: two_fluid_navier_stokes_alpha_method_data.h:225
BoundedMatrix< double, TNumNodes, TNumNodes > Enr_Neg_Interp
Definition: two_fluid_navier_stokes_alpha_method_data.h:96
size_t NumPositiveNodes
Definition: two_fluid_navier_stokes_alpha_method_data.h:104
ShapeDerivativesType DN_DXenr
Definition: two_fluid_navier_stokes_alpha_method_data.h:102
double DynamicTau
Definition: two_fluid_navier_stokes_alpha_method_data.h:75
NodalVectorData Velocity
Definition: two_fluid_navier_stokes_alpha_method_data.h:52
array_1d< double, TNumNodes *(TDim+1)> rhs
Definition: two_fluid_navier_stokes_alpha_method_data.h:82
NodalScalarData NodalDynamicViscosity
Definition: two_fluid_navier_stokes_alpha_method_data.h:67
NodalScalarData NodalDensity
Definition: two_fluid_navier_stokes_alpha_method_data.h:65
unsigned int NumberOfDivisions
Definition: two_fluid_navier_stokes_alpha_method_data.h:106
NodalScalarData Distance
Definition: two_fluid_navier_stokes_alpha_method_data.h:63
NodalVectorData BodyForce
Definition: two_fluid_navier_stokes_alpha_method_data.h:60
BoundedMatrix< double, TNumNodes, TNumNodes > Kee
Definition: two_fluid_navier_stokes_alpha_method_data.h:85
NodalScalarData Pressure
Definition: two_fluid_navier_stokes_alpha_method_data.h:54
BoundedMatrix< double, TNumNodes *(TDim+1), TNumNodes > V
Definition: two_fluid_navier_stokes_alpha_method_data.h:83
void CalculateDensityAtGaussPoint()
Definition: two_fluid_navier_stokes_alpha_method_data.h:320
typename FluidElementData< TDim, TNumNodes, true >::ShapeDerivativesType ShapeDerivativesType
Definition: two_fluid_navier_stokes_alpha_method_data.h:43
double ElementSize
Definition: two_fluid_navier_stokes_alpha_method_data.h:88
typename FluidElementData< TDim, TNumNodes, true >::NodalVectorData NodalVectorData
Definition: two_fluid_navier_stokes_alpha_method_data.h:41
double DynamicViscosity
Definition: two_fluid_navier_stokes_alpha_method_data.h:73
void ComputeStrain()
Definition: two_fluid_navier_stokes_alpha_method_data.h:276
void UpdateGeometryValues(unsigned int IntegrationPointIndex, double NewWeight, const MatrixRowType &rN, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX) override
Definition: two_fluid_navier_stokes_alpha_method_data.h:179
Matrix N_neg_side
Definition: two_fluid_navier_stokes_alpha_method_data.h:91
NodalVectorData AccelerationAlphaMethod
Definition: two_fluid_navier_stokes_alpha_method_data.h:55
double Density
Definition: two_fluid_navier_stokes_alpha_method_data.h:72
BoundedMatrix< double, TNumNodes, TNumNodes *(TDim+1)> H
Definition: two_fluid_navier_stokes_alpha_method_data.h:84
Geometry< Node > GeometryType
Definition: two_fluid_navier_stokes_alpha_method_data.h:45
static int Check(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: two_fluid_navier_stokes_alpha_method_data.h:205
NodalScalarData NodalDynamicViscosityOldStep
Definition: two_fluid_navier_stokes_alpha_method_data.h:68
bool IsCut()
Definition: two_fluid_navier_stokes_alpha_method_data.h:221
NodalScalarData NodalDensityOldStep
Definition: two_fluid_navier_stokes_alpha_method_data.h:66
double ArtificialDynamicViscosity
Definition: two_fluid_navier_stokes_alpha_method_data.h:78
void ComputeDarcyTerm()
Definition: two_fluid_navier_stokes_alpha_method_data.h:361
void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo) override
Definition: two_fluid_navier_stokes_alpha_method_data.h:113
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
float dist
Definition: edgebased_PureConvection.py:89
float density
Definition: face_heat.py:56
v
Definition: generate_convection_diffusion_explicit_element.py:114
DN
Definition: generate_convection_diffusion_explicit_element.py:98
stress
Stress vector definition.
Definition: generate_droplet_dynamics.py:82
mu
Definition: generate_frictional_mortar_condition.py:127
int strain_size
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:16
strain
HERE WE MUST SUBSTITUTE EXPRESSIONS.
Definition: generate_stokes_twofluid_element.py:104
S
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:39
int alpha_f
Definition: generate_two_fluid_navier_stokes.py:130
integer i
Definition: TensorModule.f:17