24#ifndef DUMUX_SST_PROBLEM_HH
25#define DUMUX_SST_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)
78 storedDynamicEddyViscosity_.resize(this->gridGeometry().elementMapper().size(), 0.0);
79 storedDissipation_.resize(this->gridGeometry().elementMapper().size(), 0.0);
80 storedDissipationGradient_.resize(this->gridGeometry().elementMapper().size(), DimVector(0.0));
81 storedTurbulentKineticEnergy_.resize(this->gridGeometry().elementMapper().size(), 0.0);
82 storedTurbulentKineticEnergyGradient_.resize(this->gridGeometry().elementMapper().size(), DimVector(0.0));
94 for (
const auto& element : elements(this->gridGeometry().gridView()))
96 unsigned int elementIdx = this->gridGeometry().elementMapper().index(element);
98 auto fvGeometry =
localView(this->gridGeometry());
99 fvGeometry.bindElement(element);
100 for (
auto&& scv : scvs(fvGeometry))
102 const int dofIdx = scv.dofIndex();
103 const auto& cellCenterPriVars = curSol[GridGeometry::cellCenterIdx()][dofIdx];
107 storedDissipation_[elementIdx] = elemSol[0][Indices::dissipationEqIdx];
108 storedTurbulentKineticEnergy_[elementIdx] = elemSol[0][Indices::turbulentKineticEnergyEqIdx];
110 VolumeVariables volVars;
111 volVars.update(elemSol, asImp_(), element, scv);
112 storedDynamicEddyViscosity_[elementIdx] = volVars.calculateEddyViscosity(*
this);
117 for (
const auto& element : elements(this->gridGeometry().gridView()))
119 const unsigned int elementIdx = this->gridGeometry().elementMapper().index(element);
121 for (
unsigned int axisIdx = 0; axisIdx < DimVector::dimension; ++axisIdx)
127 storedTurbulentKineticEnergyGradient_[elementIdx][axisIdx]
131 storedDissipationGradient_[elementIdx][axisIdx]
145 {
return storedDynamicEddyViscosity_[elementIdx]; }
148 {
return storedTurbulentKineticEnergy_[elementIdx]; }
151 {
return storedDissipation_[elementIdx]; }
154 {
return storedTurbulentKineticEnergyGradient_[elementIdx]; }
157 {
return storedDissipationGradient_[elementIdx]; }
160 {
return sstModelVersion_; }
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_;
172 Implementation &asImp_()
173 {
return *
static_cast<Implementation *
>(
this); }
176 const Implementation &asImp_()
const
177 {
return *
static_cast<const Implementation *
>(
this); }
Base class for all staggered fv problems.
The available free flow turbulence models in Dumux.
The available discretization methods in Dumux.
Free function to get the local view of a grid cache object.
TurbulenceModel
The available free flow turbulence models in Dumux.
Definition turbulencemodel.hh:38
@ sst
Definition turbulencemodel.hh:39
SSTModel
The available variations of the SST Turbulence Model.
Definition turbulencemodel.hh:75
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==DiscretizationMethods::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:161
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:150
SSTModel sstModelFromString(const std::string &sstModel)
Convenience function to convert user input given as std::string to the corresponding enum class used ...
Definition turbulencemodel.hh:94
void updateDynamicWallProperties(const SolutionVector &curSol)
Update the dynamic (solution dependent) turbulence parameters.
Definition freeflow/rans/problem.hh:144
void updateStaticWallProperties()
Update the static (solution independent) relations to the walls and neighbors.
Definition freeflow/rans/problem.hh:129
GlobalPosition cellCenter(const int elementIdx) const
Definition freeflow/rans/problem.hh:280
unsigned int neighborIndex(const int elementIdx, const int axisIdx, const int sideIdx) const
Definition freeflow/rans/problem.hh:286
RANSProblemBase(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor.
Definition freeflow/rans/problem.hh:104
DimVector storedDissipationGradient(const int elementIdx) const
Definition freeflow/rans/twoeq/sst/problem.hh:156
bool useStoredEddyViscosity() const
Definition freeflow/rans/twoeq/sst/problem.hh:138
void updateStaticWallProperties()
Correct size of the static (solution independent) wall variables.
Definition freeflow/rans/twoeq/sst/problem.hh:74
void updateDynamicWallProperties(const SolutionVector &curSol)
Update the dynamic (solution dependent) relations to the walls.
Definition freeflow/rans/twoeq/sst/problem.hh:90
Scalar storedDynamicEddyViscosity(const int elementIdx) const
Definition freeflow/rans/twoeq/sst/problem.hh:144
Scalar storedTurbulentKineticEnergy(const int elementIdx) const
Definition freeflow/rans/twoeq/sst/problem.hh:147
DimVector storedTurbulentKineticEnergyGradient(const int elementIdx) const
Definition freeflow/rans/twoeq/sst/problem.hh:153
RANSProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
Definition freeflow/rans/twoeq/sst/problem.hh:65
Scalar storedDissipation(const int elementIdx) const
Definition freeflow/rans/twoeq/sst/problem.hh:150
SSTModel sstModelVersion() const
Definition freeflow/rans/twoeq/sst/problem.hh:159
A single-phase, isothermal SST (Shear Stress Transport) -Eq. model.
the turbulence-model-specfic RANS problem
The local element solution class for staggered methods.
Declares all properties used in Dumux.