diff --git a/dumux/common/parameters.hh b/dumux/common/parameters.hh index 8ac9c24e7584ef074db4998117692ac4e711788d..f0fe7178c05bd153cce4bdcefeaa59185860a13f 100644 --- a/dumux/common/parameters.hh +++ b/dumux/common/parameters.hh @@ -232,6 +232,7 @@ private: // parameters in the problem group params["Problem.EnableGravity"] = "true"; + params["Problem.EnableInertiaTerms"] = "true"; // parameters in the Newton group params["Newton.MaxSteps"] = "18"; diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index 456e4c552f84f96d34e51c4c6036ef78e1d0c71d..1dac2c41ab26b7f15878bbb95f9b46c74fe264b5 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -188,7 +188,6 @@ NEW_PROP_TAG(SherwoodFormulation); // Properties used by free flow models ///////////////////////////////////////////////////////////// -NEW_PROP_TAG(EnableInertiaTerms); //!< Returns whether to include inertia terms in the momentum balance eq or not (Stokes / Navier-Stokes) NEW_PROP_TAG(NormalizePressure); //!< Returns whether to normalize the pressure term in the momentum balance or not ///////////////////////////////////////////////////////////// diff --git a/dumux/freeflow/compositional/navierstokesncmodel.hh b/dumux/freeflow/compositional/navierstokesncmodel.hh index a4c28bd3ba7bfd6b77b767dd928a1189cd3f8626..8b1e608675c5a6fedc4a37f1eba55b7473bd4345 100644 --- a/dumux/freeflow/compositional/navierstokesncmodel.hh +++ b/dumux/freeflow/compositional/navierstokesncmodel.hh @@ -152,7 +152,6 @@ public: SET_BOOL_PROP(NavierStokesNC, UseMoles, false); //!< Defines whether molar (true) or mass (false) density is used SET_INT_PROP(NavierStokesNC, ReplaceCompEqIdx, 0); //<! Set the ReplaceCompEqIdx to 0 by default -SET_BOOL_PROP(NavierStokesNC, EnableInertiaTerms, true); //!< Consider inertia terms by default SET_BOOL_PROP(NavierStokesNC, NormalizePressure, true); //!< Normalize the pressure term in the momentum balance by default //! The local residual diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index cf67e919bb18e25b2051d75a852741026310593f..0cac3cf664da088ddc581604ef9430fdaeaea0be 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -159,7 +159,6 @@ NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes)); /////////////////////////////////////////////////////////////////////////// // default property values for the isothermal single phase model /////////////////////////////////////////////////////////////////////////// -SET_BOOL_PROP(NavierStokes, EnableInertiaTerms, true); //!< Consider inertia terms by default SET_BOOL_PROP(NavierStokes, NormalizePressure, true); //!< Normalize the pressure term in the momentum balance by default //!< states some specifics of the Navier-Stokes model diff --git a/dumux/freeflow/navierstokes/problem.hh b/dumux/freeflow/navierstokes/problem.hh index 75572cfa64a75140ffd7d0cfc3e11363305366bd..b7e293907e659c6bf028f293325a72c6a9c9f150 100644 --- a/dumux/freeflow/navierstokes/problem.hh +++ b/dumux/freeflow/navierstokes/problem.hh @@ -100,6 +100,8 @@ public: { if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity")) gravity_[dim-1] = -9.81; + + enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms"); } /*! @@ -130,6 +132,12 @@ public: const GravityVector& gravity() const { return gravity_; } + /*! + * \brief Returns whether interia terms should be considered. + */ + bool enableInertiaTerms() const + { return enableInertiaTerms_; } + //! Applys the initial face solution (velocities on the faces). Specialization for staggered grid discretization. template <class G = FVGridGeometry> typename std::enable_if<G::discMethod == DiscretizationMethod::staggered, void>::type @@ -246,6 +254,7 @@ private: { return *static_cast<const Implementation *>(this); } GravityVector gravity_; + bool enableInertiaTerms_; }; } // end namespace Dumux diff --git a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh index 84bf734ffa27b0e8753c26e1952c238c9e5cab43..657639ce3ed1a04ce9730dad61ef09088b982c42 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh @@ -74,7 +74,6 @@ class NavierStokesFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered> using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - static constexpr bool enableInertiaTerms = GET_PROP_VALUE(TypeTag, EnableInertiaTerms); static constexpr bool normalizePressure = GET_PROP_VALUE(TypeTag, NormalizePressure); using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -199,7 +198,7 @@ public: const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()]; // Advective flux. - if(enableInertiaTerms) + if (problem.enableInertiaTerms()) { // Get the average velocity at the center of the element (i.e. the location of the staggered face). const Scalar transportingVelocity = (velocitySelf + velocityOpposite) * 0.5; @@ -329,7 +328,7 @@ public: } // If there is no symmetry or Neumann boundary condition for the given sub face, proceed to calculate the tangential momentum flux. - if(enableInertiaTerms) + if (problem.enableInertiaTerms()) normalFlux += computeAdvectivePartOfLateralMomentumFlux_(problem, element, scvf, normalFace, elemVolVars, faceVars, localSubFaceIdx, bcTypes); normalFlux += computeDiffusivePartOfLateralMomentumFlux_(problem, element, scvf, normalFace, elemVolVars, faceVars, localSubFaceIdx, bcTypes); @@ -557,7 +556,7 @@ private: FacePrimaryVariables inOrOutflow(0.0); // Advective momentum flux. - if(enableInertiaTerms) + if (problem.enableInertiaTerms()) { const Scalar velocitySelf = elemFaceVars[scvf].velocitySelf(); const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()]; diff --git a/dumux/freeflow/rans/model.hh b/dumux/freeflow/rans/model.hh index 3532e1320a7e0e8b12404c8ec0e6193a3bc36593..62232a86d3bf0ac8f827b626f4b7110a426638c2 100644 --- a/dumux/freeflow/rans/model.hh +++ b/dumux/freeflow/rans/model.hh @@ -60,8 +60,6 @@ NEW_TYPE_TAG(RANS, INHERITS_FROM(NavierStokes)); /////////////////////////////////////////////////////////////////////////// // default property values for the isothermal single phase model /////////////////////////////////////////////////////////////////////////// -SET_BOOL_PROP(RANS, EnableInertiaTerms, true); //!< Explicitly force the consideration of inertia terms by default - /*! * \ingroup RANSModel * \brief Traits for the Reynolds-averaged Navier-Stokes model