12#ifndef DUMUX_LOWREKEPSILON_PROBLEM_HH
13#define DUMUX_LOWREKEPSILON_PROBLEM_HH
33template<
class TypeTag>
50 RANSProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
const std::string& paramGroup =
"")
59 ParentType::updateStaticWallProperties();
62 storedDissipationTilde_.resize(this->gridGeometry().elementMapper().size(), 0.0);
63 storedDynamicEddyViscosity_.resize(this->gridGeometry().elementMapper().size(), 0.0);
64 storedTurbulentKineticEnergy_.resize(this->gridGeometry().elementMapper().size(), 0.0);
72 template<
class SolutionVector>
75 ParentType::updateDynamicWallProperties(curSol);
77 auto fvGeometry =
localView(this->gridGeometry());
78 for (
const auto& element : elements(this->gridGeometry().gridView()))
80 unsigned int elementIdx = this->gridGeometry().elementMapper().index(element);
81 fvGeometry.bindElement(element);
83 for (
auto&& scv : scvs(fvGeometry))
85 const int dofIdx = scv.dofIndex();
86 const auto& cellCenterPriVars = curSol[GridGeometry::cellCenterIdx()][dofIdx];
87 PrimaryVariables priVars = makePriVarsFromCellCenterPriVars<PrimaryVariables>(cellCenterPriVars);
88 auto elemSol = elementSolution<typename GridGeometry::LocalView>(std::move(priVars));
90 storedDissipationTilde_[elementIdx] = elemSol[0][Indices::dissipationEqIdx];
91 storedTurbulentKineticEnergy_[elementIdx] = elemSol[0][Indices::turbulentKineticEnergyEqIdx];
93 VolumeVariables volVars;
94 volVars.update(elemSol, asImp_(), element, scv);
95 storedDynamicEddyViscosity_[elementIdx] = volVars.calculateEddyViscosity();
102 static const bool useStoredEddyViscosity = getParamFromGroup<bool>(this->paramGroup(),
"RANS.UseStoredEddyViscosity",
true);
103 return useStoredEddyViscosity;
107 {
return storedDissipationTilde_[elementIdx]; }
110 {
return storedDynamicEddyViscosity_[elementIdx]; }
113 {
return storedTurbulentKineticEnergy_[elementIdx]; }
116 std::vector<Scalar> storedDissipationTilde_;
117 std::vector<Scalar> storedDynamicEddyViscosity_;
118 std::vector<Scalar> storedTurbulentKineticEnergy_;
121 Implementation &asImp_()
122 {
return *
static_cast<Implementation *
>(
this); }
125 const Implementation &asImp_()
const
126 {
return *
static_cast<const Implementation *
>(
this); }
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:43
Reynolds-Averaged Navier-Stokes problem base class.
Definition: freeflow/rans/problem.hh:47
Scalar storedDissipationTilde(const int elementIdx) const
Definition: freeflow/rans/twoeq/lowrekepsilon/problem.hh:106
void updateDynamicWallProperties(const SolutionVector &curSol)
Update the dynamic (solution dependent) relations to the walls.
Definition: freeflow/rans/twoeq/lowrekepsilon/problem.hh:73
void updateStaticWallProperties()
Correct size of the static (solution independent) wall variables.
Definition: freeflow/rans/twoeq/lowrekepsilon/problem.hh:57
RANSProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor sets the gravity, if desired by the user.
Definition: freeflow/rans/twoeq/lowrekepsilon/problem.hh:50
Scalar storedTurbulentKineticEnergy(const int elementIdx) const
Definition: freeflow/rans/twoeq/lowrekepsilon/problem.hh:112
Scalar storedDynamicEddyViscosity(const int elementIdx) const
Definition: freeflow/rans/twoeq/lowrekepsilon/problem.hh:109
bool useStoredEddyViscosity() const
Definition: freeflow/rans/twoeq/lowrekepsilon/problem.hh:100
forward declare
Definition: freeflow/rans/problem.hh:31
Defines all properties used in Dumux.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
TurbulenceModel
The available free flow turbulence models in Dumux.
Definition: turbulencemodel.hh:26
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
Free function to get the local view of a grid cache object.
The available discretization methods in Dumux.
Adaption of the fully implicit scheme to the tracer transport model.
The local element solution class for staggered methods.
Base class for all staggered fv problems.
The available free flow turbulence models in Dumux.