13 #if !defined(KRATOS_SHOCK_CAPTURING_ENTROPY_VISCOSITY_H_INCLUDED)
14 #define KRATOS_SHOCK_CAPTURING_ENTROPY_VISCOSITY_H_INCLUDED
93 const std::size_t NumberOfDimensions,
94 const std::size_t NumberOfNodes)
95 : Value {NumberOfNodes, 0.0},
96 TimeDerivative {NumberOfNodes, 0.0},
97 Flux {NumberOfNodes, NumberOfDimensions, 0.0}
104 const std::size_t NodeIndex,
106 const double DeltaTime)
112 TimeDerivative[NodeIndex] = (Value[NodeIndex] - old_value) / DeltaTime;
114 Flux(NodeIndex, 0) = Value[NodeIndex] * Velocity[0];
115 Flux(NodeIndex, 1) = Value[NodeIndex] * Velocity[1];
117 Flux(NodeIndex, 2) = Value[NodeIndex] * Velocity[2];
125 const Matrix& rShapeFunctionsGradents)
const
129 const double divergence = Divergence(rShapeFunctionsGradents, Flux);
130 const double time_derivative =
inner_prod(TimeDerivative, rShapeFunctions);
131 return time_derivative + divergence;
144 static double Divergence(
const Matrix& rShapeFunGradients,
const Matrix& rNodalValues);
175 void ExecuteInitializeSolutionStep()
override;
177 int Check()
override;
179 const Parameters GetDefaultParameters()
const override;
196 std::string
Info()
const override
198 std::stringstream buffer;
199 buffer <<
"ShockCapturingEntropyViscosityProcess";
204 void PrintInfo(std::ostream& rOStream)
const override { rOStream <<
"ShockCapturingEntropyViscosityProcess"; }
225 bool mIsInitialized =
false;
226 bool mComputeAreasEveryStep =
false;
227 double mEntropyConstant = 0.0;
228 double mEnergyConstant = 0.0;
229 double mArtificialMassDiffusivityPrandtl = 0.0;
230 double mArtificialConductivityPrandtl = 0.0;
241 void ValidateAndAssignParameters(
Parameters &rParameters);
243 void UpdateNodalAreaProcess();
251 void ComputeNodalEntropies(
const unsigned int WriteBufferIndex = 0);
253 void ComputeArtificialMagnitudes();
255 void DistributeVariablesToNodes(
257 const double ArtificialDynamicViscosity,
258 const double ArtificialMassDiffusivity,
259 const double ArtificialConductivity,
260 const std::function<
double(
Geometry<Node>*)>& rGeometrySize)
const;
262 static double ComputeEntropy(
263 const double Density,
264 const double Pressure,
267 return Density / (
Gamma - 1.0) * std::log(Pressure / std::pow(Density,
Gamma));
276 template <
unsigned int TDim>
277 static double MinimumEdgeLengthSquared(
const Element &rElement);
287 static InfNormData ComputeElementalInfNormData(
288 const Element& rElement,
289 const double DeltaTime,
290 const double HeatCapacityRatio,
291 const double SpecificHeatCV);
299 static std::tuple<TotalDerivativeUtil, TotalDerivativeUtil, Vector> BuildTotalDerivativeUtils(
300 const Element& rElement,
301 const double DeltaTime,
302 const double HeatCapacityRatio,
303 const double SpecificHeatCV);
309 static InfNormData ComputeInfNorms(
310 const Geometry<NodeType>& rGeometry,
311 const TotalDerivativeUtil& rEntropyTotalDerivative,
312 const TotalDerivativeUtil& rDensityTotalDerivative,
313 const Vector& rTotalVelocities);
332 ShockCapturingEntropyViscosityProcess&
operator=(ShockCapturingEntropyViscosityProcess
const& rOther);
335 ShockCapturingEntropyViscosityProcess(ShockCapturingEntropyViscosityProcess
const& rOther);
352 std::ostream& rOStream,
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Elements.
Definition: element.h:60
Geometry base class.
Definition: geometry.h:71
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
The base class for all processes in Kratos.
Definition: process.h:49
Definition: shock_capturing_entropy_viscosity_process.h:59
KRATOS_CLASS_POINTER_DEFINITION(ShockCapturingEntropyViscosityProcess)
Pointer definition of ShockCapturingEntropyViscosityProcess.
void PrintData(std::ostream &) const override
Print object's data.
Definition: shock_capturing_entropy_viscosity_process.h:207
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: shock_capturing_entropy_viscosity_process.h:204
std::string Info() const override
Turn back information as a string.
Definition: shock_capturing_entropy_viscosity_process.h:196
ShockCapturingEntropyViscosityProcess(Model &rModel, Parameters rParameters)
Constructor with model.
Definition: shock_capturing_entropy_viscosity_process.h:156
ModelPart::NodeType NodeType
Definition: shock_capturing_entropy_viscosity_process.h:65
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
AMatrix::MatrixRow< TExpressionType > MatrixRow
Definition: amatrix_interface.h:492
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def Gamma(n, j)
Definition: quadrature.py:146
Definition: shock_capturing_entropy_viscosity_process.h:68
double EntropyResidual
Definition: shock_capturing_entropy_viscosity_process.h:69
double Density
Definition: shock_capturing_entropy_viscosity_process.h:70
double TotalVelocity
Definition: shock_capturing_entropy_viscosity_process.h:71
Small utility to compute the total derivative of a magnitude.
Definition: shock_capturing_entropy_viscosity_process.h:83
Matrix Flux
Definition: shock_capturing_entropy_viscosity_process.h:86
double ComputeAtGaussPoint(const MatrixRow< const Matrix > &rShapeFunctions, const Matrix &rShapeFunctionsGradents) const
Definition: shock_capturing_entropy_viscosity_process.h:123
TotalDerivativeUtil(const std::size_t NumberOfDimensions, const std::size_t NumberOfNodes)
Definition: shock_capturing_entropy_viscosity_process.h:92
TotalDerivativeUtil()
Definition: shock_capturing_entropy_viscosity_process.h:88
void LoadNodalValues(const Variable< double > &rVariable, const NodeType &rNode, const std::size_t NodeIndex, const array_1d< double, 3 > &Velocity, const double DeltaTime)
Definition: shock_capturing_entropy_viscosity_process.h:101
Vector Value
Definition: shock_capturing_entropy_viscosity_process.h:84
Vector TimeDerivative
Definition: shock_capturing_entropy_viscosity_process.h:85