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);
101 const auto flowNormalAxis = problem.flowNormalAxis_[
elementIdx_];
102 const auto wallNormalAxis = problem.wallNormalAxis_[
elementIdx_];
104 * abs(problem.velocityGradients_[
wallElementIdx_][flowNormalAxis][wallNormalAxis]));
197 template<
class Problem>
201 / problem.turbulentSchmidtNumber();
208 template<
class Problem,
bool eB = enableEnergyBalance,
typename std::enable_if_t<eB,
int> = 0>
213 * NavierStokesParentType::heatCapacity()
214 / problem.turbulentPrandtlNumber();
218 template<
class Problem,
bool eB = enableEnergyBalance,
typename std::enable_if_t<!eB,
int> = 0>
242 return NavierStokesParentType::diffusionCoefficient(compIIdx, compJIdx) +
eddyDiffusivity();
249 template<
bool eB = enableEnergyBalance,
typename std::enable_if_t<eB,
int> = 0>
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
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: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 eddyDiffusivity() const
Returns the eddy diffusivity .
Definition: freeflow/rans/volumevariables.hh:225
Scalar eddyThermalConductivity() const
Returns the eddy thermal conductivity .
Definition: freeflow/rans/volumevariables.hh:231
Scalar wallDistance() const
Return the wall distance of the control volume.
Definition: freeflow/rans/volumevariables.hh:138
Scalar yPlus_
Definition: freeflow/rans/volumevariables.hh:270
Scalar yPlus() const
Return the dimensionless wall distance .
Definition: freeflow/rans/volumevariables.hh:156
Scalar eddyThermalConductivity_
Definition: freeflow/rans/volumevariables.hh:274
DimMatrix velocityGradients_
Definition: freeflow/rans/volumevariables.hh:264
Scalar effectiveDiffusivity(int compIIdx, int compJIdx) const
Returns the effective diffusion coefficient .
Definition: freeflow/rans/volumevariables.hh:240
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:169
DimVector velocityMaximum_
Definition: freeflow/rans/volumevariables.hh:263
DimVector velocity() const
Return the velocity vector at the control volume center.
Definition: freeflow/rans/volumevariables.hh:120
Scalar uStar() const
Return the wall friction velocity .
Definition: freeflow/rans/volumevariables.hh:150
Scalar karmanConstant_
Definition: freeflow/rans/volumevariables.hh:268
Scalar setDynamicEddyViscosity_(Scalar value)
Sets the dynamic eddy viscosity .
Definition: freeflow/rans/volumevariables.hh:259
DimVector velocity_
Definition: freeflow/rans/volumevariables.hh:262
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:85
Scalar uStar_
Definition: freeflow/rans/volumevariables.hh:269
std::size_t elementIdx_
Definition: freeflow/rans/volumevariables.hh:265
Scalar eddyDiffusivity_
Definition: freeflow/rans/volumevariables.hh:273
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
DimVector velocityMaximum() const
Return the maximum velocity vector of the wall segment.
Definition: freeflow/rans/volumevariables.hh:126
Scalar kinematicEddyViscosity() const
Return the kinematic eddy viscosity of the flow within the control volume.
Definition: freeflow/rans/volumevariables.hh:183
Scalar effectiveThermalConductivity() const
Returns the effective thermal conductivity of the fluid-flow in the sub-control volume.
Definition: freeflow/rans/volumevariables.hh:250
std::size_t wallElementIdx_
Definition: freeflow/rans/volumevariables.hh:266
Scalar effectiveViscosity() const
Return the effective dynamic viscosity of the fluid within the control volume.
Definition: freeflow/rans/volumevariables.hh:176
Scalar dynamicEddyViscosity_
Definition: freeflow/rans/volumevariables.hh:272
Scalar wallDistance_
Definition: freeflow/rans/volumevariables.hh:267
unsigned int elementIdx() const
Return the element Idx of the control volume.
Definition: freeflow/rans/volumevariables.hh:114
Scalar uPlus_
Definition: freeflow/rans/volumevariables.hh:271
Scalar uPlus() const
Return the dimensionless velocity .
Definition: freeflow/rans/volumevariables.hh:162
DimMatrix velocityGradients() const
Return the velocity gradients at the control volume center.
Definition: freeflow/rans/volumevariables.hh:132