diff --git a/exercises/exercise-basic/exercisebasic2p2c.cc b/exercises/exercise-basic/2p2cmain.cc similarity index 100% rename from exercises/exercise-basic/exercisebasic2p2c.cc rename to exercises/exercise-basic/2p2cmain.cc diff --git a/exercises/exercise-basic/exercisebasic2p.cc b/exercises/exercise-basic/2pmain.cc similarity index 100% rename from exercises/exercise-basic/exercisebasic2p.cc rename to exercises/exercise-basic/2pmain.cc diff --git a/exercises/exercise-basic/CMakeLists.txt b/exercises/exercise-basic/CMakeLists.txt index 9281f68db44b0ecfb8e5e68f396c4a6e32eac057..9845ea5fe57bca7195eaf29ca06636b0a234c5fc 100644 --- a/exercises/exercise-basic/CMakeLists.txt +++ b/exercises/exercise-basic/CMakeLists.txt @@ -1,10 +1,10 @@ # the immiscible two-phase simulation program dune_add_test(NAME exercise_basic_2p - SOURCES exercisebasic2p.cc) + SOURCES 2pmain.cc) # the compositional two-phase two-component simulation program dune_add_test(NAME exercise_basic_2p2c - SOURCES exercisebasic2p2c.cc) + SOURCES 2p2cmain.cc) # here, add the two-phase non-isothermal simulation program diff --git a/exercises/exercise-basic/README.md b/exercises/exercise-basic/README.md index 178bdc0d6f8bdeb66d76ea908c49cb249da312bb..c7d5417d2d35695148e167a38212ed84c4c2a4c7 100644 --- a/exercises/exercise-basic/README.md +++ b/exercises/exercise-basic/README.md @@ -18,8 +18,8 @@ This exercise deals with two problems: a two-phase immiscible problem (__2p__) a <hr> Locate all the files you will need for this exercise -* The __main file__ for the __2p__ problem : `exercisebasic2p.cc` -* The __main file__ for the __2p2c__ problem : `exercisebasic2p2c.cc` +* The __main file__ for the __2p__ problem : `2pmain.cc` +* 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 shared __spatial parameters file__: `injection2pspatialparams.hh` @@ -58,15 +58,15 @@ paraview injection-2p2c.pvd ### Task 3: Setting up a new executable (for a non-isothermal simulation) <hr> -* Copy the main file `exercise_basic_2p.cc` and rename it to `exercise_basic_2pni.cc` -* In `exercise_basic_2pni.cc`, include the header `injection2pniproblem.hh` instead of `injection2pproblem.hh`. -* In `exercise_basic_2pni.cc`, change `Injection2pCC` to `Injection2pNICC` in the line `using TypeTag = Properties::TTag::Injection2pNICC;` +* 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`, change `Injection2pCC` to `Injection2pNICC` in the line `using TypeTag = Properties::TTag::Injection2pNICC;` * Add a new executable in `CMakeLists.txt` by adding the lines ```cmake # the two-phase non-isothermal simulation program dune_add_test(NAME exercise_basic_2pni - SOURCES exercise_basic_2pni.cc) + SOURCES 2pnimain.cc) ``` * Test that everything compiles without error diff --git a/exercises/exercise-basic/injection2p2cproblem.hh b/exercises/exercise-basic/injection2p2cproblem.hh index d44a7c5950cde1e7a7956e391fe05708cdf48ad1..16fc3b2410c46203648b3d01568f0ab36697a290 100644 --- a/exercises/exercise-basic/injection2p2cproblem.hh +++ b/exercises/exercise-basic/injection2p2cproblem.hh @@ -31,7 +31,7 @@ #include <dumux/porousmediumflow/problem.hh> #include <dumux/material/fluidsystems/h2on2.hh> -#include "injection2pspatialparams.hh" +#include "spatialparams.hh" namespace Dumux { @@ -69,7 +69,7 @@ public: 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 +// 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 @@ -83,15 +83,15 @@ struct UseMoles<TypeTag, TTag::Injection2p2c> { static constexpr bool value = tr * * The domain is sized 60 m times 40 m. * - * For the mass conservation equation neumann boundary conditions are used on - * the top, on the bottom and on the right of the domain, while dirichlet conditions + * For the mass conservation equation Neumann boundary conditions are used on + * the top, on the bottom and on the right of the domain, while Dirichlet conditions * apply on the left boundary. * * Gas is injected at the right boundary from 7 m to 15 m at a rate of - * 0.001 kg/(s m), the remaining neumann boundaries are no-flow + * 0.001 kg/(s m), the remaining Neumann boundaries are no-flow * boundaries. * - * At the dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a + * At the Dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a * * This problem uses the \ref TwoPModel model. */ @@ -192,7 +192,7 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluate the boundary conditions for a Neumann * boundary segment. * * \param globalPos The position of the integration point of the boundary segment. diff --git a/exercises/exercise-basic/injection2pniproblem.hh b/exercises/exercise-basic/injection2pniproblem.hh index 86fa90010dc1a4967511b6a42fe1b5da030e11df..f8b6ee1267ec397955a67bbef776e1eb5fc904d3 100644 --- a/exercises/exercise-basic/injection2pniproblem.hh +++ b/exercises/exercise-basic/injection2pniproblem.hh @@ -32,13 +32,13 @@ #include <dumux/porousmediumflow/problem.hh> #include <dumux/material/fluidsystems/h2on2.hh> -#include "injection2pspatialparams.hh" +#include "spatialparams.hh" namespace Dumux { // forward declare problem template <class TypeTag> -class InjectionProblem2PNI; +class Injection2PNIProblem; namespace Properties { @@ -58,7 +58,7 @@ struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2 // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = InjectionProblem2PNI<TypeTag>; }; +struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; }; // Set the spatial parameters template<class TypeTag> @@ -89,20 +89,20 @@ struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> * * The domain is sized 60 m times 40 m. * - * For the mass conservation equation neumann boundary conditions are used on - * the top, on the bottom and on the right of the domain, while dirichlet conditions + * For the mass conservation equation Neumann boundary conditions are used on + * the top, on the bottom and on the right of the domain, while Dirichlet conditions * apply on the left boundary. * * Gas is injected at the right boundary from 7 m to 15 m at a rate of - * 0.001 kg/(s m), the remaining neumann boundaries are no-flow + * 0.001 kg/(s m), the remaining Neumann boundaries are no-flow * boundaries. * - * At the dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a + * At the Dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a * * This problem uses the \ref TwoPModel model. */ template<class TypeTag> -class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> +class Injection2PNIProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; using GridView = GetPropType<TypeTag, Properties::GridView>; @@ -120,7 +120,7 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> using GlobalPosition = typename Element::Geometry::GlobalCoordinate; public: - InjectionProblem2PNI(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + Injection2PNIProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry) { // initialize the tables of the fluid system @@ -190,7 +190,7 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluate the boundary conditions for a Neumann * boundary segment. * * \param globalPos The position of the integration point of the boundary segment. diff --git a/exercises/exercise-basic/injection2pproblem.hh b/exercises/exercise-basic/injection2pproblem.hh index d550902c784c3ac31cf0507ed936f55fb1fdb29b..e20e85c8ce34689d2f88d9db145af99b50d33949 100644 --- a/exercises/exercise-basic/injection2pproblem.hh +++ b/exercises/exercise-basic/injection2pproblem.hh @@ -32,13 +32,13 @@ #include <dumux/porousmediumflow/problem.hh> #include <dumux/material/fluidsystems/h2on2.hh> -#include "injection2pspatialparams.hh" +#include "spatialparams.hh" namespace Dumux { // forward declare problem template <class TypeTag> -class InjectionProblem2P; +class Injection2PProblem; namespace Properties { // define the TypeTag for this problem with a cell-centered two-point flux approximation spatial discretization. @@ -54,7 +54,7 @@ struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2p> { using type = InjectionProblem2P<TypeTag>; }; +struct Problem<TypeTag, TTag::Injection2p> { using type = Injection2PProblem<TypeTag>; }; // Set the spatial parameters template<class TypeTag> @@ -94,7 +94,7 @@ struct FluidSystem<TypeTag, TTag::Injection2p> { using type = FluidSystems::H2ON * This problem uses the \ref TwoPModel model. */ template<class TypeTag> -class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> +class Injection2PProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; using GridView = GetPropType<TypeTag, Properties::GridView>; @@ -112,7 +112,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> using GlobalPosition = typename Element::Geometry::GlobalCoordinate; public: - InjectionProblem2P(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + Injection2PProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry) { // initialize the tables of the fluid system diff --git a/exercises/exercise-basic/injection2pspatialparams.hh b/exercises/exercise-basic/spatialparams.hh similarity index 100% rename from exercises/exercise-basic/injection2pspatialparams.hh rename to exercises/exercise-basic/spatialparams.hh diff --git a/exercises/solution/exercise-basic/exercisebasic2pni.cc b/exercises/solution/exercise-basic/2pnimain.cc similarity index 100% rename from exercises/solution/exercise-basic/exercisebasic2pni.cc rename to exercises/solution/exercise-basic/2pnimain.cc diff --git a/exercises/solution/exercise-basic/CMakeLists.txt b/exercises/solution/exercise-basic/CMakeLists.txt index 5ec8e31d10ff5225e91ceed81c1667f861b32a86..2ebe30e2a0da80efff0d6ffa9e4c9293d60556be 100644 --- a/exercises/solution/exercise-basic/CMakeLists.txt +++ b/exercises/solution/exercise-basic/CMakeLists.txt @@ -1,6 +1,6 @@ # the two-phase non-isothermal simulation program dune_add_test(NAME exercise_basic_2pni_solution - SOURCES exercisebasic2pni.cc) + SOURCES 2pnimain.cc) # add exercise to the common target diff --git a/exercises/solution/exercise-basic/injection2pniproblem.hh b/exercises/solution/exercise-basic/injection2pniproblem.hh index 1a43fcfaab89161843084687bcb97523e307950f..73f2fadc0874d70cdadd06a34785a821f850bc0c 100644 --- a/exercises/solution/exercise-basic/injection2pniproblem.hh +++ b/exercises/solution/exercise-basic/injection2pniproblem.hh @@ -32,13 +32,13 @@ #include <dumux/porousmediumflow/problem.hh> #include <dumux/material/fluidsystems/h2on2.hh> -#include "injection2pspatialparams.hh" +#include "spatialparams.hh" namespace Dumux { // forward declare problem template <class TypeTag> -class InjectionProblem2PNI; +class Injection2PNIProblem; namespace Properties { // Create new type tags @@ -53,7 +53,7 @@ struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2 // Set the problem property template<class TypeTag> -struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = InjectionProblem2PNI<TypeTag>; }; +struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; }; // Set the spatial parameters template<class TypeTag> @@ -84,20 +84,20 @@ struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag> * * The domain is sized 60 m times 40 m. * - * For the mass conservation equation neumann boundary conditions are used on - * the top, on the bottom and on the right of the domain, while dirichlet conditions + * For the mass conservation equation Neumann boundary conditions are used on + * the top, on the bottom and on the right of the domain, while Dirichlet conditions * apply on the left boundary. * * Gas is injected at the right boundary from 7 m to 15 m at a rate of - * 0.001 kg/(s m), the remaining neumann boundaries are no-flow + * 0.001 kg/(s m), the remaining Neumann boundaries are no-flow * boundaries. * - * At the dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a + * At the Dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a * * This problem uses the \ref TwoPModel model. */ template<class TypeTag> -class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> +class Injection2PNIProblem : public PorousMediumFlowProblem<TypeTag> { using ParentType = PorousMediumFlowProblem<TypeTag>; using GridView = GetPropType<TypeTag, Properties::GridView>; @@ -115,7 +115,7 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag> using GlobalPosition = typename Element::Geometry::GlobalCoordinate; public: - InjectionProblem2PNI(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + Injection2PNIProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry) { // initialize the tables of the fluid system @@ -185,7 +185,7 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluate the boundary conditions for a Neumann * boundary segment. * * \param globalPos The position of the integration point of the boundary segment. diff --git a/exercises/solution/exercise-basic/exercise_basic_2pni_solution.input b/exercises/solution/exercise-basic/params.input similarity index 100% rename from exercises/solution/exercise-basic/exercise_basic_2pni_solution.input rename to exercises/solution/exercise-basic/params.input diff --git a/exercises/solution/exercise-basic/injection2pspatialparams.hh b/exercises/solution/exercise-basic/spatialparams.hh similarity index 100% rename from exercises/solution/exercise-basic/injection2pspatialparams.hh rename to exercises/solution/exercise-basic/spatialparams.hh