Commit e71df3ab authored by Felix Weinhardt's avatar Felix Weinhardt
Browse files

[exercise-fluidsystem]

removed TypeTag ending
parent bd9b5367
......@@ -47,33 +47,33 @@ namespace Properties {
// Create a new type tag for the problem
// Create new type tags
namespace TTag {
struct ExerciseFluidsystemTwoPTwoCTypeTag { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; };
struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; };
} // end namespace TTag
// Set the "Problem" property
template<class TypeTag>
struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag> { using type = ExerciseFluidsystemProblemTwoPTwoC<TypeTag>; };
struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = ExerciseFluidsystemProblemTwoPTwoC<TypeTag>; };
// Set the spatial parameters
SET_TYPE_PROP(ExerciseFluidsystemTwoPTwoCTypeTag, SpatialParams,
SET_TYPE_PROP(ExerciseFluidsystemTwoPTwoC, SpatialParams,
ExerciseFluidsystemSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>);
// Set grid and the grid creator to be used
#if HAVE_DUNE_ALUGRID
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
#elif HAVE_UG
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag> { using type = Dune::UGGrid<2>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = Dune::UGGrid<2>; };
#else
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag> { using type = Dune::YaspGrid<2>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = Dune::YaspGrid<2>; };
#endif // HAVE_DUNE_ALUGRID
// The fluid system property
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
......
......@@ -70,33 +70,33 @@ namespace Properties {
// Create a new type tag for the problem
// Create new type tags
namespace TTag {
struct ExerciseFluidsystemTwoPTypeTag { using InheritsFrom = std::tuple<BoxModel, TwoP>; };
struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<BoxModel, TwoP>; };
} // end namespace TTag
// Set the "Problem" property
template<class TypeTag>
struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag> { using type = ExerciseFluidsystemProblemTwoP<TypeTag>; };
struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = ExerciseFluidsystemProblemTwoP<TypeTag>; };
// Set the spatial parameters
SET_TYPE_PROP(ExerciseFluidsystemTwoPTypeTag, SpatialParams,
SET_TYPE_PROP(ExerciseFluidsystemTwoP, SpatialParams,
ExerciseFluidsystemSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>);
// Set grid to be used
#if HAVE_DUNE_ALUGRID
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
#elif HAVE_UG
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag> { using type = Dune::UGGrid<2>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = Dune::UGGrid<2>; };
#else
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag> { using type = Dune::YaspGrid<2>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = Dune::YaspGrid<2>; };
#endif // HAVE_DUNE_ALUGRID
// we use the immiscible fluid system here
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoP>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
......
......@@ -2,14 +2,14 @@
#part a: 2pproblem
dune_add_test(NAME exercise-fluidsystem_a
SOURCES exercise-fluidsystem.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTypeTag
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoP
COMPILE_ONLY # for testing purposes, ignore for the exercise
CMD_ARGS exercise-fluidsystem_a.input)
#part b: 2p2cproblem
dune_add_test(NAME exercise-fluidsystem_b
SOURCES exercise-fluidsystem.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoCTypeTag
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoC
COMPILE_ONLY # for testing purposes, ignore for the exercise
CMD_ARGS exercise-fluidsystem_b.input)
......
......@@ -35,13 +35,13 @@ To see more components, fluidsystems and binarycoefficients implementations, hav
In the following, the basic steps required to set the desired fluid system are outlined. Here, this is done in the __problem file__, i.e. for this part of the exercise the code shown below is taken from the `2pproblem.hh` file.
In this part of the exercise we will consider a system consisting of two immiscible phases. Therefore, the _TypeTag_ for this problem (`ExerciseFluidsystemTwoPTypeTag`) derives from
In this part of the exercise we will consider a system consisting of two immiscible phases. Therefore, the _TypeTag_ for this problem (`ExerciseFluidsystemTwoP`) derives from
the `TwoP` _TypeTag_ (immiscible two-phase model properties) and the `BoxModel` _TypeTag_ (specifies properties of the discretization scheme).
```c++
// Create new type tags
namespace TTag {
struct ExerciseFluidsystemTwoPTypeTag { using InheritsFrom = std::tuple<BoxModel, TwoP>; };
struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<BoxModel, TwoP>; };
} // end namespace TTag
```
......@@ -99,7 +99,7 @@ the other phase is liquid as well and consists of the incompressible fictitious
```c++
// we use the immiscible fluid system here
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoP>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
......@@ -175,7 +175,7 @@ Compare the gnuplot output to the following plot of the density function from ab
### 3. Implement a new fluid system
The problem file for this part of the exercise is `2p2cproblem.hh`. We now want to implement a new fluid system consisting of two liquid phases, which are water and the previously implemented compressible component. We will consider compositional effects, which is why we now have to derive our _TypeTag_ (`ExerciseFluidsystemTwoPTwoCTypeTag`) from a _TypeTag_ (`TwoPTwoC`) that holds the miscible two-phase
The problem file for this part of the exercise is `2p2cproblem.hh`. We now want to implement a new fluid system consisting of two liquid phases, which are water and the previously implemented compressible component. We will consider compositional effects, which is why we now have to derive our _TypeTag_ (`ExerciseFluidsystemTwoPTwoC`) from a _TypeTag_ (`TwoPTwoC`) that holds the miscible two-phase
two-component model properties:
```c++
......@@ -185,7 +185,7 @@ two-component model properties:
```c++
// Create a new type tag for the problem
struct ExerciseFluidsystemTwoPTwoCTypeTag { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; };
struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; };
} // end namespace TTag
```
......@@ -199,7 +199,7 @@ The new fluid system is to be implemented in the file `fluidsystems/h2omycompres
```c++
// The fluid system property
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
......
......@@ -62,8 +62,8 @@ int main(int argc, char** argv) try
// define the type tag for this problem
// TYPETAG is set in CMakeLists.txt as compile time definition
// alternatively you could write `using TypeTag = Properties::TTag::ExerciseFluidsystemBoxTwoPTypeTag;`
// then, for the 2p2c problem you have to change this line to `using TypeTag = Properties::TTag::ExerciseFluidsystemBoxTwoPTypeTag;`
// alternatively you could write `using TypeTag = Properties::TTag::ExerciseFluidsystemBoxTwoP;`
// then, for the 2p2c problem you have to change this line to `using TypeTag = Properties::TTag::ExerciseFluidsystemBoxTwoP;`
// and recompile the executable
using TypeTag = Properties::TTag::TYPETAG;
......
......@@ -47,33 +47,33 @@ namespace Properties {
// Create a new type tag for the problem
// Create new type tags
namespace TTag {
struct ExerciseFluidsystemTwoPTwoCTypeTag { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; };
struct ExerciseFluidsystemTwoPTwoC { using InheritsFrom = std::tuple<BoxModel, TwoPTwoC>; };
} // end namespace TTag
// Set the "Problem" property
template<class TypeTag>
struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag> { using type = ExerciseFluidsystemProblemTwoPTwoC<TypeTag>; };
struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = ExerciseFluidsystemProblemTwoPTwoC<TypeTag>; };
// Set the spatial parameters
SET_TYPE_PROP(ExerciseFluidsystemTwoPTwoCTypeTag, SpatialParams,
SET_TYPE_PROP(ExerciseFluidsystemTwoPTwoC, SpatialParams,
ExerciseFluidsystemSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>);
// Set grid and the grid creator to be used
#if HAVE_DUNE_ALUGRID
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
#elif HAVE_UG
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag> { using type = Dune::UGGrid<2>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = Dune::UGGrid<2>; };
#else
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag> { using type = Dune::YaspGrid<2>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { using type = Dune::YaspGrid<2>; };
#endif // HAVE_DUNE_ALUGRID
// The fluid system property
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoCTypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
......
......@@ -70,33 +70,33 @@ namespace Properties {
// Create a new type tag for the problem
// Create new type tags
namespace TTag {
struct ExerciseFluidsystemTwoPTypeTag { using InheritsFrom = std::tuple<BoxModel, TwoP>; };
struct ExerciseFluidsystemTwoP { using InheritsFrom = std::tuple<BoxModel, TwoP>; };
} // end namespace TTag
// Set the "Problem" property
template<class TypeTag>
struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag> { using type = ExerciseFluidsystemProblemTwoP<TypeTag>; };
struct Problem<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = ExerciseFluidsystemProblemTwoP<TypeTag>; };
// Set the spatial parameters
SET_TYPE_PROP(ExerciseFluidsystemTwoPTypeTag, SpatialParams,
SET_TYPE_PROP(ExerciseFluidsystemTwoP, SpatialParams,
ExerciseFluidsystemSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>);
// Set grid to be used
#if HAVE_DUNE_ALUGRID
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
#elif HAVE_UG
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag> { using type = Dune::UGGrid<2>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = Dune::UGGrid<2>; };
#else
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag> { using type = Dune::YaspGrid<2>; };
struct Grid<TypeTag, TTag::ExerciseFluidsystemTwoP> { using type = Dune::YaspGrid<2>; };
#endif // HAVE_DUNE_ALUGRID
// we use the immiscible fluid system here
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoPTypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFluidsystemTwoP>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
......
......@@ -2,13 +2,13 @@
#part a: 2pproblem
dune_add_test(NAME exercise-fluidsystem_a_solution
SOURCES exercise-fluidsystem.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTypeTag
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoP
CMD_ARGS exercise-fluidsystem_a_solution.input)
#part b: 2p2cproblem
dune_add_test(NAME exercise-fluidsystem_b_solution
SOURCES exercise-fluidsystem.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoCTypeTag
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoC
CMD_ARGS exercise-fluidsystem_b_solution.input)
# add exercises to the common target
......
......@@ -61,8 +61,8 @@ int main(int argc, char** argv) try
// define the type tag for this problem
// TYPETAG is set in CMakeLists.txt as compile time definition
// alternatively you could write `using TypeTag = Properties::TTag::ExerciseFluidsystemTwoPTypeTag;`
// then, for the 2p2c problem you have to change this line to `using TypeTag = Properties::TTag::ExerciseFluidsystemTwoPTwoCTypeTag;`
// alternatively you could write `using TypeTag = Properties::TTag::ExerciseFluidsystemTwoP;`
// then, for the 2p2c problem you have to change this line to `using TypeTag = Properties::TTag::ExerciseFluidsystemTwoPTwoC;`
// and recompile the executable
using TypeTag = Properties::TTag::TYPETAG;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment