diff --git a/dumux/freeflow/rans/oneeq/problem.hh b/dumux/freeflow/rans/oneeq/problem.hh index 6788b7506b083b4a6c6b570378d094365bf32381..9198797847e6fcb3e3b7ba4a5cd5825520b1a83d 100644 --- a/dumux/freeflow/rans/oneeq/problem.hh +++ b/dumux/freeflow/rans/oneeq/problem.hh @@ -65,8 +65,8 @@ class OneEqProblem : public RANSProblem<TypeTag> public: //! The constructor sets the gravity, if desired by the user. - OneEqProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) - : ParentType(fvGridGeometry) + OneEqProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "") + : ParentType(fvGridGeometry, paramGroup) { useStoredEddyViscosity_ = getParamFromGroup<bool>(this->paramGroup(), "RANS.UseStoredEddyViscosity", false); diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh index a886af7141d6ae9365f823e43ff94152137332a4..468194bb86845e5657616efdba90aa13eca3dcde 100644 --- a/dumux/freeflow/rans/problem.hh +++ b/dumux/freeflow/rans/problem.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_RANS_PROBLEM_HH #define DUMUX_RANS_PROBLEM_HH +#include <dune/common/fmatrix.hh> #include <dumux/common/properties.hh> #include <dumux/common/staggeredfvproblem.hh> #include <dumux/discretization/localview.hh> @@ -49,24 +50,22 @@ class RANSProblem : public NavierStokesProblem<TypeTag> using ParentType = NavierStokesProblem<TypeTag>; using Implementation = typename GET_PROP_TYPE(TypeTag, Problem); - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Grid = typename GridView::Grid; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; + using FVElementGeometry = typename FVGridGeometry::LocalView; + using GridView = typename FVGridGeometry::GridView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); + using PrimaryVariables = typename VolumeVariables::PrimaryVariables; using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - enum { - dim = Grid::dimension, - }; using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; - using DimVector = Dune::FieldVector<Scalar, dim>; + + static constexpr auto dim = GridView::dimension; + using DimVector = GlobalPosition; using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>; public: diff --git a/dumux/freeflow/rans/twoeq/kepsilon/problem.hh b/dumux/freeflow/rans/twoeq/kepsilon/problem.hh index f22d5b088e07f04cc7b4928b56603e641b0d147e..ef99fbaaff5b669dd065c40a6302efec27f320fe 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/problem.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/problem.hh @@ -83,8 +83,8 @@ public: static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); //! The constructor sets the gravity, if desired by the user. - KEpsilonProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) - : ParentType(fvGridGeometry) + KEpsilonProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "") + : ParentType(fvGridGeometry, paramGroup) { yPlusThreshold_ = getParamFromGroup<Scalar>(this->paramGroup(), "KEpsilon.YPlusThreshold", 30); useStoredEddyViscosity_ = getParamFromGroup<bool>(this->paramGroup(), "RANS.UseStoredEddyViscosity", false); diff --git a/dumux/freeflow/rans/twoeq/komega/problem.hh b/dumux/freeflow/rans/twoeq/komega/problem.hh index 05c6d95d000a56035c7ed5ade3ab5379e68ff7a0..a4ee39561e6793931e99417861f72b8fede6260e 100644 --- a/dumux/freeflow/rans/twoeq/komega/problem.hh +++ b/dumux/freeflow/rans/twoeq/komega/problem.hh @@ -52,7 +52,6 @@ class KOmegaProblem : public RANSProblem<TypeTag> using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); @@ -60,17 +59,12 @@ class KOmegaProblem : public RANSProblem<TypeTag> using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Grid = typename GridView::Grid; - enum { - dim = Grid::dimension, - }; - using GlobalPosition = Dune::FieldVector<Scalar, dim>; - using DimVector = Dune::FieldVector<Scalar, dim>; - using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>; + using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity; + using DimVector = typename Element::Geometry::GlobalCoordinate; public: - KOmegaProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry) + KOmegaProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "") + : ParentType(fvGridGeometry, paramGroup) { useStoredEddyViscosity_ = getParamFromGroup<bool>(this->paramGroup(), "RANS.UseStoredEddyViscosity", false); } @@ -126,7 +120,7 @@ public: { unsigned int elementIdx = this->fvGridGeometry().elementMapper().index(element); - for (unsigned int dimIdx = 0; dimIdx < dim; ++dimIdx) + for (unsigned int dimIdx = 0; dimIdx < DimVector::dimension; ++dimIdx) { unsigned backwardNeighbor = ParentType::neighborIdx_[elementIdx][dimIdx][0]; unsigned forwardNeighbor = ParentType::neighborIdx_[elementIdx][dimIdx][1]; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh index 742b6e790ccd69081d348555c92fd80ba2f2e9b9..34d30266e6ad82f903ba145fa269c0623d1eb041 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh @@ -52,7 +52,6 @@ class LowReKEpsilonProblem : public RANSProblem<TypeTag> using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView; - using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); @@ -62,8 +61,8 @@ class LowReKEpsilonProblem : public RANSProblem<TypeTag> public: //! The constructor sets the gravity, if desired by the user. - LowReKEpsilonProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) - : ParentType(fvGridGeometry) + LowReKEpsilonProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "") + : ParentType(fvGridGeometry, paramGroup) { useStoredEddyViscosity_ = getParamFromGroup<bool>(this->paramGroup(), "RANS.UseStoredEddyViscosity", true); }