13#ifndef DUMUX_ONEEQ_VOLUME_VARIABLES_HH
14#define DUMUX_ONEEQ_VOLUME_VARIABLES_HH
16#include <dune/common/math.hh>
27template <
class Traits,
class NSVolumeVariables>
33 using Scalar =
typename Traits::PrimaryVariables::value_type;
34 using DimVector = Dune::FieldVector<Scalar, Traits::ModelTraits::dim()>;
38 using Indices =
typename Traits::ModelTraits::Indices;
49 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
50 void update(
const ElementSolution &elemSol,
51 const Problem &problem,
52 const Element &element,
53 const SubControlVolume& scv)
69 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
71 const Problem &problem,
72 const Element &element,
73 const SubControlVolume& scv)
81 if (problem.useStoredEddyViscosity())
147 return g() * pow(1.0 + power(
cw3(), 6) / (power(
g(), 6) + power(
cw3(), 6)), 1.0/6.0);
154 return r() +
cw2() * (power(
r(), 6) -
r());
Volume variables for the isothermal single-phase one-equation turbulence model by Spalart-Allmaras.
Definition: freeflow/rans/oneeq/volumevariables.hh:30
Scalar c2() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:207
Scalar fv2() const
Returns a model function.
Definition: freeflow/rans/oneeq/volumevariables.hh:130
Scalar vorticityMagnitude() const
Returns the magnitude of the vorticity.
Definition: freeflow/rans/oneeq/volumevariables.hh:200
Scalar cb2() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:223
Scalar fv1() const
Returns damping function for the eddy viscosity.
Definition: freeflow/rans/oneeq/volumevariables.hh:122
DimVector storedViscosityTildeGradient() const
Returns the gradient of the viscosity parameter.
Definition: freeflow/rans/oneeq/volumevariables.hh:110
Scalar viscosityTilde_
Definition: freeflow/rans/oneeq/volumevariables.hh:254
void update(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all quantities for a given control volume.
Definition: freeflow/rans/oneeq/volumevariables.hh:50
Scalar sigma() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:215
Scalar viscosityRatio() const
Returns the ratio of the kinematic viscosity and the viscosity parameter.
Definition: freeflow/rans/oneeq/volumevariables.hh:168
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: freeflow/rans/oneeq/volumevariables.hh:38
Scalar storedViscosityTilde_
Definition: freeflow/rans/oneeq/volumevariables.hh:255
Scalar vorticityTensorScalarProduct_
Definition: freeflow/rans/oneeq/volumevariables.hh:258
Scalar ft2() const
Returns a model function.
Definition: freeflow/rans/oneeq/volumevariables.hh:134
Scalar g() const
Returns a model function.
Definition: freeflow/rans/oneeq/volumevariables.hh:151
void updateRANSProperties(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all turbulent quantities for a given control volume.
Definition: freeflow/rans/oneeq/volumevariables.hh:70
Scalar stressTensorScalarProductTilde() const
Definition: freeflow/rans/oneeq/volumevariables.hh:180
DimVector storedViscosityTildeGradient_
Definition: freeflow/rans/oneeq/volumevariables.hh:256
Scalar fW() const
Returns a model function.
Definition: freeflow/rans/oneeq/volumevariables.hh:143
Scalar c3() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:211
Scalar calculateEddyViscosity()
Returns the dynamic eddy viscosity .
Definition: freeflow/rans/oneeq/volumevariables.hh:92
Scalar storedViscosityTilde() const
Returns the viscosity parameter from the last iteration .
Definition: freeflow/rans/oneeq/volumevariables.hh:104
Scalar cw1() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:239
Scalar cb1() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:219
Scalar ct3() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:231
Scalar cv1() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:227
Scalar r() const
Returns a model function.
Definition: freeflow/rans/oneeq/volumevariables.hh:158
Scalar ct4() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:235
Scalar viscosityTilde() const
Returns the viscosity parameter .
Definition: freeflow/rans/oneeq/volumevariables.hh:98
Scalar stressTensorScalarProduct() const
Returns the scalar product of the stress tensor.
Definition: freeflow/rans/oneeq/volumevariables.hh:116
Scalar stressTensorScalarProduct_
Definition: freeflow/rans/oneeq/volumevariables.hh:257
Scalar cw2() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:246
Scalar cw3() const
Returns a model constant.
Definition: freeflow/rans/oneeq/volumevariables.hh:250
Volume variables for the isothermal single-phase Reynolds-Averaged Navier-Stokes models.
Definition: freeflow/rans/volumevariables.hh:30
Scalar karmanConstant() const
Return the Karman constant.
Definition: freeflow/rans/volumevariables.hh:144
void calculateEddyThermalConductivity(const Problem &problem)
Calculates the eddy thermal conductivity based on the kinematic eddy viscosity and the turbulent Pra...
Definition: freeflow/rans/volumevariables.hh:209
Scalar wallDistance() const
Return the wall distance of the control volume.
Definition: freeflow/rans/volumevariables.hh:138
void updateNavierStokesVolVars(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all quantities for a given control volume.
Definition: freeflow/rans/volumevariables.hh:53
Scalar setDynamicEddyViscosity_(Scalar value)
Sets the dynamic eddy viscosity .
Definition: freeflow/rans/volumevariables.hh:254
Scalar kinematicViscosity() const
Return the kinematic viscosity of the fluid within the control volume.
Definition: freeflow/rans/volumevariables.hh:190
void updateRANSProperties(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all turbulent quantities for a given control volume.
Definition: freeflow/rans/volumevariables.hh:73
void calculateEddyDiffusivity(const Problem &problem)
Calculates the eddy diffusivity based on the kinematic eddy viscosity and the turbulent Schmidt numb...
Definition: freeflow/rans/volumevariables.hh:198
unsigned int elementIdx() const
Return the element Idx of the control volume.
Definition: freeflow/rans/volumevariables.hh:108
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.