diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index 3f47a55f4808e1a51b46955fce1f1ca0fb02a3a2..7a762637f8f145e5772fa9110b31b3d991d970c0 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -123,22 +123,6 @@ NEW_PROP_TAG(Formulation); //!< The formulation of the m NEW_PROP_TAG(UseConstraintSolver); //!< Whether to use a contraint solver for computing the secondary variables NEW_PROP_TAG(UseKelvinEquation); //!< If we use Kelvin equation to lower the vapor pressure as a function of capillary pressure, temperature -//////////////////////////////////////////////////////////////////////////////// -// Properties used by models involving mineralization: -//////////////////////////////////////////////////////////////////////////////// -NEW_PROP_TAG(NonMineralizationModelTraits); -NEW_PROP_TAG(NonMineralizationVtkOutputFields); -NEW_PROP_TAG(NonMineralizationVolumeVariables); - -///////////////////////////////////////////////////////////// -// non-isothermal porous medium flow models -///////////////////////////////////////////////////////////// -NEW_PROP_TAG(IsothermalVtkOutputFields); -NEW_PROP_TAG(IsothermalVolumeVariables); -NEW_PROP_TAG(IsothermalLocalResidual); -NEW_PROP_TAG(IsothermalIndices); -NEW_PROP_TAG(IsothermalModelTraits); - // specify if we evaluate the permeability in the volume (for discontinuous fields) // or at the scvf center for analytical permeability fields (e.g. convergence studies) NEW_PROP_TAG(EvaluatePermeabilityAtScvfIP); diff --git a/dumux/discretization/fluxvariablesbase.hh b/dumux/discretization/fluxvariablesbase.hh index 82cd5e5520170f8d9d403999c0306d72aa042d1f..39fb993a4f0d48c1545c80b5b9b000b00af2c683 100644 --- a/dumux/discretization/fluxvariablesbase.hh +++ b/dumux/discretization/fluxvariablesbase.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_DISCRETIZATION_FLUXVARIABLESBASE_HH #define DUMUX_DISCRETIZATION_FLUXVARIABLESBASE_HH +#include <dumux/common/properties.hh> #include <dumux/discretization/upwindscheme.hh> namespace Dumux { diff --git a/dumux/freeflow/rans/volumevariables.hh b/dumux/freeflow/rans/volumevariables.hh index 5870eb272b1020fc81c4559d029c76fe0a5526b1..828b79a5a639b0c1309014f4b8de336e4b72086f 100644 --- a/dumux/freeflow/rans/volumevariables.hh +++ b/dumux/freeflow/rans/volumevariables.hh @@ -25,8 +25,12 @@ #ifndef DUMUX_RANS_VOLUME_VARIABLES_HH #define DUMUX_RANS_VOLUME_VARIABLES_HH +#include <dune/common/fvector.hh> +#include <dune/common/fmatrix.hh> + #include <dumux/common/properties.hh> #include <dumux/material/fluidstates/immiscible.hh> +#include <dumux/freeflow/navierstokes/volumevariables.hh> namespace Dumux { diff --git a/dumux/freeflow/rans/zeroeq/volumevariables.hh b/dumux/freeflow/rans/zeroeq/volumevariables.hh index 132c59d039e2a4a4a631a7e782cb0b166acbe62c..f933af541df118d608a1b5cfc5102c514e913e00 100644 --- a/dumux/freeflow/rans/zeroeq/volumevariables.hh +++ b/dumux/freeflow/rans/zeroeq/volumevariables.hh @@ -26,7 +26,9 @@ #define DUMUX_ZEROEQ_VOLUME_VARIABLES_HH #include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> #include <dumux/material/fluidstates/immiscible.hh> +#include <dumux/freeflow/rans/volumevariables.hh> namespace Dumux { diff --git a/dumux/linear/scotchbackend.hh b/dumux/linear/scotchbackend.hh index 02b06ed0eac3d4eebbc4c2f8db14433aa012c609..1017ab224e57dae0e4da1e25404e6d8e5758f08f 100644 --- a/dumux/linear/scotchbackend.hh +++ b/dumux/linear/scotchbackend.hh @@ -39,6 +39,8 @@ extern "C" #include <stdint.h> #include <ptscotch.h> } +#else +#warning "PTSCOTCH was not found on your system. Dumux::ScotchBackend won't do anything." #endif namespace Dumux { @@ -81,6 +83,7 @@ public: std::vector<int>& inversePermutation, std::string scotchStrategy = "") { +#if HAVE_PTSCOTCH // Number of local graph vertices (cells) const SCOTCH_Num vertnbr = graph.size(); @@ -164,9 +167,10 @@ public: permutation.begin()); std::copy(inversePermutationIndices.begin(), inversePermutationIndices.end(), inversePermutation.begin()); +#endif // HAVE_PTSCOTCH } }; } // end namespace Dumux -#endif +#endif // DUMUX_SCOTCH_BACKEND_HH diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh index ccf2d8fdc46a3ecde57c74243ef02e96062225be..a3fa37132bab2de0ffb47d94459283cd94bceef8 100644 --- a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh @@ -24,6 +24,7 @@ #ifndef THERMALCONDUCTIVITY_SIMPLE_FLUID_LUMPING_HH #define THERMALCONDUCTIVITY_SIMPLE_FLUID_LUMPING_HH +#include <assert.h> #include <algorithm> namespace Dumux { diff --git a/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh b/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh index 0017b5dc2d1058e2126a5fce6422edc0e711c27f..dd517f0b7a91f8fddeda8a1ecac819dad7af4521 100644 --- a/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh +++ b/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh @@ -24,9 +24,12 @@ #ifndef DUMUX_EFFECTIVE_SOLID_DENSITY_HH #define DUMUX_EFFECTIVE_SOLID_DENSITY_HH -#include <dumux/discretization/evalsolution.hh> #include <dune/common/deprecated.hh> +#include <dumux/common/properties.hh> +#include <dumux/discretization/evalsolution.hh> + + namespace Dumux { /*! diff --git a/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh b/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh index 01f45c8442f96c2bf8f8f2c6c995d9cf3b35310d..61df4ae693f9fec51383a283363a11346d6e133d 100644 --- a/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh +++ b/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh @@ -24,9 +24,11 @@ #ifndef DUMUX_EFFECTIVE_SOLID_HEATCAPACITY_HH #define DUMUX_EFFECTIVE_SOLID_HEATCAPACITY_HH -#include <dumux/discretization/evalsolution.hh> #include <dune/common/deprecated.hh> +#include <dumux/common/properties.hh> +#include <dumux/discretization/evalsolution.hh> + namespace Dumux { /*! diff --git a/dumux/material/fluidmatrixinteractions/porosityprecipitation.hh b/dumux/material/fluidmatrixinteractions/porosityprecipitation.hh index 89ceedf9b1b543b18e4ca69e3269d8fa48659052..68e3491e61d81c30effa9b7cc0c58ea1be9325a8 100644 --- a/dumux/material/fluidmatrixinteractions/porosityprecipitation.hh +++ b/dumux/material/fluidmatrixinteractions/porosityprecipitation.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_POROSITY_PRECIPITATION_HH #define DUMUX_POROSITY_PRECIPITATION_HH +#include <dumux/common/properties.hh> #include <dumux/discretization/evalsolution.hh> namespace Dumux { diff --git a/dumux/material/fluidmatrixinteractions/porosityreactivebed.hh b/dumux/material/fluidmatrixinteractions/porosityreactivebed.hh index e12984151868db5fa2df3beb1444520bc1599c21..df985ae6e48fd213c7f87dcd54ef9d2c32603223 100644 --- a/dumux/material/fluidmatrixinteractions/porosityreactivebed.hh +++ b/dumux/material/fluidmatrixinteractions/porosityreactivebed.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_POROSITY_REACTIVE_BED_HH #define DUMUX_POROSITY_REACTIVE_BED_HH +#include <dumux/common/properties.hh> #include <dumux/discretization/evalsolution.hh> namespace Dumux { diff --git a/dumux/porousmediumflow/1pncmin/model.hh b/dumux/porousmediumflow/1pncmin/model.hh index ee098c63546e03191860ee5b4b3e194352613ccd..1a12f098d587f0724b9629c995a89290f13d6e08 100644 --- a/dumux/porousmediumflow/1pncmin/model.hh +++ b/dumux/porousmediumflow/1pncmin/model.hh @@ -69,7 +69,13 @@ v = - \frac{k_{r}}{\mu} \mbox{\bf K} #include <dumux/porousmediumflow/1pnc/model.hh> #include <dumux/porousmediumflow/1pnc/indices.hh> +#include <dumux/porousmediumflow/1pnc/volumevariables.hh> + #include <dumux/porousmediumflow/mineralization/model.hh> +#include <dumux/porousmediumflow/mineralization/localresidual.hh> +#include <dumux/porousmediumflow/mineralization/volumevariables.hh> +#include <dumux/porousmediumflow/mineralization/vtkoutputfields.hh> + #include <dumux/porousmediumflow/nonisothermal/indices.hh> #include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> #include <dumux/material/fluidmatrixinteractions/1p/thermalconductivityaverage.hh> @@ -81,33 +87,44 @@ namespace Properties ////////////////////////////////////////////////////////////////// // Type tags ////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(OnePNCMin, INHERITS_FROM(OnePNC, Mineralization)); +NEW_TYPE_TAG(OnePNCMin, INHERITS_FROM(OnePNC)); NEW_TYPE_TAG(OnePNCMinNI, INHERITS_FROM(OnePNCMin)); ////////////////////////////////////////////////////////////////// // Property tags for the isothermal 2pncmin model ////////////////////////////////////////////////////////////////// -//! the VolumeVariables property -SET_TYPE_PROP(OnePNCMin, NonMineralizationVolumeVariables, OnePNCVolumeVariables<TypeTag>); +//! use the mineralization volume variables together with the 1pnc vol vars +SET_PROP(OnePNCMin, VolumeVariables) +{ +private: + using NonMinVolVars = OnePNCVolumeVariables<TypeTag>; +public: + using type = MineralizationVolumeVariables<TypeTag, NonMinVolVars>; +}; + +// Use the mineralization local residual +SET_TYPE_PROP(OnePNCMin, LocalResidual, MineralizationLocalResidual<TypeTag>); -//! The 1pnc model traits define the non-mineralization part -SET_PROP(OnePNCMin, NonMineralizationModelTraits) +//! Use non-mineralization model traits with 1pnc traits +SET_PROP(OnePNCMin, ModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)); + using NonMinTraits = OnePNCModelTraits<FluidSystem::numComponents>; public: - using type = OnePNCModelTraits<FluidSystem::numComponents>; + using type = MineralizationModelTraits<NonMinTraits, FluidSystem::numSPhases>; }; -//! Set the vtk output fields specific to this model -SET_PROP(OnePNCMin, NonMineralizationVtkOutputFields) +//! Use the mineralization vtk output fields +SET_PROP(OnePNCMin, VtkOutputFields) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx); + using NonMineralizationFields = OnePNCVtkOutputFields<FluidSystem, phaseIdx>; public: - using type = OnePNCVtkOutputFields<FluidSystem, phaseIdx>; + using type = MineralizationVtkOutputFields<NonMineralizationFields, FluidSystem>; }; ////////////////////////////////////////////////////////////////// @@ -119,7 +136,8 @@ SET_PROP(OnePNCMinNI, VtkOutputFields) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using NonMineralizationFields = typename GET_PROP_TYPE(TypeTag, NonMineralizationVtkOutputFields); + static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx); + using NonMineralizationFields = OnePNCVtkOutputFields<FluidSystem, phaseIdx>; using IsothermalFields = MineralizationVtkOutputFields<NonMineralizationFields, FluidSystem>; public: using type = EnergyVtkOutputFields<IsothermalFields>; diff --git a/dumux/porousmediumflow/2p1c/primaryvariableswitch.hh b/dumux/porousmediumflow/2p1c/primaryvariableswitch.hh index 67f5b0feea91d8cae2d920f13849996659c2ab8f..3803bedc50e06d33bfdbd649d9c73f98e48a4b0d 100644 --- a/dumux/porousmediumflow/2p1c/primaryvariableswitch.hh +++ b/dumux/porousmediumflow/2p1c/primaryvariableswitch.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_2P1C_PRIMARY_VARIABLE_SWITCH_HH #define DUMUX_2P1C_PRIMARY_VARIABLE_SWITCH_HH +#include <dumux/common/properties.hh> #include <dumux/porousmediumflow/compositional/primaryvariableswitch.hh> namespace Dumux { diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh index 7a13e41ab2f149aa12e09b2f6c6067fed38daa1b..a413e1075b9d91006d2d6b767835d367f20da288 100644 --- a/dumux/porousmediumflow/2pncmin/model.hh +++ b/dumux/porousmediumflow/2pncmin/model.hh @@ -93,7 +93,13 @@ #define DUMUX_2PNCMIN_MODEL_HH #include <dumux/porousmediumflow/2pnc/model.hh> +#include <dumux/porousmediumflow/2pnc/volumevariables.hh> + #include <dumux/porousmediumflow/mineralization/model.hh> +#include <dumux/porousmediumflow/mineralization/localresidual.hh> +#include <dumux/porousmediumflow/mineralization/volumevariables.hh> +#include <dumux/porousmediumflow/mineralization/vtkoutputfields.hh> + #include <dumux/porousmediumflow/nonisothermal/indices.hh> #include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> @@ -104,34 +110,46 @@ namespace Properties ////////////////////////////////////////////////////////////////// // Type tags ////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(TwoPNCMin, INHERITS_FROM(TwoPNC, Mineralization)); +NEW_TYPE_TAG(TwoPNCMin, INHERITS_FROM(TwoPNC)); NEW_TYPE_TAG(TwoPNCMinNI, INHERITS_FROM(TwoPNCMin)); ////////////////////////////////////////////////////////////////// // Property tags for the isothermal 2pncmin model ////////////////////////////////////////////////////////////////// -SET_TYPE_PROP(TwoPNCMin, NonMineralizationVolumeVariables, TwoPNCVolumeVariables<TypeTag>); //!< the VolumeVariables property + +// use the mineralization local residual +SET_TYPE_PROP(TwoPNCMin, LocalResidual, MineralizationLocalResidual<TypeTag>); + +//! use the mineralization volume variables together with the 2pnc vol vars +SET_PROP(TwoPNCMin, VolumeVariables) +{ +private: + using NonMinVolVars = TwoPNCVolumeVariables<TypeTag>; +public: + using type = MineralizationVolumeVariables<TypeTag, NonMinVolVars>; +}; //! Set the vtk output fields specific to this model -SET_PROP(TwoPNCMin, NonMineralizationVtkOutputFields) +SET_PROP(TwoPNCMin, VtkOutputFields) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - + using NonMineralizationFields = TwoPNCVtkOutputFields<FluidSystem, Indices>; public: - using type = TwoPNCVtkOutputFields<FluidSystem, Indices>; + using type = MineralizationVtkOutputFields<NonMineralizationFields, FluidSystem>; }; //! The 2pnc model traits define the non-mineralization part -SET_PROP(TwoPNCMin, NonMineralizationModelTraits) +SET_PROP(TwoPNCMin, ModelTraits) { private: //! we use the number of components specified by the fluid system here using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!"); + using NonMineralizationTraits = TwoPNCModelTraits<FluidSystem::numComponents>; public: - using type = TwoPNCModelTraits<FluidSystem::numComponents>; + using type = MineralizationModelTraits<NonMineralizationTraits, FluidSystem::numSPhases>; }; ////////////////////////////////////////////////////////////////// @@ -156,8 +174,9 @@ public: SET_PROP(TwoPNCMinNI, VtkOutputFields) { private: + using Indices = typename GET_PROP_TYPE(TypeTag, Indices); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using NonMineralizationFields = typename GET_PROP_TYPE(TypeTag, NonMineralizationVtkOutputFields); + using NonMineralizationFields = TwoPNCVtkOutputFields<FluidSystem, Indices>; using IsothermalFields = MineralizationVtkOutputFields<NonMineralizationFields, FluidSystem>; public: using type = EnergyVtkOutputFields<IsothermalFields>; diff --git a/dumux/porousmediumflow/3p3c/primaryvariableswitch.hh b/dumux/porousmediumflow/3p3c/primaryvariableswitch.hh index ce180f5c6a174ea56171152234d6c82bd377e3b8..64bfa8595df39352f10465108796a52267025da3 100644 --- a/dumux/porousmediumflow/3p3c/primaryvariableswitch.hh +++ b/dumux/porousmediumflow/3p3c/primaryvariableswitch.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_3P3C_PRIMARY_VARIABLE_SWITCH_HH #define DUMUX_3P3C_PRIMARY_VARIABLE_SWITCH_HH +#include <dumux/common/properties.hh> #include <dumux/porousmediumflow/compositional/primaryvariableswitch.hh> namespace Dumux { diff --git a/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh b/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh index ec332b6a5f4a936701726cfc59bf6a1e8ceb3674..86742b50d60f60c9ea83c2d6d1cbd1e996135c9d 100644 --- a/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh +++ b/dumux/porousmediumflow/3pwateroil/primaryvariableswitch.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_3P2CNI_PRIMARY_VARIABLE_SWITCH_HH #define DUMUX_3P2CNI_PRIMARY_VARIABLE_SWITCH_HH +#include <dumux/common/properties.hh> #include <dumux/porousmediumflow/compositional/primaryvariableswitch.hh> namespace Dumux { diff --git a/dumux/porousmediumflow/mineralization/model.hh b/dumux/porousmediumflow/mineralization/model.hh index 4c5b3cfef6a87e61a9f4f69de80c72334fa96456..e59fb24b9645f3f6b23a03507b0171b036795b50 100644 --- a/dumux/porousmediumflow/mineralization/model.hh +++ b/dumux/porousmediumflow/mineralization/model.hh @@ -30,11 +30,6 @@ #ifndef DUMUX_MINERALIZATION_MODEL_HH #define DUMUX_MINERALIZATION_MODEL_HH -#include <dumux/common/properties.hh> -#include "localresidual.hh" -#include "volumevariables.hh" -#include "vtkoutputfields.hh" - namespace Dumux { /*! @@ -55,40 +50,6 @@ struct MineralizationModelTraits : public NonMinTraits static constexpr int numEq() { return NonMinTraits::numEq() + numPS; } }; -namespace Properties { -////////////////////////////////////////////////////////////////// -// Type tags -////////////////////////////////////////////////////////////////// -NEW_TYPE_TAG(Mineralization); - -//! Set the model traits class -SET_PROP(Mineralization, ModelTraits) -{ -private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using NonMinTraits = typename GET_PROP_TYPE(TypeTag, NonMineralizationModelTraits); -public: - using type = MineralizationModelTraits<NonMinTraits, FluidSystem::numSPhases>; -}; - -//! Set the general mineralization volume variables -SET_TYPE_PROP(Mineralization, VolumeVariables, MineralizationVolumeVariables<TypeTag>); - -//! Set the general mineralization compositional local residual -SET_TYPE_PROP(Mineralization, LocalResidual, MineralizationLocalResidual<TypeTag>); - -//! VTK outputs for mineralization models -SET_PROP(Mineralization, VtkOutputFields) -{ -private: - using NonMineralizationVtkOutputFields = typename GET_PROP_TYPE(TypeTag, NonMineralizationVtkOutputFields); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - -public: - using type = MineralizationVtkOutputFields<NonMineralizationVtkOutputFields, FluidSystem>; -}; - -} // end namespace Properties } // end namespace Dumux #endif diff --git a/dumux/porousmediumflow/mineralization/volumevariables.hh b/dumux/porousmediumflow/mineralization/volumevariables.hh index 77057c55d1c60148a12e55097979cd552636ff6e..0ebc313d74e8faa3577ecb000e84eca25265085f 100644 --- a/dumux/porousmediumflow/mineralization/volumevariables.hh +++ b/dumux/porousmediumflow/mineralization/volumevariables.hh @@ -36,10 +36,10 @@ namespace Dumux { * \brief Contains the quantities which are are constant within a sub-control volume * of the finite volume grid in an m-phase, n-component, mineralization model. */ -template <class TypeTag> -class MineralizationVolumeVariables : public GET_PROP_TYPE(TypeTag, NonMineralizationVolumeVariables) +template <class TypeTag, class NonMineralizationVolVars> +class MineralizationVolumeVariables : public NonMineralizationVolVars { - using ParentType = typename GET_PROP_TYPE(TypeTag, NonMineralizationVolumeVariables); + using ParentType = NonMineralizationVolVars; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using Problem = typename GET_PROP_TYPE(TypeTag, Problem); diff --git a/test/porousmediumflow/2p2c/implicit/injectionproblem.hh b/test/porousmediumflow/2p2c/implicit/injectionproblem.hh index e39f4765ae794bb77ca45261f3b7ffe2b5206411..d28db992a08d7e72e73682dfdd6b9ef74aa6e79d 100644 --- a/test/porousmediumflow/2p2c/implicit/injectionproblem.hh +++ b/test/porousmediumflow/2p2c/implicit/injectionproblem.hh @@ -37,6 +37,10 @@ namespace Dumux { +#ifndef ENABLECACHING +#define ENABLECACHING 0 +#endif + template <class TypeTag> class InjectionProblem;