From c2ae942f94e6853604045043820d7b0ba210fe54 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Wed, 4 Nov 2015 17:10:15 +0100 Subject: [PATCH] [implicit] Let models only modify/set their own TypeTag The defaults modified properties of Parent TypeTag like BoxModel and NonIsothermal. This leads to conflicts if one uses more than one model in a problem. Now all models only set their respective TypeTags and property defaults. --- dumux/implicit/1p/1ppropertydefaults.hh | 28 ++++++++--------- dumux/implicit/1p2c/1p2cpropertydefaults.hh | 28 ++++++++--------- dumux/implicit/2p/2ppropertydefaults.hh | 4 +-- dumux/implicit/2p2c/2p2cpropertydefaults.hh | 4 +-- dumux/implicit/2pnc/2pncpropertydefaults.hh | 2 +- dumux/implicit/3p/3ppropertydefaults.hh | 2 +- dumux/implicit/3p3c/3p3cpropertydefaults.hh | 2 +- .../richards/richardspropertydefaults.hh | 30 +++++++++---------- 8 files changed, 49 insertions(+), 51 deletions(-) diff --git a/dumux/implicit/1p/1ppropertydefaults.hh b/dumux/implicit/1p/1ppropertydefaults.hh index fb927d1de5..d09f679cca 100644 --- a/dumux/implicit/1p/1ppropertydefaults.hh +++ b/dumux/implicit/1p/1ppropertydefaults.hh @@ -51,23 +51,23 @@ namespace Dumux // default property values for the isothermal single phase model /////////////////////////////////////////////////////////////////////////// namespace Properties { -SET_INT_PROP(OneP, NumEq, GET_PROP_VALUE(TypeTag, IsothermalNumEq)); //!< set the number of equations to 1 +SET_INT_PROP(OneP, NumEq, 1); //!< set the number of equations to 1 SET_INT_PROP(OneP, NumPhases, 1); //!< The number of phases in the 1p model is 1 //! The local residual function -SET_TYPE_PROP(OneP, LocalResidual, typename GET_PROP_TYPE(TypeTag, IsothermalLocalResidual)); +SET_TYPE_PROP(OneP, LocalResidual, OnePLocalResidual<TypeTag>); //! the Model property -SET_TYPE_PROP(OneP, Model, typename GET_PROP_TYPE(TypeTag, IsothermalModel)); +SET_TYPE_PROP(OneP, Model, OnePModel<TypeTag>); //! the VolumeVariables property -SET_TYPE_PROP(OneP, VolumeVariables, typename GET_PROP_TYPE(TypeTag, IsothermalVolumeVariables)); +SET_TYPE_PROP(OneP, VolumeVariables, OnePVolumeVariables<TypeTag>); //! the FluxVariables property -SET_TYPE_PROP(OneP, FluxVariables, typename GET_PROP_TYPE(TypeTag, IsothermalFluxVariables)); +SET_TYPE_PROP(OneP, FluxVariables, ImplicitDarcyFluxVariables<TypeTag>); //! The indices required by the isothermal single-phase model -SET_TYPE_PROP(OneP, Indices, typename GET_PROP_TYPE(TypeTag, IsothermalIndices)); +SET_TYPE_PROP(OneP, Indices, OnePIndices); //! The spatial parameters to be employed. //! Use ImplicitSpatialParamsOneP by default. @@ -116,10 +116,10 @@ SET_BOOL_PROP(OneP, ProblemEnableGravity, true); // Actually the Forchheimer coefficient is also a function of the dimensions of the // porous medium. Taking it as a constant is only a first approximation // (Nield, Bejan, Convection in porous media, 2006, p. 10) -SET_SCALAR_PROP(BoxModel, SpatialParamsForchCoeff, 0.55); +SET_SCALAR_PROP(OneP, SpatialParamsForchCoeff, 0.55); //! average is used as default model to compute the effective thermal heat conductivity -SET_PROP(NonIsothermal, ThermalConductivityModel) +SET_PROP(OnePNI, ThermalConductivityModel) { private : typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: @@ -131,22 +131,22 @@ SET_PROP(NonIsothermal, ThermalConductivityModel) ////////////////////////////////////////////////////////////////// // set isothermal Model -SET_TYPE_PROP(OneP, IsothermalModel, OnePModel<TypeTag>); +SET_TYPE_PROP(OnePNI, IsothermalModel, OnePModel<TypeTag>); //set isothermal FluxVariables -SET_TYPE_PROP(OneP, IsothermalFluxVariables, ImplicitDarcyFluxVariables<TypeTag>); +SET_TYPE_PROP(OnePNI, IsothermalFluxVariables, ImplicitDarcyFluxVariables<TypeTag>); //set isothermal VolumeVariables -SET_TYPE_PROP(OneP, IsothermalVolumeVariables, OnePVolumeVariables<TypeTag>); +SET_TYPE_PROP(OnePNI, IsothermalVolumeVariables, OnePVolumeVariables<TypeTag>); //set isothermal LocalResidual -SET_TYPE_PROP(OneP, IsothermalLocalResidual, OnePLocalResidual<TypeTag>); +SET_TYPE_PROP(OnePNI, IsothermalLocalResidual, OnePLocalResidual<TypeTag>); //set isothermal Indices -SET_TYPE_PROP(OneP, IsothermalIndices, OnePIndices); +SET_TYPE_PROP(OnePNI, IsothermalIndices, OnePIndices); //set isothermal NumEq -SET_INT_PROP(OneP, IsothermalNumEq, 1); +SET_INT_PROP(OnePNI, IsothermalNumEq, 1); // \} } // end namespace Properties diff --git a/dumux/implicit/1p2c/1p2cpropertydefaults.hh b/dumux/implicit/1p2c/1p2cpropertydefaults.hh index d57c8ce66a..38bf6fa731 100644 --- a/dumux/implicit/1p2c/1p2cpropertydefaults.hh +++ b/dumux/implicit/1p2c/1p2cpropertydefaults.hh @@ -51,23 +51,23 @@ namespace Properties ////////////////////////////////////////////////////////////////// -SET_INT_PROP(OnePTwoC, NumEq, GET_PROP_VALUE(TypeTag, IsothermalNumEq)); //!< set the number of equations to 2 +SET_INT_PROP(OnePTwoC, NumEq, 2); //!< set the number of equations to 2 SET_INT_PROP(OnePTwoC, NumPhases, 1); //!< The number of phases in the 1p2c model is 1 SET_INT_PROP(OnePTwoC, NumComponents, 2); //!< The number of components in the 1p2c model is 2 SET_SCALAR_PROP(OnePTwoC, Scaling, 1); //!< Scaling of the model is set to 1 by default SET_BOOL_PROP(OnePTwoC, UseMoles, true); //!< Define that mole fractions are used in the balance equations //! Use the 1p2c local residual function for the 1p2c model -SET_TYPE_PROP(OnePTwoC, LocalResidual, typename GET_PROP_TYPE(TypeTag, IsothermalLocalResidual)); +SET_TYPE_PROP(OnePTwoC, LocalResidual, OnePTwoCLocalResidual<TypeTag>); //! define the model -SET_TYPE_PROP(OnePTwoC, Model, typename GET_PROP_TYPE(TypeTag, IsothermalModel)); +SET_TYPE_PROP(OnePTwoC, Model, OnePTwoCModel<TypeTag>); //! define the VolumeVariables -SET_TYPE_PROP(OnePTwoC, VolumeVariables, typename GET_PROP_TYPE(TypeTag, IsothermalVolumeVariables)); +SET_TYPE_PROP(OnePTwoC, VolumeVariables, OnePTwoCVolumeVariables<TypeTag>); //! define the FluxVariables -SET_TYPE_PROP(OnePTwoC, FluxVariables, typename GET_PROP_TYPE(TypeTag, IsothermalFluxVariables)); +SET_TYPE_PROP(OnePTwoC, FluxVariables, OnePTwoCFluxVariables<TypeTag>); /*! * \brief The fluid state which is used by the volume variables to @@ -90,7 +90,7 @@ SET_SCALAR_PROP(OnePTwoC, ImplicitMassUpwindWeight, 1.0); SET_SCALAR_PROP(OnePTwoC, ImplicitMobilityUpwindWeight, 1.0); //! Set the indices used by the 1p2c model -SET_TYPE_PROP(OnePTwoC, Indices, typename GET_PROP_TYPE(TypeTag, IsothermalIndices)); +SET_TYPE_PROP(OnePTwoC, Indices, OnePTwoCIndices<TypeTag>); //! The spatial parameters to be employed. //! Use ImplicitSpatialParamsOneP by default. SET_TYPE_PROP(OnePTwoC, SpatialParams, ImplicitSpatialParamsOneP<TypeTag>); @@ -117,10 +117,10 @@ SET_BOOL_PROP(OnePTwoC, ProblemEnableGravity, true); // Actually the Forchheimer coefficient is also a function of the dimensions of the // porous medium. Taking it as a constant is only a first approximation // (Nield, Bejan, Convection in porous media, 2006, p. 10) -SET_SCALAR_PROP(BoxModel, SpatialParamsForchCoeff, 0.55); +SET_SCALAR_PROP(OnePTwoC, SpatialParamsForchCoeff, 0.55); //! average is used as default model to compute the effective thermal heat conductivity -SET_PROP(NonIsothermal, ThermalConductivityModel) +SET_PROP(OnePTwoCNI, ThermalConductivityModel) { private : typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: @@ -132,22 +132,22 @@ SET_PROP(NonIsothermal, ThermalConductivityModel) ////////////////////////////////////////////////////////////////// // set isothermal Model -SET_TYPE_PROP(OnePTwoC, IsothermalModel, OnePTwoCModel<TypeTag>); +SET_TYPE_PROP(OnePTwoCNI, IsothermalModel, OnePTwoCModel<TypeTag>); // set isothermal FluxVariables -SET_TYPE_PROP(OnePTwoC, IsothermalFluxVariables, OnePTwoCFluxVariables<TypeTag>); +SET_TYPE_PROP(OnePTwoCNI, IsothermalFluxVariables, OnePTwoCFluxVariables<TypeTag>); //set isothermal VolumeVariables -SET_TYPE_PROP(OnePTwoC, IsothermalVolumeVariables, OnePTwoCVolumeVariables<TypeTag>); +SET_TYPE_PROP(OnePTwoCNI, IsothermalVolumeVariables, OnePTwoCVolumeVariables<TypeTag>); //set isothermal LocalResidual -SET_TYPE_PROP(OnePTwoC, IsothermalLocalResidual, OnePTwoCLocalResidual<TypeTag>); +SET_TYPE_PROP(OnePTwoCNI, IsothermalLocalResidual, OnePTwoCLocalResidual<TypeTag>); //set isothermal Indices -SET_TYPE_PROP(OnePTwoC, IsothermalIndices, OnePTwoCIndices<TypeTag>); +SET_TYPE_PROP(OnePTwoCNI, IsothermalIndices, OnePTwoCIndices<TypeTag>); //set isothermal NumEq -SET_INT_PROP(OnePTwoC, IsothermalNumEq, 2); +SET_INT_PROP(OnePTwoCNI, IsothermalNumEq, 2); } diff --git a/dumux/implicit/2p/2ppropertydefaults.hh b/dumux/implicit/2p/2ppropertydefaults.hh index 4a37caff8b..0db57d2641 100644 --- a/dumux/implicit/2p/2ppropertydefaults.hh +++ b/dumux/implicit/2p/2ppropertydefaults.hh @@ -145,10 +145,10 @@ SET_BOOL_PROP(TwoP, ProblemEnableGravity, true); // Actually the Forchheimer coefficient is also a function of the dimensions of the // porous medium. Taking it as a constant is only a first approximation // (Nield, Bejan, Convection in porous media, 2006, p. 10) -SET_SCALAR_PROP(BoxModel, SpatialParamsForchCoeff, 0.55); +SET_SCALAR_PROP(TwoP, SpatialParamsForchCoeff, 0.55); //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(NonIsothermal, ThermalConductivityModel) +SET_PROP(TwoPNI, ThermalConductivityModel) { private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; diff --git a/dumux/implicit/2p2c/2p2cpropertydefaults.hh b/dumux/implicit/2p2c/2p2cpropertydefaults.hh index d4252a2bff..c042e42fe5 100644 --- a/dumux/implicit/2p2c/2p2cpropertydefaults.hh +++ b/dumux/implicit/2p2c/2p2cpropertydefaults.hh @@ -182,10 +182,10 @@ SET_BOOL_PROP(TwoPTwoC, UseConstraintSolver, true); // Actually the Forchheimer coefficient is also a function of the dimensions of the // porous medium. Taking it as a constant is only a first approximation // (Nield, Bejan, Convection in porous media, 2006, p. 10) -SET_SCALAR_PROP(BoxModel, SpatialParamsForchCoeff, 0.55); +SET_SCALAR_PROP(TwoPTwoC, SpatialParamsForchCoeff, 0.55); //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(NonIsothermal, ThermalConductivityModel) +SET_PROP(TwoPTwoCNI, ThermalConductivityModel) { private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; diff --git a/dumux/implicit/2pnc/2pncpropertydefaults.hh b/dumux/implicit/2pnc/2pncpropertydefaults.hh index 7a8f14ed9d..39fcd2570a 100644 --- a/dumux/implicit/2pnc/2pncpropertydefaults.hh +++ b/dumux/implicit/2pnc/2pncpropertydefaults.hh @@ -177,7 +177,7 @@ SET_BOOL_PROP(TwoPNC, ProblemEnableGravity, true); SET_BOOL_PROP(TwoPNC, VtkAddVelocity, false); //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(NonIsothermal, ThermalConductivityModel) +SET_PROP(TwoPNCNI, ThermalConductivityModel) { private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; diff --git a/dumux/implicit/3p/3ppropertydefaults.hh b/dumux/implicit/3p/3ppropertydefaults.hh index 23fe9b6971..7431c884aa 100644 --- a/dumux/implicit/3p/3ppropertydefaults.hh +++ b/dumux/implicit/3p/3ppropertydefaults.hh @@ -118,7 +118,7 @@ SET_BOOL_PROP(ThreeP, VtkAddVelocity, false); SET_BOOL_PROP(ThreeP, ProblemEnableGravity, true); //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(NonIsothermal, ThermalConductivityModel) +SET_PROP(ThreePNI, ThermalConductivityModel) { private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; diff --git a/dumux/implicit/3p3c/3p3cpropertydefaults.hh b/dumux/implicit/3p3c/3p3cpropertydefaults.hh index 81b3af9520..59fc363d03 100644 --- a/dumux/implicit/3p3c/3p3cpropertydefaults.hh +++ b/dumux/implicit/3p3c/3p3cpropertydefaults.hh @@ -165,7 +165,7 @@ SET_BOOL_PROP(ThreePThreeC, ProblemEnableGravity, true); SET_SCALAR_PROP(BoxModel, SpatialParamsForchCoeff, 0.55); //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(NonIsothermal, ThermalConductivityModel) +SET_PROP(ThreePThreeCNI, ThermalConductivityModel) { private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; diff --git a/dumux/implicit/richards/richardspropertydefaults.hh b/dumux/implicit/richards/richardspropertydefaults.hh index 4aa82b1e1d..34e5828bbd 100644 --- a/dumux/implicit/richards/richardspropertydefaults.hh +++ b/dumux/implicit/richards/richardspropertydefaults.hh @@ -53,7 +53,7 @@ namespace Properties { // Properties values ////////////////////////////////////////////////////////////////// //! Number of equations required by the model -SET_INT_PROP(Richards, NumEq, GET_PROP_VALUE(TypeTag, IsothermalNumEq)); +SET_INT_PROP(Richards, NumEq, 1); //! Number of fluid phases considered SET_INT_PROP(Richards, NumPhases, 2); @@ -61,18 +61,16 @@ SET_INT_PROP(Richards, NumPhases, 2); SET_BOOL_PROP(Richards, UseHead, false); //! The local residual operator -SET_TYPE_PROP(Richards, - LocalResidual, - typename GET_PROP_TYPE(TypeTag, IsothermalLocalResidual)); +SET_TYPE_PROP(Richards, LocalResidual, RichardsLocalResidual<TypeTag>); //! The global model used -SET_TYPE_PROP(Richards, Model, typename GET_PROP_TYPE(TypeTag, IsothermalModel)); +SET_TYPE_PROP(Richards, Model, RichardsModel<TypeTag>); //! The class for the volume averaged quantities -SET_TYPE_PROP(Richards, VolumeVariables, typename GET_PROP_TYPE(TypeTag, IsothermalVolumeVariables)); +SET_TYPE_PROP(Richards, VolumeVariables, RichardsVolumeVariables<TypeTag>); //! The class for the quantities required for the flux calculation -SET_TYPE_PROP(Richards, FluxVariables, typename GET_PROP_TYPE(TypeTag, IsothermalFluxVariables)); +SET_TYPE_PROP(Richards, FluxVariables, RichardsFluxVariables<TypeTag>); //! The class of the newton controller SET_TYPE_PROP(Richards, NewtonController, RichardsNewtonController<TypeTag>); @@ -84,7 +82,7 @@ SET_SCALAR_PROP(Richards, ImplicitMassUpwindWeight, 1.0); SET_SCALAR_PROP(Richards, ImplicitMobilityUpwindWeight, 1.0); //! The class with all index definitions for the model -SET_TYPE_PROP(Richards, Indices, typename GET_PROP_TYPE(TypeTag, IsothermalIndices)); +SET_TYPE_PROP(Richards, Indices, RichardsIndices<TypeTag>); //! The spatial parameters to be employed. //! Use ImplicitSpatialParams by default. @@ -182,10 +180,10 @@ SET_BOOL_PROP(Richards, ProblemEnableGravity, true); // Actually the Forchheimer coefficient is also a function of the dimensions of the // porous medium. Taking it as a constant is only a first approximation // (Nield, Bejan, Convection in porous media, 2006, p. 10) -SET_SCALAR_PROP(BoxModel, SpatialParamsForchCoeff, 0.55); +SET_SCALAR_PROP(Richards, SpatialParamsForchCoeff, 0.55); //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_PROP(NonIsothermal, ThermalConductivityModel) +SET_PROP(RichardsNI, ThermalConductivityModel) { private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; @@ -202,22 +200,22 @@ SET_BOOL_PROP(RichardsNI, NiOutputLevel, 0); ////////////////////////////////////////////////////////////////// // set isothermal Model -SET_TYPE_PROP(Richards, IsothermalModel, RichardsModel<TypeTag>); +SET_TYPE_PROP(RichardsNI, IsothermalModel, RichardsModel<TypeTag>); // set isothermal FluxVariables -SET_TYPE_PROP(Richards, IsothermalFluxVariables, RichardsFluxVariables<TypeTag>); +SET_TYPE_PROP(RichardsNI, IsothermalFluxVariables, RichardsFluxVariables<TypeTag>); //set isothermal VolumeVariables -SET_TYPE_PROP(Richards, IsothermalVolumeVariables, RichardsVolumeVariables<TypeTag>); +SET_TYPE_PROP(RichardsNI, IsothermalVolumeVariables, RichardsVolumeVariables<TypeTag>); //set isothermal LocalResidual -SET_TYPE_PROP(Richards, IsothermalLocalResidual, RichardsLocalResidual<TypeTag>); +SET_TYPE_PROP(RichardsNI, IsothermalLocalResidual, RichardsLocalResidual<TypeTag>); //set isothermal Indices -SET_TYPE_PROP(Richards, IsothermalIndices, RichardsIndices<TypeTag>); +SET_TYPE_PROP(RichardsNI, IsothermalIndices, RichardsIndices<TypeTag>); //set isothermal NumEq -SET_INT_PROP(Richards, IsothermalNumEq, 1); +SET_INT_PROP(RichardsNI, IsothermalNumEq, 1); // \} } -- GitLab