diff --git a/exercises/exercise-basic/2p2cmain.cc b/exercises/exercise-basic/2p2cmain.cc index 5ad811997a379a34add459839ae00b81fb8bd733..bce5f7891b3c83af92685c7cc218022b94501358 100644 --- a/exercises/exercise-basic/2p2cmain.cc +++ b/exercises/exercise-basic/2p2cmain.cc @@ -47,8 +47,8 @@ #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager.hh> -// The problem file, where setup-specific boundary and initial conditions are defined. -#include "injection2p2cproblem.hh" +// The properties file, where the compile time options are defined +#include "properties2p2c.hh" //////////////////////// // the main function diff --git a/exercises/exercise-basic/2pmain.cc b/exercises/exercise-basic/2pmain.cc index 3fe5018bd79d3743486d0618663514456a449de5..be0977059fa3a3d5d40f7db9f0c0cc919b914be2 100644 --- a/exercises/exercise-basic/2pmain.cc +++ b/exercises/exercise-basic/2pmain.cc @@ -47,8 +47,8 @@ #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager.hh> -// The problem file, where setup-specific boundary and initial conditions are defined. -#include "injection2pproblem.hh" +// The properties file, where the compile time options are defined +#include "properties2p.hh" //////////////////////// // the main function diff --git a/exercises/exercise-basic/README.md b/exercises/exercise-basic/README.md index 035e0eefc2e0677b06203d890a90eb898f2f7062..4e03660397b5b7a8a8c854e7e5f93b0999a88f42 100644 --- a/exercises/exercise-basic/README.md +++ b/exercises/exercise-basic/README.md @@ -23,6 +23,8 @@ Locate all the files you will need for this exercise * The __main file__ for the __2p2c__ problem : `2p2cmain.cc` * The __problem file__ for the __2p__ problem: `injection2pproblem.hh` * The __problem file__ for the __2p2c__ problem: `injection2p2cproblem.hh` +* The __properties file__ for the __2p__problem: `properties2p.hh` +* The __properties file__ for the __2p2c__problem: `properties2p2c.hh` * The shared __spatial parameters file__: `injection2pspatialparams.hh` * The shared __input file__: `params.input` @@ -60,7 +62,7 @@ paraview injection-2p2c.pvd <hr> * Copy the main file `2pmain.cc` and rename it to `2pnimain.cc` -* In `2pnimain.cc`, include the header `injection2pniproblem.hh` instead of `injection2pproblem.hh`. +* In `2pnimain.cc`, include the header `properties2pni.hh` instead of `properties2p.hh`. * In `2pnimain.cc`, change `Injection2pCC` to `Injection2pNICC` in the line `using TypeTag = Properties::TTag::Injection2pNICC;` * Add a new executable in `CMakeLists.txt` by adding the lines @@ -81,7 +83,9 @@ make exercise_basic_2pni # builds new executable ### Task 4: Setting up a non-isothermal __2pni__ test problem <hr> -* Open the file `injection2pniproblem.hh`. It is a copy of the `injection2pproblem.hh` with some useful comments on how to implement a non-isothermal model. Look for comments containing +* Open the files `injection2pniproblem.hh` and `properties2pni.hh`. +These are a copies of the `injection2pproblem.hh` `properties2pni.hh` files, with some useful comments on how to implement a non-isothermal model. +Look for comments containing ```c++ // TODO: dumux-course-task 4 diff --git a/exercises/exercise-basic/injection2p2cproblem.hh b/exercises/exercise-basic/injection2p2cproblem.hh index 970b1aa13e0b67cb1a1a790ce8e76337173d50b3..911e318442715deac82350dc190fd19ff4f014cf 100644 --- a/exercises/exercise-basic/injection2p2cproblem.hh +++ b/exercises/exercise-basic/injection2p2cproblem.hh @@ -21,59 +21,15 @@ * * \brief The two-phase porousmediumflow problem for exercise-basic */ + #ifndef DUMUX_EX_BASIC_PROBLEM_2P2C_HH #define DUMUX_EX_BASIC_PROBLEM_2P2C_HH -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/cctpfa.hh> -#include <dumux/porousmediumflow/2p2c/model.hh> +#include <dumux/common/properties.hh> #include <dumux/porousmediumflow/problem.hh> -#include <dumux/material/fluidsystems/h2on2.hh> - -#include "spatialparams.hh" namespace Dumux { -// forward declare problem -template <class TypeTag> -class Injection2p2cProblem; - -namespace Properties { -// Create new type tags -namespace TTag { -struct Injection2p2c { using InheritsFrom = std::tuple<TwoPTwoC>; }; -struct Injection2p2cCC { using InheritsFrom = std::tuple<Injection2p2c, CCTpfaModel>; }; -} // end namespace TTag - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::Injection2p2c> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2p2c> { using type = Injection2p2cProblem<TypeTag>; }; - -// Set the spatial parameters -template<class TypeTag> -struct SpatialParams<TypeTag, TTag::Injection2p2c> -{ -private: - using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -public: - using type = InjectionSpatialParams<FVGridGeometry, Scalar>; -}; - -// Set fluid configuration -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::Injection2p2c> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true>>; }; - -// Define whether mole (true) or mass (false) fractions are used -template<class TypeTag> -struct UseMoles<TypeTag, TTag::Injection2p2c> { static constexpr bool value = true; }; -} // end namespace Properties - /*! * \ingroup TwoPTwoCModel * \ingroup ImplicitTestProblems diff --git a/exercises/exercise-basic/injection2pniproblem.hh b/exercises/exercise-basic/injection2pniproblem.hh index a56d804c4df74d583f86cb13a2526e997bd272b0..b464f464359f795ead5196ae073ab2c9e769ac9c 100644 --- a/exercises/exercise-basic/injection2pniproblem.hh +++ b/exercises/exercise-basic/injection2pniproblem.hh @@ -25,61 +25,11 @@ #ifndef DUMUX_EX_BASIC_PROBLEM_2PNI_HH #define DUMUX_EX_BASIC_PROBLEM_2PNI_HH -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/cctpfa.hh> -#include <dumux/porousmediumflow/2p/model.hh> +#include <dumux/common/properties.hh> #include <dumux/porousmediumflow/problem.hh> -#include <dumux/material/fluidsystems/h2on2.hh> - -#include "spatialparams.hh" namespace Dumux { -// forward declare problem -template <class TypeTag> -class Injection2PNIProblem; - -namespace Properties -{ - /*! -* TODO:dumux-course-task 4 -* Inherit from the TwoPNI model instead of TwoP here -*/ -// Create new type tags -namespace TTag { -struct Injection2pNITypeTag { using InheritsFrom = std::tuple<TwoP>; }; -struct Injection2pNICC { using InheritsFrom = std::tuple<Injection2pNITypeTag, CCTpfaModel>; }; -} // end namespace TTag - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; }; - -// Set the spatial parameters -template<class TypeTag> -struct SpatialParams<TypeTag, TTag::Injection2pNITypeTag> -{ -private: - using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -public: - using type = InjectionSpatialParams<FVGridGeometry, Scalar>; -}; - -// Set fluid configuration -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> -{ - using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, - FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; -}; -} // end namespace Properties - /*! * \ingroup TwoPModel * \ingroup ImplicitTestProblems diff --git a/exercises/exercise-basic/injection2pproblem.hh b/exercises/exercise-basic/injection2pproblem.hh index 1b7c1823e2acf5b7b3a6fd497a490e2c69601606..3f17f93c2b7fcc696f004732877b2c8931847d48 100644 --- a/exercises/exercise-basic/injection2pproblem.hh +++ b/exercises/exercise-basic/injection2pproblem.hh @@ -25,53 +25,11 @@ #ifndef DUMUX_EX_BASIC_PROBLEM_2P_HH #define DUMUX_EX_BASIC_PROBLEM_2P_HH -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/cctpfa.hh> -#include <dumux/porousmediumflow/2p/model.hh> +#include <dumux/common/properties.hh> #include <dumux/porousmediumflow/problem.hh> -#include <dumux/material/fluidsystems/h2on2.hh> - -#include "spatialparams.hh" namespace Dumux { -// forward declare problem -template <class TypeTag> -class Injection2PProblem; - -namespace Properties { -// define the TypeTag for this problem with a cell-centered two-point flux approximation spatial discretization. -// Create new type tags -namespace TTag { -struct Injection2p { using InheritsFrom = std::tuple<TwoP>; }; -struct Injection2pCC { using InheritsFrom = std::tuple<Injection2p, CCTpfaModel>; }; -} // end namespace TTag - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2p> { using type = Injection2PProblem<TypeTag>; }; - -// Set the spatial parameters -template<class TypeTag> -struct SpatialParams<TypeTag, TTag::Injection2p> -{ -private: - using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -public: - using type = InjectionSpatialParams<FVGridGeometry, Scalar>; -}; - -// Set fluid configuration -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::Injection2p> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true>>; }; -} // end namespace Properties - /*! * \ingroup TwoPModel * \ingroup ImplicitTestProblems diff --git a/exercises/exercise-basic/properties2p.hh b/exercises/exercise-basic/properties2p.hh new file mode 100644 index 0000000000000000000000000000000000000000..13164ccd25c955ca22094ab88f57e887fb35c867 --- /dev/null +++ b/exercises/exercise-basic/properties2p.hh @@ -0,0 +1,75 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * + * \brief The two-phase porousmediumflow properties file for exercise-basic + */ + +#ifndef DUMUX_EX_BASIC_PROPERTIES_2P_HH +#define DUMUX_EX_BASIC_PROPERTIES_2P_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/cctpfa.hh> +#include <dumux/porousmediumflow/2p/model.hh> +#include <dumux/material/fluidsystems/h2on2.hh> + +#include "injection2pproblem.hh" +#include "spatialparams.hh" + +namespace Dumux::Properties { + +// define the TypeTag for this problem with a cell-centered two-point flux approximation spatial discretization. +// Create new type tags +namespace TTag { +struct Injection2p { using InheritsFrom = std::tuple<TwoP>; }; +struct Injection2pCC { using InheritsFrom = std::tuple<Injection2p, CCTpfaModel>; }; +} // end namespace TTag + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::Injection2p> { using type = Injection2PProblem<TypeTag>; }; + +// Set the spatial parameters +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2p> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; + +// Set fluid configuration +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Injection2p> +{ + using type = FluidSystems::H2ON2< GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true> >; +}; + +} // end namespace Dumux::Properties + +#endif diff --git a/exercises/exercise-basic/properties2p2c.hh b/exercises/exercise-basic/properties2p2c.hh new file mode 100644 index 0000000000000000000000000000000000000000..0db24a196f1ad3470a1da461ce87b7244a7c24a6 --- /dev/null +++ b/exercises/exercise-basic/properties2p2c.hh @@ -0,0 +1,78 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * + * \brief The two-phase two-component porousmediumflow properties file for exercise-basic + */ + +#ifndef DUMUX_EX_BASIC_PROPERTIES_2P2C_HH +#define DUMUX_EX_BASIC_PROPERTIES_2P2C_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/cctpfa.hh> +#include <dumux/porousmediumflow/2p2c/model.hh> +#include <dumux/material/fluidsystems/h2on2.hh> + +#include "injection2p2cproblem.hh" +#include "spatialparams.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct Injection2p2c { using InheritsFrom = std::tuple<TwoPTwoC>; }; +struct Injection2p2cCC { using InheritsFrom = std::tuple<Injection2p2c, CCTpfaModel>; }; +} // end namespace TTag + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::Injection2p2c> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::Injection2p2c> { using type = Injection2p2cProblem<TypeTag>; }; + +// Set the spatial parameters +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2p2c> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; + +// Set fluid configuration +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Injection2p2c> +{ + using type = FluidSystems::H2ON2< GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true> >; +}; + +// Define whether mole (true) or mass (false) fractions are used +template<class TypeTag> +struct UseMoles<TypeTag, TTag::Injection2p2c> { static constexpr bool value = true; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/exercises/exercise-basic/properties2pni.hh b/exercises/exercise-basic/properties2pni.hh new file mode 100644 index 0000000000000000000000000000000000000000..95af6a6ce7dd148c9128da122da9226088a06a05 --- /dev/null +++ b/exercises/exercise-basic/properties2pni.hh @@ -0,0 +1,78 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * + * \brief The two-phase nonisothermal porousmediumflow properties file for exercise-basic + */ + +#ifndef DUMUX_EX_BASIC_PROPERTIES_2PNI_HH +#define DUMUX_EX_BASIC_PROPERTIES_2PNI_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/cctpfa.hh> +#include <dumux/porousmediumflow/2p/model.hh> +#include <dumux/material/fluidsystems/h2on2.hh> + +#include "spatialparams.hh" +#include "injection2pniproblem.hh" + +namespace Dumux::Properties { + + /*! +* TODO:dumux-course-task 4 +* Inherit from the TwoPNI model instead of TwoP here +*/ +// Create new type tags +namespace TTag { +struct Injection2pNITypeTag { using InheritsFrom = std::tuple<TwoP>; }; +struct Injection2pNICC { using InheritsFrom = std::tuple<Injection2pNITypeTag, CCTpfaModel>; }; +} // end namespace TTag + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; }; + +// Set the spatial parameters +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2pNITypeTag> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; + +// Set fluid configuration +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> +{ + using type = FluidSystems::H2ON2< GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true> >; +}; + +} // end namespace Dumux::Properties + +#endif diff --git a/exercises/solution/exercise-basic/2pnimain.cc b/exercises/solution/exercise-basic/2pnimain.cc index d149b8467b9ffcb0a56254d435e88d644d1292e5..4a1939651a930dfa77fe1df51483f63339af07bc 100644 --- a/exercises/solution/exercise-basic/2pnimain.cc +++ b/exercises/solution/exercise-basic/2pnimain.cc @@ -47,8 +47,8 @@ #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager.hh> -// The problem file, where setup-specific boundary and initial conditions are defined. -#include "injection2pniproblem.hh" +// The properties file, where the compile time options are defined +#include "properties2pni.hh" //////////////////////// // the main function diff --git a/exercises/solution/exercise-basic/injection2pniproblem.hh b/exercises/solution/exercise-basic/injection2pniproblem.hh index e3d6c2886d57b263ba7352eec1002d13186f2766..fe3458c294339299b5213f06eb882aa3e3a5c93b 100644 --- a/exercises/solution/exercise-basic/injection2pniproblem.hh +++ b/exercises/solution/exercise-basic/injection2pniproblem.hh @@ -25,56 +25,10 @@ #ifndef DUMUX_EX_BASIC_PROBLEM_2PNI_HH #define DUMUX_EX_BASIC_PROBLEM_2PNI_HH -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/cctpfa.hh> -#include <dumux/porousmediumflow/2p/model.hh> +#include <dumux/common/properties.hh> #include <dumux/porousmediumflow/problem.hh> -#include <dumux/material/fluidsystems/h2on2.hh> - -#include "spatialparams.hh" namespace Dumux { - -// forward declare problem -template <class TypeTag> -class Injection2PNIProblem; - -namespace Properties { -// Create new type tags -namespace TTag { -struct Injection2pNITypeTag { using InheritsFrom = std::tuple<TwoPNI>; }; -struct Injection2pNICC { using InheritsFrom = std::tuple<Injection2pNITypeTag, CCTpfaModel>; }; -} // end namespace TTag - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; }; - -// Set the spatial parameters -template<class TypeTag> -struct SpatialParams<TypeTag, TTag::Injection2pNITypeTag> -{ -private: - using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -public: - using type = InjectionSpatialParams<FVGridGeometry, Scalar>; -}; - -// Set fluid configuration -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> -{ - using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, - FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; -}; -} // end namespace Properties - /*! * \ingroup TwoPModel * \ingroup ImplicitTestProblems diff --git a/exercises/solution/exercise-basic/properties2pni.hh b/exercises/solution/exercise-basic/properties2pni.hh new file mode 100644 index 0000000000000000000000000000000000000000..dd6f0375a193f7778b58e3a509427d70a8af71ed --- /dev/null +++ b/exercises/solution/exercise-basic/properties2pni.hh @@ -0,0 +1,74 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * + * \brief The two-phase nonisothermal porousmediumflow properties file for exercise-basic + */ + +#ifndef DUMUX_EX_BASIC_PROPERTIES_2PNI_HH +#define DUMUX_EX_BASIC_PROPERTIES_2PNI_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/cctpfa.hh> +#include <dumux/porousmediumflow/2p/model.hh> +#include <dumux/material/fluidsystems/h2on2.hh> + +#include "spatialparams.hh" +#include "injection2pniproblem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct Injection2pNITypeTag { using InheritsFrom = std::tuple<TwoPNI>; }; +struct Injection2pNICC { using InheritsFrom = std::tuple<Injection2pNITypeTag, CCTpfaModel>; }; +} // end namespace TTag + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; }; + +// Set the spatial parameters +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::Injection2pNITypeTag> +{ +private: + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = InjectionSpatialParams<FVGridGeometry, Scalar>; +}; + +// Set fluid configuration +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> +{ + using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, + FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/true>>; +}; + +} // end namespace Dumux::Properties + +#endif