From 228c4ed26248b8e98c80e87b6996a1ab6aaa53cf Mon Sep 17 00:00:00 2001 From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de> Date: Thu, 11 Feb 2016 10:16:13 +0100 Subject: [PATCH] [multidomain][zeroeq] Various small fixes Add Property for maximum number of subdomains Fix Richardson number Fix Indentation --- dumux/freeflow/zeroeqnc/fluxvariables.hh | 7 +------ dumux/multidomain/properties.hh | 3 +++ dumux/multidomain/propertydefaults.hh | 5 ++++- dumux/multidomain/subdomainpropertydefaults.hh | 3 ++- .../2cnistokes2p2cni/2cnistokes2p2cniproblem.hh | 2 +- test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dumux/freeflow/zeroeqnc/fluxvariables.hh b/dumux/freeflow/zeroeqnc/fluxvariables.hh index 5cf4770a33..c35c80eccf 100644 --- a/dumux/freeflow/zeroeqnc/fluxvariables.hh +++ b/dumux/freeflow/zeroeqnc/fluxvariables.hh @@ -101,12 +101,7 @@ public: // Richardson number // Schlichting, Boundary Layer Theory, 1997, p472 - Scalar gravity = 0.0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) - gravity = problem.gravity()[wallNormal_]; - else - gravity = 9.81; - richardsonNumber_ = -gravity / this->density() + richardsonNumber_ = problem.gravity()[wallNormal_] / this->density() * densityGrad()[wallNormal_] / (velGradWall_ * velGradWall_); // calculation of an eddy diffusivity only makes sense with Navier-Stokes equation diff --git a/dumux/multidomain/properties.hh b/dumux/multidomain/properties.hh index 06c04b5740..c76e3cc618 100644 --- a/dumux/multidomain/properties.hh +++ b/dumux/multidomain/properties.hh @@ -49,6 +49,9 @@ NEW_TYPE_TAG(MultiDomain, INHERITS_FROM(ImplicitBase)); //! Specifies the model NEW_PROP_TAG(Model); +//! Specifies the maximum number of sub-problems +NEW_PROP_TAG(MaxSubDomains); + //! Specifies the type tag of the first sub-problem NEW_PROP_TAG(SubDomain1TypeTag); diff --git a/dumux/multidomain/propertydefaults.hh b/dumux/multidomain/propertydefaults.hh index db6a538524..b3f837bac3 100644 --- a/dumux/multidomain/propertydefaults.hh +++ b/dumux/multidomain/propertydefaults.hh @@ -59,11 +59,14 @@ template <class TypeTag> class MultiDomainNewtonController; namespace Properties { +SET_INT_PROP(MultiDomain, MaxSubDomains, 2); + SET_PROP(MultiDomain, MultiDomainGrid) { private: typedef typename GET_PROP_TYPE(TypeTag, Grid) HostGrid; - typedef typename Dune::mdgrid::FewSubDomainsTraits<HostGrid::dimension,4> MDGridTraits; + enum { maxSubDomains = GET_PROP_VALUE(TypeTag, MaxSubDomains) }; + typedef typename Dune::mdgrid::FewSubDomainsTraits<HostGrid::dimension, maxSubDomains> MDGridTraits; public: typedef typename Dune::MultiDomainGrid<HostGrid, MDGridTraits> type; }; diff --git a/dumux/multidomain/subdomainpropertydefaults.hh b/dumux/multidomain/subdomainpropertydefaults.hh index e122717863..6e2d40d263 100644 --- a/dumux/multidomain/subdomainpropertydefaults.hh +++ b/dumux/multidomain/subdomainpropertydefaults.hh @@ -49,7 +49,8 @@ SET_PROP(SubDomain, Grid) private: typedef typename GET_PROP_TYPE(TypeTag, MultiDomainTypeTag) MultiDomain; typedef typename GET_PROP_TYPE(MultiDomain, Grid) HostGrid; - typedef typename Dune::mdgrid::FewSubDomainsTraits<HostGrid::dimension,4> MDGridTraits; + enum { maxSubDomains = GET_PROP_VALUE(MultiDomain, MaxSubDomains) }; + typedef typename Dune::mdgrid::FewSubDomainsTraits<HostGrid::dimension,maxSubDomains> MDGridTraits; typedef typename Dune::MultiDomainGrid<HostGrid, MDGridTraits> Grid; public: typedef typename Grid::SubDomainGrid type; diff --git a/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh b/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh index 4fb12df0b4..4c267d6662 100644 --- a/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh +++ b/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh @@ -135,7 +135,7 @@ public: */ template<class GridView> TwoCNIStokesTwoPTwoCNITestProblem(TimeManager &timeManager, - GridView gridView) + GridView gridView) : ParentType(timeManager, gridView) { interfacePosY_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, InterfacePosY); diff --git a/test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh b/test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh index fa52a61140..f8b64bd5ac 100644 --- a/test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh +++ b/test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh @@ -120,7 +120,7 @@ public: */ template<class GridView> TwoCZeroEqTwoPTwoCTestProblem(TimeManager &timeManager, - GridView gridView) + GridView gridView) : ParentType(timeManager, gridView) { dtInit_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, DtInitial); -- GitLab