24#ifndef DUMUX_KOMEGA_PROBLEM_HH
25#define DUMUX_KOMEGA_PROBLEM_HH
45template<
class TypeTag>
61 using Element =
typename GridGeometry::GridView::template Codim<0>::Entity;
62 using DimVector =
typename Element::Geometry::GlobalCoordinate;
65 RANSProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
const std::string& paramGroup =
"")
66 : ParentType(gridGeometry, paramGroup)
77 storedDynamicEddyViscosity_.resize(this->gridGeometry().elementMapper().size(), 0.0);
78 storedDissipation_.resize(this->gridGeometry().elementMapper().size(), 0.0);
79 storedDissipationGradient_.resize(this->gridGeometry().elementMapper().size(), DimVector(0.0));
80 storedTurbulentKineticEnergy_.resize(this->gridGeometry().elementMapper().size(), 0.0);
81 storedTurbulentKineticEnergyGradient_.resize(this->gridGeometry().elementMapper().size(), DimVector(0.0));
93 for (
const auto& element : elements(this->gridGeometry().gridView()))
95 unsigned int elementIdx = this->gridGeometry().elementMapper().index(element);
97 auto fvGeometry =
localView(this->gridGeometry());
98 fvGeometry.bindElement(element);
99 for (
auto&& scv : scvs(fvGeometry))
101 const int dofIdx = scv.dofIndex();
102 const auto& cellCenterPriVars = curSol[GridGeometry::cellCenterIdx()][dofIdx];
106 storedDissipation_[elementIdx] = elemSol[0][Indices::dissipationEqIdx];
107 storedTurbulentKineticEnergy_[elementIdx] = elemSol[0][Indices::turbulentKineticEnergyEqIdx];
109 VolumeVariables volVars;
110 volVars.update(elemSol, asImp_(), element, scv);
111 storedDynamicEddyViscosity_[elementIdx] = volVars.calculateEddyViscosity(*
this);
116 for (
const auto& element : elements(this->gridGeometry().gridView()))
118 const unsigned int elementIdx = this->gridGeometry().elementMapper().index(element);
120 for (
unsigned int dimIdx = 0; dimIdx < DimVector::dimension; ++dimIdx)
126 storedTurbulentKineticEnergyGradient_[elementIdx][dimIdx]
130 storedDissipationGradient_[elementIdx][dimIdx]
148 {
return storedDynamicEddyViscosity_[elementIdx]; }
151 {
return storedTurbulentKineticEnergy_[elementIdx]; }
154 {
return storedDissipation_[elementIdx]; }
157 {
return storedTurbulentKineticEnergyGradient_[elementIdx]; }
160 {
return storedDissipationGradient_[elementIdx]; }
163 std::vector<Scalar> storedDynamicEddyViscosity_;
164 std::vector<Scalar> storedTurbulentKineticEnergy_;
165 std::vector<Scalar> storedDissipation_;
166 std::vector<DimVector> storedDissipationGradient_;
167 std::vector<DimVector> storedTurbulentKineticEnergyGradient_;
170 Implementation &asImp_()
171 {
return *
static_cast<Implementation *
>(
this); }
174 const Implementation &asImp_()
const
175 {
return *
static_cast<const Implementation *
>(
this); }
Base class for all staggered fv problems.
Free function to get the local view of a grid cache object.
The available discretization methods in Dumux.
The available free flow turbulence models in Dumux.
TurbulenceModel
The available free flow turbulence models in Dumux.
Definition turbulencemodel.hh:37
@ komega
Definition turbulencemodel.hh:38
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition localview.hh:38
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethod::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition box/elementsolution.hh:118
PrimaryVariables makePriVarsFromCellCenterPriVars(const CellCenterPrimaryVariables &cellCenterPriVars)
Helper function to create a PrimaryVariables object from CellCenterPrimaryVariables.
Definition staggered/elementsolution.hh:41
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:358
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:150
void updateDynamicWallProperties(const SolutionVector &curSol)
Update the dynamic (solution dependent) relations to the walls.
Definition freeflow/rans/problem.hh:246
void updateStaticWallProperties()
Update the static (solution independent) relations to the walls.
Definition freeflow/rans/problem.hh:112
GlobalPosition cellCenter(const int elementIdx) const
Definition freeflow/rans/problem.hh:386
unsigned int neighborIndex(const int elementIdx, const int dimIdx, const int sideIdx) const
Definition freeflow/rans/problem.hh:389
RANSProblemBase(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor.
Definition freeflow/rans/problem.hh:102
Scalar storedTurbulentKineticEnergy(const int elementIdx) const
Definition freeflow/rans/twoeq/komega/problem.hh:150
void updateDynamicWallProperties(const SolutionVector &curSol)
Update the dynamic (solution dependent) relations to the walls.
Definition freeflow/rans/twoeq/komega/problem.hh:89
bool useStoredEddyViscosity() const
Definition freeflow/rans/twoeq/komega/problem.hh:141
Scalar storedDynamicEddyViscosity(const int elementIdx) const
Definition freeflow/rans/twoeq/komega/problem.hh:147
void updateStaticWallProperties()
Correct size of the static (solution independent) wall variables.
Definition freeflow/rans/twoeq/komega/problem.hh:72
DimVector storedTurbulentKineticEnergyGradient(const int elementIdx) const
Definition freeflow/rans/twoeq/komega/problem.hh:156
DimVector storedDissipationGradient(const int elementIdx) const
Definition freeflow/rans/twoeq/komega/problem.hh:159
RANSProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
Definition freeflow/rans/twoeq/komega/problem.hh:65
Scalar storedDissipation(const int elementIdx) const
Definition freeflow/rans/twoeq/komega/problem.hh:153
const Scalar betaOmega() const
Returns the constant.
Definition freeflow/rans/twoeq/komega/problem.hh:138
Declares all properties used in Dumux.
A single-phase, isothermal k-omega 2-Eq. model.
the turbulence-model-specfic RANS problem
The local element solution class for staggered methods.