13#ifndef DUMUX_RANS_VOLUME_VARIABLES_HH 
   14#define DUMUX_RANS_VOLUME_VARIABLES_HH 
   16#include <dune/common/fvector.hh> 
   17#include <dune/common/fmatrix.hh> 
   27template <
class Traits, 
class NSVolumeVariables>
 
   29: 
public NSVolumeVariables
 
   31    using NavierStokesParentType = NSVolumeVariables;
 
   33    using Scalar = 
typename Traits::PrimaryVariables::value_type;
 
   35    enum { dimWorld = Traits::ModelTraits::dim() };
 
   36    using DimVector = Dune::FieldVector<Scalar, dimWorld>;
 
   37    using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
 
   39    static constexpr bool enableEnergyBalance = Traits::ModelTraits::enableEnergyBalance();
 
   52    template<
class ElementSolution, 
class Problem, 
class Element, 
class SubControlVolume>
 
   54                                   const Problem &problem,
 
   55                                   const Element &element,
 
   56                                   const SubControlVolume& scv)
 
   58        NavierStokesParentType::update(elemSol, problem, element, scv);
 
 
   72    template<
class ElementSolution, 
class Problem, 
class Element, 
class SubControlVolume>
 
   74                              const Problem &problem,
 
   75                              const Element &element,
 
   76                              const SubControlVolume& scv)
 
   83        elementIdx_ = problem.gridGeometry().elementMapper().index(element);
 
   91        if (problem.isFlatWallBounded())
 
   93            const auto flowDirectionAxis = problem.flowDirectionAxis(
elementIdx_);
 
   94            const auto wallNormalAxis = problem.wallNormalAxis(
elementIdx_);
 
   98                        * abs(problem.velocityGradient(problem.wallElementIndex(
elementIdx_), flowDirectionAxis, wallNormalAxis)));
 
 
  191    { 
return NavierStokesParentType::viscosity() / NavierStokesParentType::density(); }
 
 
  197    template<
class Problem>
 
  201                           / problem.turbulentSchmidtNumber();
 
 
  208    template<
class Problem, 
bool eB = enableEnergyBalance, 
typename std::enable_if_t<eB, 
int> = 0>
 
  212                                   * NavierStokesParentType::density()
 
  213                                   * NavierStokesParentType::heatCapacity()
 
  214                                   / problem.turbulentPrandtlNumber();
 
 
  218    template<
class Problem, 
bool eB = enableEnergyBalance, 
typename std::enable_if_t<!eB, 
int> = 0>
 
  238    { 
return NavierStokesParentType::diffusionCoefficient(0, compIIdx, compJIdx) + 
eddyDiffusivity(); }
 
 
  244    template<
bool eB = enableEnergyBalance, 
typename std::enable_if_t<eB, 
int> = 0>
 
 
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 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:265
Scalar yPlus() const
Return the dimensionless wall distance .
Definition freeflow/rans/volumevariables.hh:156
Scalar eddyThermalConductivity_
Definition freeflow/rans/volumevariables.hh:269
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 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:258
Scalar uStar() const
Return the wall friction velocity .
Definition freeflow/rans/volumevariables.hh:150
Scalar karmanConstant_
Definition freeflow/rans/volumevariables.hh:263
DimVector ccVelocityVector() const
Return the velocity vector  at the control volume center.
Definition freeflow/rans/volumevariables.hh:114
Scalar setDynamicEddyViscosity_(Scalar value)
Sets the dynamic eddy viscosity .
Definition freeflow/rans/volumevariables.hh:254
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition freeflow/rans/volumevariables.hh:237
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
Scalar uStar_
Definition freeflow/rans/volumevariables.hh:264
std::size_t elementIdx_
Definition freeflow/rans/volumevariables.hh:261
Scalar eddyDiffusivity_
Definition freeflow/rans/volumevariables.hh:268
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:120
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:245
DimVector velocityMinimum() const
Return the minimum velocity vector  of the wall segment.
Definition freeflow/rans/volumevariables.hh:126
DimVector ccVelocityVector_
Definition freeflow/rans/volumevariables.hh:257
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:267
Scalar wallDistance_
Definition freeflow/rans/volumevariables.hh:262
unsigned int elementIdx() const
Return the element Idx of the control volume.
Definition freeflow/rans/volumevariables.hh:108
Scalar uPlus_
Definition freeflow/rans/volumevariables.hh:266
Scalar uPlus() const
Return the dimensionless velocity .
Definition freeflow/rans/volumevariables.hh:162
DimVector velocityMinimum_
Definition freeflow/rans/volumevariables.hh:259
DimMatrix velocityGradientTensor_
Definition freeflow/rans/volumevariables.hh:260
DimMatrix velocityGradients() const
Return the velocity gradients  at the control volume center.
Definition freeflow/rans/volumevariables.hh:132
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.