12#ifndef DUMUX_ONEEQ_PROBLEM_HH
13#define DUMUX_ONEEQ_PROBLEM_HH
33template<
class TypeTag>
40 using Grid =
typename GridView::Grid;
43 using DimVector = Dune::FieldVector<Scalar, Grid::dimension>;
47 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
68 storedDynamicEddyViscosity_.resize(this->
gridGeometry().elementMapper().size(), 0.0);
69 storedViscosityTilde_.resize(this->
gridGeometry().elementMapper().size(), 0.0);
70 storedViscosityTildeGradient_.resize(this->
gridGeometry().elementMapper().size(), DimVector(0.0));
78 template<
class SolutionVector>
84 for (
const auto& element : elements(this->
gridGeometry().gridView()))
86 unsigned int elementIdx = this->
gridGeometry().elementMapper().index(element);
87 fvGeometry.bindElement(element);
89 for (
auto&& scv : scvs(fvGeometry))
91 const int dofIdx = scv.dofIndex();
92 const auto& cellCenterPriVars = curSol[GridGeometry::cellCenterIdx()][dofIdx];
96 storedViscosityTilde_[elementIdx] = elemSol[0][Indices::viscosityTildeIdx];
98 VolumeVariables volVars;
99 volVars.update(elemSol, asImp_(), element, scv);
100 storedDynamicEddyViscosity_[elementIdx] = volVars.calculateEddyViscosity();
105 for (
const auto& element : elements(this->
gridGeometry().gridView()))
107 const unsigned int elementIdx = this->
gridGeometry().elementMapper().index(element);
108 fvGeometry.bindElement(element);
110 for (
unsigned int axisIdx = 0; axisIdx < Grid::dimension; ++axisIdx)
116 storedViscosityTildeGradient_[elementIdx][axisIdx]
122 for (
auto&& scvf : scvfs(fvGeometry))
124 const unsigned int normDim = scvf.directionIndex();
125 if (scvf.boundary() && asImp_().
boundaryTypes(element, scvf).isDirichlet(Indices::viscosityTildeIdx))
128 Scalar dirichletViscosityTilde = asImp_().dirichlet(element, scvf)[Indices::viscosityTildeIdx];
134 storedViscosityTildeGradient_[elementIdx][normDim]
149 {
return storedDynamicEddyViscosity_[elementIdx]; }
152 {
return storedViscosityTilde_[elementIdx]; }
155 {
return storedViscosityTildeGradient_[elementIdx]; }
158 std::vector<Scalar> storedDynamicEddyViscosity_;
159 std::vector<Scalar> storedViscosityTilde_;
160 std::vector<DimVector> storedViscosityTildeGradient_;
163 Implementation &asImp_()
164 {
return *
static_cast<Implementation *
>(
this); }
167 const Implementation &asImp_()
const
168 {
return *
static_cast<const Implementation *
>(
this); }
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition common/fvproblem.hh:524
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition common/fvproblem.hh:520
auto boundaryTypes(const Element &element, const SubControlVolume &scv) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition common/fvproblem.hh:126
void updateDynamicWallProperties(const SolutionVector &curSol)
Update the dynamic (solution dependent) turbulence parameters.
Definition freeflow/rans/problem.hh:131
void updateStaticWallProperties()
Update the static (solution independent) relations to the walls and neighbors.
Definition freeflow/rans/problem.hh:115
GlobalPosition cellCenter(const int elementIdx) const
Definition freeflow/rans/problem.hh:256
unsigned int neighborIndex(const int elementIdx, const int axisIdx, const int sideIdx) const
Definition freeflow/rans/problem.hh:262
RANSProblemBase(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor.
Definition freeflow/rans/problem.hh:90
void updateStaticWallProperties()
Correct size of the static (solution independent) wall variables.
Definition freeflow/rans/oneeq/problem.hh:63
bool useStoredEddyViscosity() const
Definition freeflow/rans/oneeq/problem.hh:142
void updateDynamicWallProperties(const SolutionVector &curSol)
Update the dynamic (solution dependent) relations to the walls.
Definition freeflow/rans/oneeq/problem.hh:79
Scalar storedViscosityTilde(const int elementIdx) const
Definition freeflow/rans/oneeq/problem.hh:151
RANSProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup="")
The constructor sets the gravity, if desired by the user.
Definition freeflow/rans/oneeq/problem.hh:56
DimVector storedViscosityTildeGradient(const int elementIdx) const
Definition freeflow/rans/oneeq/problem.hh:154
Scalar storedDynamicEddyViscosity(const int elementIdx) const
Definition freeflow/rans/oneeq/problem.hh:148
Defines all properties used in Dumux.
A single-phase, isothermal one-equation turbulence model by Spalart-Allmaras.
the turbulence-model-specfic RANS problem
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition localview.hh:26
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::cctpfa||GridGeometry::discMethod==DiscretizationMethods::ccmpfa, CCElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for cell-centered schemes.
Definition cellcentered/elementsolution.hh:101
TurbulenceModel
The available free flow turbulence models in Dumux.
Definition turbulencemodel.hh:26
@ oneeq
Definition turbulencemodel.hh:27
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:149
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
PrimaryVariables makePriVarsFromCellCenterPriVars(const CellCenterPrimaryVariables &cellCenterPriVars)
Helper function to create a PrimaryVariables object from CellCenterPrimaryVariables.
Definition staggered/elementsolution.hh:29
Free function to get the local view of a grid cache object.
The available discretization methods in Dumux.
The local element solution class for staggered methods.
Base class for all staggered fv problems.
The available free flow turbulence models in Dumux.