diff --git a/exercises/exercise-coupling-ff-pm/README.md b/exercises/exercise-coupling-ff-pm/README.md index 50b8d2426845b928cfe570781175c6c12a50b089..cbd87c578dd89c1ae01e0be119d994329c22a111 100644 --- a/exercises/exercise-coupling-ff-pm/README.md +++ b/exercises/exercise-coupling-ff-pm/README.md @@ -229,7 +229,7 @@ liquid saturation as primary variables (p_g-S_l -> `p1s0`) or vice versa. ``` template<class TypeTag> -struct Formulation<TypeTag, TTag::DarcyTypeTag> +struct Formulation<TypeTag, TTag::DarcyOnePNC> { static constexpr auto value = TwoPFormulation::p1s0; }; ``` in the Properties section in the problem file. @@ -323,7 +323,7 @@ For using the compositional zero equation turbulence model, the following header The includes for the NavierStokesNC model and the NavierStokesProblem are no longer needed and can be removed. Make sure your free flow problem inherits from the correct parent type: -* Change the entry in the `ZeroEqTypeTag` definition accordingly (non-isothermal zero equation model) +* Change the entry in the `StokesZeroEq` definition accordingly (non-isothermal zero equation model) * Adapt the inheritance of the problem class (hint: two occurrences) Take a look into the two headers included above to see how the correct TypeTag and the Problem class the inherit from are called. diff --git a/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc b/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc index 3d756d624d227265bcd9a63c27871acde570e425..69a4063a6937ba2b6f093e4e62bbc0131ee51528 100644 --- a/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc +++ b/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc @@ -56,16 +56,16 @@ namespace Dumux { namespace Properties { template<class TypeTag> -struct CouplingManager<TypeTag, TTag::ZeroEqTypeTag> +struct CouplingManager<TypeTag, TTag::StokesZeroEq> { - using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyTwoPTwoCTypeTag>; + using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyTwoPTwoCNI>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; template<class TypeTag> -struct CouplingManager<TypeTag, TTag::DarcyTwoPTwoCTypeTag> +struct CouplingManager<TypeTag, TTag::DarcyTwoPTwoCNI> { - using Traits = StaggeredMultiDomainTraits<Properties::TTag::ZeroEqTypeTag, Properties::TTag::ZeroEqTypeTag, TypeTag>; + using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesZeroEq, Properties::TTag::StokesZeroEq, TypeTag>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; @@ -87,8 +87,8 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using StokesTypeTag = Properties::TTag::ZeroEqTypeTag; - using DarcyTypeTag = Properties::TTag::DarcyTwoPTwoCTypeTag; + using StokesTypeTag = Properties::TTag::StokesZeroEq; + using DarcyTypeTag = Properties::TTag::DarcyTwoPTwoCNI; // try to create a grid (from the given grid file or the input file) // for both sub-domains diff --git a/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh b/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh index 88d9cdeea6cd9551067187e2a7ab6a7929fba8a5..79b958a00ccd9880dddb0419fff85d2305e38951 100644 --- a/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh +++ b/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh @@ -41,16 +41,16 @@ namespace Properties { // Create new type tags namespace TTag { -struct ZeroEqTypeTag { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; }; +struct StokesZeroEq { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; }; } // end namespace TTag // Set the grid type template<class TypeTag> -struct Grid<TypeTag, TTag::ZeroEqTypeTag> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; +struct Grid<TypeTag, TTag::StokesZeroEq> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // The fluid system template<class TypeTag> -struct FluidSystem<TypeTag, TTag::ZeroEqTypeTag> +struct FluidSystem<TypeTag, TTag::StokesZeroEq> { using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the air phase @@ -58,22 +58,22 @@ struct FluidSystem<TypeTag, TTag::ZeroEqTypeTag> }; template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::ZeroEqTypeTag> { static constexpr int value = 3; }; +struct ReplaceCompEqIdx<TypeTag, TTag::StokesZeroEq> { static constexpr int value = 3; }; // Use formulation based on mass fractions template<class TypeTag> -struct UseMoles<TypeTag, TTag::ZeroEqTypeTag> { static constexpr bool value = true; }; +struct UseMoles<TypeTag, TTag::StokesZeroEq> { static constexpr bool value = true; }; // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::ZeroEqTypeTag> { using type = Dumux::FreeFlowSubProblem<TypeTag> ; }; +struct Problem<TypeTag, TTag::StokesZeroEq> { using type = Dumux::FreeFlowSubProblem<TypeTag> ; }; template<class TypeTag> -struct EnableFVGridGeometryCache<TypeTag, TTag::ZeroEqTypeTag> { static constexpr bool value = true; }; +struct EnableFVGridGeometryCache<TypeTag, TTag::StokesZeroEq> { static constexpr bool value = true; }; template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::ZeroEqTypeTag> { static constexpr bool value = true; }; +struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesZeroEq> { static constexpr bool value = true; }; template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::ZeroEqTypeTag> { static constexpr bool value = true; }; +struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesZeroEq> { static constexpr bool value = true; }; } /*! diff --git a/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh b/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh index de4bb4e71ccca3ce12c36ba5cbb455600c15aa13..361ac60e5b7b1e5c3b2503d91bf9f5b05678ffd2 100644 --- a/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh +++ b/exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh @@ -44,35 +44,35 @@ namespace Properties { // Create new type tags namespace TTag { -struct DarcyTwoPTwoCTypeTag { using InheritsFrom = std::tuple<TwoPTwoCNI, CCTpfaModel>; }; +struct DarcyTwoPTwoCNI { using InheritsFrom = std::tuple<TwoPTwoCNI, CCTpfaModel>; }; } // end namespace TTag // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { using type = Dumux::DarcySubProblem<TypeTag>; }; +struct Problem<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = Dumux::DarcySubProblem<TypeTag>; }; // the fluid system template<class TypeTag> -struct FluidSystem<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { using type = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; }; +struct FluidSystem<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; }; //! Set the default formulation to pw-Sn: This can be over written in the problem. template<class TypeTag> -struct Formulation<TypeTag, TTag::DarcyTwoPTwoCTypeTag> +struct Formulation<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr auto value = TwoPFormulation::p1s0; }; // The gas component balance (air) is replaced by the total mass balance template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { static constexpr int value = 3; }; +struct ReplaceCompEqIdx<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr int value = 3; }; // Set the grid type template<class TypeTag> -struct Grid<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; +struct Grid<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; template<class TypeTag> -struct UseMoles<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { static constexpr bool value = true; }; +struct UseMoles<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr bool value = true; }; template<class TypeTag> -struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { using type = TwoPSpatialParams<TypeTag>; }; +struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = TwoPSpatialParams<TypeTag>; }; } /*! diff --git a/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc b/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc index a50ebcea412c54c256df918817b560d16efeb1c0..995a7604f615bf11d17059651917d21c898026ea 100644 --- a/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc +++ b/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc @@ -56,16 +56,16 @@ namespace Dumux { namespace Properties { template<class TypeTag> -struct CouplingManager<TypeTag, TTag::ZeroEqTypeTag> +struct CouplingManager<TypeTag, TTag::StokesZeroEq> { - using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyTwoPTwoCTypeTag>; + using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyTwoPTwoCNI>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; template<class TypeTag> -struct CouplingManager<TypeTag, TTag::DarcyTwoPTwoCTypeTag> +struct CouplingManager<TypeTag, TTag::DarcyTwoPTwoCNI> { - using Traits = StaggeredMultiDomainTraits<Properties::TTag::ZeroEqTypeTag, Properties::TTag::ZeroEqTypeTag, TypeTag>; + using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesZeroEq, Properties::TTag::StokesZeroEq, TypeTag>; using type = Dumux::StokesDarcyCouplingManager<Traits>; }; @@ -87,8 +87,8 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // Define the sub problem type tags - using StokesTypeTag = Properties::TTag::ZeroEqTypeTag; - using DarcyTypeTag = Properties::TTag::DarcyTwoPTwoCTypeTag; + using StokesTypeTag = Properties::TTag::StokesZeroEq; + using DarcyTypeTag = Properties::TTag::DarcyTwoPTwoCNI; // try to create a grid (from the given grid file or the input file) // for both sub-domains diff --git a/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh b/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh index a78efe81c38b40db995cca48a2413720d0787e33..2b5f0864b719739cefd5133991cb879ab75f6e9a 100644 --- a/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh @@ -47,19 +47,19 @@ namespace Properties // Create new type tags namespace TTag { #if EXNUMBER >= 1 -struct ZeroEqTypeTag { using InheritsFrom = std::tuple<ZeroEqNCNI, StaggeredFreeFlowModel>; }; +struct StokesZeroEq { using InheritsFrom = std::tuple<ZeroEqNCNI, StaggeredFreeFlowModel>; }; #else -struct ZeroEqTypeTag { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; }; +struct StokesZeroEq { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; }; #endif } // end namespace TTag // Set the grid type template<class TypeTag> -struct Grid<TypeTag, TTag::ZeroEqTypeTag> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; +struct Grid<TypeTag, TTag::StokesZeroEq> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; // The fluid system template<class TypeTag> -struct FluidSystem<TypeTag, TTag::ZeroEqTypeTag> +struct FluidSystem<TypeTag, TTag::StokesZeroEq> { using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the air phase @@ -67,22 +67,22 @@ struct FluidSystem<TypeTag, TTag::ZeroEqTypeTag> }; template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::ZeroEqTypeTag> { static constexpr int value = 3; }; +struct ReplaceCompEqIdx<TypeTag, TTag::StokesZeroEq> { static constexpr int value = 3; }; // Use formulation based on mass fractions template<class TypeTag> -struct UseMoles<TypeTag, TTag::ZeroEqTypeTag> { static constexpr bool value = true; }; +struct UseMoles<TypeTag, TTag::StokesZeroEq> { static constexpr bool value = true; }; // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::ZeroEqTypeTag> { using type = Dumux::FreeFlowSubProblem<TypeTag> ; }; +struct Problem<TypeTag, TTag::StokesZeroEq> { using type = Dumux::FreeFlowSubProblem<TypeTag> ; }; template<class TypeTag> -struct EnableFVGridGeometryCache<TypeTag, TTag::ZeroEqTypeTag> { static constexpr bool value = true; }; +struct EnableFVGridGeometryCache<TypeTag, TTag::StokesZeroEq> { static constexpr bool value = true; }; template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::ZeroEqTypeTag> { static constexpr bool value = true; }; +struct EnableGridFluxVariablesCache<TypeTag, TTag::StokesZeroEq> { static constexpr bool value = true; }; template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::ZeroEqTypeTag> { static constexpr bool value = true; }; +struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesZeroEq> { static constexpr bool value = true; }; } /*! diff --git a/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh b/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh index e8d4477f21c0b02c5796b458b11e3d622677fc08..8f93288ba372c4241562967c44e5b3674ba367ea 100644 --- a/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh @@ -44,35 +44,35 @@ namespace Properties { // Create new type tags namespace TTag { -struct DarcyTwoPTwoCTypeTag { using InheritsFrom = std::tuple<TwoPTwoCNI, CCTpfaModel>; }; +struct DarcyTwoPTwoCNI { using InheritsFrom = std::tuple<TwoPTwoCNI, CCTpfaModel>; }; } // end namespace TTag // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { using type = Dumux::DarcySubProblem<TypeTag>; }; +struct Problem<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = Dumux::DarcySubProblem<TypeTag>; }; // the fluid system template<class TypeTag> -struct FluidSystem<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { using type = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; }; +struct FluidSystem<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; }; //! Set the default formulation to pw-Sn: This can be over written in the problem. template<class TypeTag> -struct Formulation<TypeTag, TTag::DarcyTwoPTwoCTypeTag> +struct Formulation<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr auto value = TwoPFormulation::p1s0; }; // The gas component balance (air) is replaced by the total mass balance template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { static constexpr int value = 3; }; +struct ReplaceCompEqIdx<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr int value = 3; }; // Set the grid type template<class TypeTag> -struct Grid<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; +struct Grid<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; template<class TypeTag> -struct UseMoles<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { static constexpr bool value = true; }; +struct UseMoles<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr bool value = true; }; template<class TypeTag> -struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoCTypeTag> { using type = TwoPSpatialParams<TypeTag>; }; +struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = TwoPSpatialParams<TypeTag>; }; } /*!