25#ifndef DUMUX_RANS_VOLUME_VARIABLES_HH
26#define DUMUX_RANS_VOLUME_VARIABLES_HH
28#include <dune/common/fvector.hh>
29#include <dune/common/fmatrix.hh>
39template <
class Traits,
class NSVolumeVariables>
41:
public NSVolumeVariables
43 using NavierStokesParentType = NSVolumeVariables;
45 using Scalar =
typename Traits::PrimaryVariables::value_type;
47 enum { dimWorld = Traits::ModelTraits::dim() };
48 using DimVector = Dune::FieldVector<Scalar, dimWorld>;
49 using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
51 static constexpr bool enableEnergyBalance = Traits::ModelTraits::enableEnergyBalance();
64 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
66 const Problem &problem,
67 const Element &element,
68 const SubControlVolume& scv)
70 NavierStokesParentType::update(elemSol, problem, element, scv);
84 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
86 const Problem &problem,
87 const Element &element,
88 const SubControlVolume& scv)
95 elementIdx_ = problem.gridGeometry().elementMapper().index(element);
103 if (problem.isFlatWallBounded())
105 const auto flowDirectionAxis = problem.flowDirectionAxis(
elementIdx_);
106 const auto wallNormalAxis = problem.wallNormalAxis(
elementIdx_);
110 * abs(problem.velocityGradient(problem.wallElementIndex(
elementIdx_), flowDirectionAxis, wallNormalAxis)));
209 template<
class Problem>
213 / problem.turbulentSchmidtNumber();
220 template<
class Problem,
bool eB = enableEnergyBalance,
typename std::enable_if_t<eB,
int> = 0>
225 * NavierStokesParentType::heatCapacity()
226 / problem.turbulentPrandtlNumber();
230 template<
class Problem,
bool eB = enableEnergyBalance,
typename std::enable_if_t<!eB,
int> = 0>
250 {
return NavierStokesParentType::diffusionCoefficient(0, compIIdx, compJIdx) +
eddyDiffusivity(); }
256 template<
bool eB = enableEnergyBalance,
typename std::enable_if_t<eB,
int> = 0>
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Volume variables for the isothermal single-phase Reynolds-Averaged Navier-Stokes models.
Definition: freeflow/rans/volumevariables.hh:42
Scalar karmanConstant() const
Return the Karman constant.
Definition: freeflow/rans/volumevariables.hh:156
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:221
Scalar eddyDiffusivity() const
Returns the eddy diffusivity .
Definition: freeflow/rans/volumevariables.hh:237
Scalar eddyThermalConductivity() const
Returns the eddy thermal conductivity .
Definition: freeflow/rans/volumevariables.hh:243
Scalar wallDistance() const
Return the wall distance of the control volume.
Definition: freeflow/rans/volumevariables.hh:150
Scalar yPlus_
Definition: freeflow/rans/volumevariables.hh:277
Scalar yPlus() const
Return the dimensionless wall distance .
Definition: freeflow/rans/volumevariables.hh:168
Scalar eddyThermalConductivity_
Definition: freeflow/rans/volumevariables.hh:281
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:65
Scalar dynamicEddyViscosity() const
Return the dynamic eddy viscosity of the flow within the control volume.
Definition: freeflow/rans/volumevariables.hh:181
DimVector velocityMaximum_
Definition: freeflow/rans/volumevariables.hh:270
Scalar uStar() const
Return the wall friction velocity .
Definition: freeflow/rans/volumevariables.hh:162
Scalar karmanConstant_
Definition: freeflow/rans/volumevariables.hh:275
DimVector ccVelocityVector() const
Return the velocity vector at the control volume center.
Definition: freeflow/rans/volumevariables.hh:126
Scalar setDynamicEddyViscosity_(Scalar value)
Sets the dynamic eddy viscosity .
Definition: freeflow/rans/volumevariables.hh:266
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: freeflow/rans/volumevariables.hh:249
Scalar kinematicViscosity() const
Return the kinematic viscosity of the fluid within the control volume.
Definition: freeflow/rans/volumevariables.hh:202
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:85
Scalar uStar_
Definition: freeflow/rans/volumevariables.hh:276
std::size_t elementIdx_
Definition: freeflow/rans/volumevariables.hh:273
Scalar eddyDiffusivity_
Definition: freeflow/rans/volumevariables.hh:280
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:210
DimVector velocityMaximum() const
Return the maximum velocity vector of the wall segment.
Definition: freeflow/rans/volumevariables.hh:132
Scalar kinematicEddyViscosity() const
Return the kinematic eddy viscosity of the flow within the control volume.
Definition: freeflow/rans/volumevariables.hh:195
Scalar effectiveThermalConductivity() const
Returns the effective thermal conductivity of the fluid-flow in the sub-control volume.
Definition: freeflow/rans/volumevariables.hh:257
DimVector velocityMinimum() const
Return the minimum velocity vector of the wall segment.
Definition: freeflow/rans/volumevariables.hh:138
DimVector ccVelocityVector_
Definition: freeflow/rans/volumevariables.hh:269
Scalar effectiveViscosity() const
Return the effective dynamic viscosity of the fluid within the control volume.
Definition: freeflow/rans/volumevariables.hh:188
Scalar dynamicEddyViscosity_
Definition: freeflow/rans/volumevariables.hh:279
Scalar wallDistance_
Definition: freeflow/rans/volumevariables.hh:274
unsigned int elementIdx() const
Return the element Idx of the control volume.
Definition: freeflow/rans/volumevariables.hh:120
Scalar uPlus_
Definition: freeflow/rans/volumevariables.hh:278
Scalar uPlus() const
Return the dimensionless velocity .
Definition: freeflow/rans/volumevariables.hh:174
DimVector velocityMinimum_
Definition: freeflow/rans/volumevariables.hh:271
DimMatrix velocityGradientTensor_
Definition: freeflow/rans/volumevariables.hh:272
DimMatrix velocityGradients() const
Return the velocity gradients at the control volume center.
Definition: freeflow/rans/volumevariables.hh:144