Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux-course
Commits
3b33f594
Commit
3b33f594
authored
Dec 20, 2018
by
Felix Weinhardt
Browse files
[exercisce coupling-ff-pm turbulence]
removed TypeTags endings and changed names of struct, if necessary
parent
067b057b
Changes
7
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-coupling-ff-pm/README.md
View file @
3b33f594
...
...
@@ -229,7 +229,7 @@ liquid saturation as primary variables (p_g-S_l -> `p1s0`) or vice versa.
```
template<class TypeTag>
struct Formulation<TypeTag, TTag::Darcy
TypeTag
>
struct Formulation<TypeTag, TTag::Darcy
OnePNC
>
{ 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
`ZeroEq
TypeTag
`
definition accordingly (non-isothermal zero equation model)
*
Change the entry in the
`
Stokes
ZeroEq`
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.
...
...
exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc
View file @
3b33f594
...
...
@@ -56,16 +56,16 @@ namespace Dumux {
namespace
Properties
{
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
DarcyTwoPTwoC
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
DarcyTwoPTwoC
NI
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
ZeroEq
TypeTag
,
Properties
::
TTag
::
ZeroEq
TypeTag
,
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
Stokes
ZeroEq
,
Properties
::
TTag
::
Stokes
ZeroEq
,
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
::
ZeroEq
TypeTag
;
using
DarcyTypeTag
=
Properties
::
TTag
::
DarcyTwoPTwoC
TypeTag
;
using
StokesTypeTag
=
Properties
::
TTag
::
Stokes
ZeroEq
;
using
DarcyTypeTag
=
Properties
::
TTag
::
DarcyTwoPTwoC
NI
;
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
...
...
exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh
View file @
3b33f594
...
...
@@ -41,16 +41,16 @@ namespace Properties
{
// Create new type tags
namespace
TTag
{
struct
ZeroEq
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNCNI
,
StaggeredFreeFlowModel
>
;
};
struct
Stokes
ZeroEq
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNCNI
,
StaggeredFreeFlowModel
>
;
};
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
struct
Grid
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
// The fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
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
::
ZeroEq
TypeTag
>
{
static
constexpr
int
value
=
3
;
};
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
int
value
=
3
;
};
// Use formulation based on mass fractions
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
UseMoles
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
bool
value
=
true
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
using
type
=
Dumux
::
FreeFlowSubProblem
<
TypeTag
>
;
};
struct
Problem
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
using
type
=
Dumux
::
FreeFlowSubProblem
<
TypeTag
>
;
};
template
<
class
TypeTag
>
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
bool
value
=
true
;
};
}
/*!
...
...
exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh
View file @
3b33f594
...
...
@@ -44,35 +44,35 @@ namespace Properties
{
// Create new type tags
namespace
TTag
{
struct
DarcyTwoPTwoC
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
TwoPTwoCNI
,
CCTpfaModel
>
;
};
struct
DarcyTwoPTwoC
NI
{
using
InheritsFrom
=
std
::
tuple
<
TwoPTwoCNI
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};
struct
Problem
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};
// the fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
using
type
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
};
struct
FluidSystem
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
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
::
DarcyTwoPTwoC
TypeTag
>
struct
Formulation
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
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
::
DarcyTwoPTwoC
TypeTag
>
{
static
constexpr
int
value
=
3
;
};
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
static
constexpr
int
value
=
3
;
};
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
struct
Grid
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
UseMoles
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
using
type
=
TwoPSpatialParams
<
TypeTag
>
;
};
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
using
type
=
TwoPSpatialParams
<
TypeTag
>
;
};
}
/*!
...
...
exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_coupling_ff-pm.cc
View file @
3b33f594
...
...
@@ -56,16 +56,16 @@ namespace Dumux {
namespace
Properties
{
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
DarcyTwoPTwoC
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
DarcyTwoPTwoC
NI
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
ZeroEq
TypeTag
,
Properties
::
TTag
::
ZeroEq
TypeTag
,
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
Stokes
ZeroEq
,
Properties
::
TTag
::
Stokes
ZeroEq
,
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
::
ZeroEq
TypeTag
;
using
DarcyTypeTag
=
Properties
::
TTag
::
DarcyTwoPTwoC
TypeTag
;
using
StokesTypeTag
=
Properties
::
TTag
::
Stokes
ZeroEq
;
using
DarcyTypeTag
=
Properties
::
TTag
::
DarcyTwoPTwoC
NI
;
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
...
...
exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh
View file @
3b33f594
...
...
@@ -47,19 +47,19 @@ namespace Properties
// Create new type tags
namespace
TTag
{
#if EXNUMBER >= 1
struct
ZeroEq
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
ZeroEqNCNI
,
StaggeredFreeFlowModel
>
;
};
struct
Stokes
ZeroEq
{
using
InheritsFrom
=
std
::
tuple
<
ZeroEqNCNI
,
StaggeredFreeFlowModel
>
;
};
#else
struct
ZeroEq
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNCNI
,
StaggeredFreeFlowModel
>
;
};
struct
Stokes
ZeroEq
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNCNI
,
StaggeredFreeFlowModel
>
;
};
#endif
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
struct
Grid
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
// The fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
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
::
ZeroEq
TypeTag
>
{
static
constexpr
int
value
=
3
;
};
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
int
value
=
3
;
};
// Use formulation based on mass fractions
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
UseMoles
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
bool
value
=
true
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
using
type
=
Dumux
::
FreeFlowSubProblem
<
TypeTag
>
;
};
struct
Problem
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
using
type
=
Dumux
::
FreeFlowSubProblem
<
TypeTag
>
;
};
template
<
class
TypeTag
>
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
ZeroEq
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
Stokes
ZeroEq
>
{
static
constexpr
bool
value
=
true
;
};
}
/*!
...
...
exercises/solution/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh
View file @
3b33f594
...
...
@@ -44,35 +44,35 @@ namespace Properties
{
// Create new type tags
namespace
TTag
{
struct
DarcyTwoPTwoC
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
TwoPTwoCNI
,
CCTpfaModel
>
;
};
struct
DarcyTwoPTwoC
NI
{
using
InheritsFrom
=
std
::
tuple
<
TwoPTwoCNI
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};
struct
Problem
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};
// the fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
using
type
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
};
struct
FluidSystem
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
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
::
DarcyTwoPTwoC
TypeTag
>
struct
Formulation
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
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
::
DarcyTwoPTwoC
TypeTag
>
{
static
constexpr
int
value
=
3
;
};
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
static
constexpr
int
value
=
3
;
};
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
struct
Grid
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
UseMoles
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
TypeTag
>
{
using
type
=
TwoPSpatialParams
<
TypeTag
>
;
};
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyTwoPTwoC
NI
>
{
using
type
=
TwoPSpatialParams
<
TypeTag
>
;
};
}
/*!
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment