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
7ea2877b
Commit
7ea2877b
authored
Dec 21, 2018
by
Timo Koch
Browse files
Merge branch 'feature/update-ex-properties' into 'master'
Feature/update ex properties See merge request
!64
parents
3247ce2d
a71cc138
Pipeline
#761
passed with stage
in 39 seconds
Changes
22
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-basic/injection2p2cproblem.hh
View file @
7ea2877b
...
...
@@ -43,7 +43,7 @@ namespace Properties {
// Create new type tags
namespace
TTag
{
struct
Injection2p2c
{
using
InheritsFrom
=
std
::
tuple
<
TwoPTwoC
>
;
};
struct
Injection2p2cCC
{
using
InheritsFrom
=
std
::
tuple
<
CCTpfaModel
,
Injection2p2c
>
;
};
struct
Injection2p2cCC
{
using
InheritsFrom
=
std
::
tuple
<
Injection2p2c
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the grid type
...
...
@@ -55,9 +55,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
Injection2p2c
>
{
using
type
=
Injection2p2cProblem
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
Injection2p2c
,
SpatialParams
,
InjectionSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2p2c
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
InjectionSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set fluid configuration
template
<
class
TypeTag
>
...
...
exercises/exercise-basic/injection2pniproblem.hh
View file @
7ea2877b
...
...
@@ -61,13 +61,23 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
InjectionProblem2PNI
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
Injection2pNITypeTag
,
SpatialParams
,
InjectionSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
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
>>
;
};
struct
FluidSystem
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
FluidSystems
::
H2ON2
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
FluidSystems
::
H2ON2DefaultPolicy
<
/*fastButSimplifiedRelations=*/
true
>>
;
};
}
// end namespace Properties
/*!
...
...
exercises/exercise-basic/injection2pproblem.hh
View file @
7ea2877b
...
...
@@ -57,9 +57,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
Injection2p
>
{
using
type
=
InjectionProblem2P
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
Injection2p
,
SpatialParams
,
InjectionSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2p
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
InjectionSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set fluid configuration
template
<
class
TypeTag
>
...
...
exercises/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh
View file @
7ea2877b
...
...
@@ -70,9 +70,9 @@ template<class TypeTag>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
static
constexpr
int
value
=
3
;
};
//! Use a model with constant tortuosity for the effective diffusivity
SET_TYPE_PROP
(
DarcyOnePNC
,
EffectiveDiffusivityModel
,
DiffusivityConstantTortuosity
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
EffectiveDiffusivityModel
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
DiffusivityConstantTortuosity
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
};
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
...
...
exercises/exercise-fluidsystem/2p2cproblem.hh
View file @
7ea2877b
...
...
@@ -50,7 +50,7 @@ namespace Properties {
// Create a new type tag for the problem
// Create new type tags
namespace
TTag
{
struct
ExerciseFluidsystemTwoPTwoC
{
using
InheritsFrom
=
std
::
tuple
<
BoxModel
,
TwoPTwoC
>
;
};
struct
ExerciseFluidsystemTwoPTwoC
{
using
InheritsFrom
=
std
::
tuple
<
TwoPTwoC
,
BoxModel
>
;
};
}
// end namespace TTag
// Set the "Problem" property
...
...
@@ -58,9 +58,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoPTwoC
>
{
using
type
=
ExerciseFluidsystemProblemTwoPTwoC
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
ExerciseFluidsystemTwoPTwoC
,
SpatialParams
,
ExerciseFluidsystemSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoPTwoC
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
ExerciseFluidsystemSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set grid and the grid creator to be used
template
<
class
TypeTag
>
...
...
exercises/exercise-fluidsystem/2pproblem.hh
View file @
7ea2877b
...
...
@@ -64,7 +64,7 @@ namespace Properties {
// Create a new type tag for the problem
// Create new type tags
namespace
TTag
{
struct
ExerciseFluidsystemTwoP
{
using
InheritsFrom
=
std
::
tuple
<
BoxModel
,
TwoP
>
;
};
struct
ExerciseFluidsystemTwoP
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
,
BoxModel
>
;
};
}
// end namespace TTag
// Set the "Problem" property
...
...
@@ -72,9 +72,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
using
type
=
ExerciseFluidsystemProblemTwoP
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
ExerciseFluidsystemTwoP
,
SpatialParams
,
ExerciseFluidsystemSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
ExerciseFluidsystemSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set grid to be used
template
<
class
TypeTag
>
...
...
exercises/exercise-fluidsystem/README.md
View file @
7ea2877b
...
...
@@ -41,7 +41,7 @@ the `TwoP` _TypeTag_ (immiscible two-phase model properties) and the `BoxModel`
```
c++
// Create new type tags
namespace
TTag
{
struct
ExerciseFluidsystemTwoP
{
using
InheritsFrom
=
std
::
tuple
<
BoxModel
,
TwoP
>
;
};
struct
ExerciseFluidsystemTwoP
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
,
BoxModel
>
;
};
}
// end namespace TTag
```
...
...
@@ -185,7 +185,7 @@ two-component model properties:
```
c++
// Create a new type tag for the problem
struct
ExerciseFluidsystemTwoPTwoC
{
using
InheritsFrom
=
std
::
tuple
<
BoxModel
,
TwoPTwoC
>
;
};
struct
ExerciseFluidsystemTwoPTwoC
{
using
InheritsFrom
=
std
::
tuple
<
TwoPTwoC
,
BoxModel
>
;
};
}
// end namespace TTag
```
...
...
exercises/exercise-fractures/fractureproblem.hh
View file @
7ea2877b
...
...
@@ -51,7 +51,7 @@ namespace Properties {
// Create new type tag node
namespace
TTag
{
struct
FractureProblem
{
using
InheritsFrom
=
std
::
tuple
<
CCTpfaModel
,
TwoP
>
;
};
struct
FractureProblem
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the grid type
...
...
exercises/exercise-grids/injection2pproblem.hh
View file @
7ea2877b
...
...
@@ -60,9 +60,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
Injection2p
>
{
using
type
=
InjectionProblem2P
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
Injection2p
,
SpatialParams
,
InjectionSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2p
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
InjectionSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set fluid configuration
template
<
class
TypeTag
>
...
...
exercises/exercise-properties/mylocalresidual.hh
View file @
7ea2877b
...
...
@@ -35,24 +35,24 @@ namespace Dumux
* using the n-phase immiscible fully implicit models.
*/
template
<
class
TypeTag
>
class
MyLocalResidual
:
public
G
ET_PROP_TYPE
(
TypeTag
,
BaseLocalResidual
)
class
MyLocalResidual
:
public
G
etPropType
<
TypeTag
,
Properties
::
BaseLocalResidual
>
{
using
ParentType
=
typename
GET_PROP_TYPE
(
TypeTag
,
BaseLocalResidual
)
;
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
;
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
)
;
using
NumEqVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
)
;
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
)
;
using
ElementVolumeVariables
=
typename
G
ET_PROP_TYPE
(
TypeTag
,
GridVolumeVariables
)
::
LocalView
;
using
FluxVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluxVariables
)
;
using
ElementFluxVariablesCache
=
typename
G
ET_PROP_TYPE
(
TypeTag
,
GridFluxVariablesCache
)
::
LocalView
;
using
FVElementGeometry
=
typename
G
ET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
ParentType
=
GetPropType
<
TypeTag
,
Properties
::
BaseLocalResidual
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
Problem
=
GetPropType
<
TypeTag
,
Properties
::
Problem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
using
VolumeVariables
=
GetPropType
<
TypeTag
,
Properties
::
VolumeVariables
>
;
using
ElementVolumeVariables
=
typename
G
etPropType
<
TypeTag
,
Properties
::
GridVolumeVariables
>
::
LocalView
;
using
FluxVariables
=
GetPropType
<
TypeTag
,
Properties
::
FluxVariables
>
;
using
ElementFluxVariablesCache
=
typename
G
etPropType
<
TypeTag
,
Properties
::
GridFluxVariablesCache
>
::
LocalView
;
using
FVElementGeometry
=
typename
G
etPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
)
;
using
GridView
=
GetPropType
<
TypeTag
,
Properties
::
GridView
>
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
EnergyLocalResidual
=
typename
GET_PROP_TYPE
(
TypeTag
,
EnergyLocalResidual
)
;
using
EnergyLocalResidual
=
GetPropType
<
TypeTag
,
Properties
::
EnergyLocalResidual
>
;
using
ModelTraits
=
typename
GET_PROP_TYPE
(
TypeTag
,
ModelTraits
)
;
using
ModelTraits
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
static
constexpr
int
numPhases
=
ModelTraits
::
numPhases
();
static
constexpr
int
conti0EqIdx
=
ModelTraits
::
Indices
::
conti0EqIdx
;
//!< first index for the mass balance
...
...
exercises/exercise-runtimeparams/injection2pproblem.hh
View file @
7ea2877b
...
...
@@ -57,9 +57,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
Injection2p
>
{
using
type
=
InjectionProblem2P
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
Injection2p
,
SpatialParams
,
InjectionSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2p
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
InjectionSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set fluid configuration
template
<
class
TypeTag
>
...
...
exercises/solution/exercise-basic/injection2pniproblem.hh
View file @
7ea2877b
...
...
@@ -56,13 +56,23 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
InjectionProblem2PNI
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
Injection2pNITypeTag
,
SpatialParams
,
InjectionSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
InjectionSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set fluid configuration
SET_TYPE_PROP
(
Injection2pNITypeTag
,
FluidSystem
,
FluidSystems
::
H2ON2
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
FluidSystems
::
H2ON2DefaultPolicy
<
/*fastButSimplifiedRelations=*/
true
>>
);
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
FluidSystems
::
H2ON2
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
FluidSystems
::
H2ON2DefaultPolicy
<
/*fastButSimplifiedRelations=*/
true
>>
;
};
}
// end namespace Properties
/*!
...
...
exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_coupling_ff-pm.cc
View file @
7ea2877b
...
...
@@ -53,15 +53,17 @@
namespace
Dumux
{
namespace
Properties
{
SET_PROP
(
StokesOneP
,
CouplingManager
)
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
StokesOneP
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
TTAG
(
DarcyOneP
)
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
DarcyOneP
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
SET_PROP
(
DarcyOneP
,
CouplingManager
)
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
DarcyOneP
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
TTAG
(
StokesOneP
)
,
TTAG
(
StokesOneP
)
,
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
StokesOneP
,
Properties
::
TTag
::
StokesOneP
,
TypeTag
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
...
...
@@ -83,17 +85,17 @@ int main(int argc, char** argv) try
Parameters
::
init
(
argc
,
argv
);
// Define the sub problem type tags
using
StokesTypeTag
=
TTAG
(
StokesOneP
)
;
using
DarcyTypeTag
=
TTAG
(
DarcyOneP
)
;
using
StokesTypeTag
=
Properties
::
TTag
::
StokesOneP
;
using
DarcyTypeTag
=
Properties
::
TTag
::
DarcyOneP
;
#if EXNUMBER < 3
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
using
DarcyGridManager
=
Dumux
::
GridManager
<
typename
GET_PROP_TYPE
(
DarcyTypeTag
,
Grid
)
>
;
using
DarcyGridManager
=
Dumux
::
GridManager
<
GetPropType
<
DarcyTypeTag
,
Properties
::
Grid
>
>
;
DarcyGridManager
darcyGridManager
;
darcyGridManager
.
init
(
"Darcy"
);
// pass parameter group
using
StokesGridManager
=
Dumux
::
GridManager
<
typename
GET_PROP_TYPE
(
StokesTypeTag
,
Grid
)
>
;
using
StokesGridManager
=
Dumux
::
GridManager
<
GetPropType
<
StokesTypeTag
,
Properties
::
Grid
>
>
;
StokesGridManager
stokesGridManager
;
stokesGridManager
.
init
(
"Stokes"
);
// pass parameter group
...
...
@@ -143,10 +145,10 @@ int main(int argc, char** argv) try
// create the finite volume grid geometry
using
StokesFVGridGeometry
=
typename
GET_PROP_TYPE
(
StokesTypeTag
,
FVGridGeometry
)
;
using
StokesFVGridGeometry
=
GetPropType
<
StokesTypeTag
,
Properties
::
FVGridGeometry
>
;
auto
stokesFvGridGeometry
=
std
::
make_shared
<
StokesFVGridGeometry
>
(
stokesGridView
);
stokesFvGridGeometry
->
update
();
using
DarcyFVGridGeometry
=
typename
GET_PROP_TYPE
(
DarcyTypeTag
,
FVGridGeometry
)
;
using
DarcyFVGridGeometry
=
GetPropType
<
DarcyTypeTag
,
Properties
::
FVGridGeometry
>
;
auto
darcyFvGridGeometry
=
std
::
make_shared
<
DarcyFVGridGeometry
>
(
darcyGridView
);
darcyFvGridGeometry
->
update
();
...
...
@@ -162,9 +164,9 @@ int main(int argc, char** argv) try
constexpr
auto
darcyIdx
=
CouplingManager
::
darcyIdx
;
// the problem (initial and boundary conditions)
using
StokesProblem
=
typename
GET_PROP_TYPE
(
StokesTypeTag
,
Problem
)
;
using
StokesProblem
=
GetPropType
<
StokesTypeTag
,
Properties
::
Problem
>
;
auto
stokesProblem
=
std
::
make_shared
<
StokesProblem
>
(
stokesFvGridGeometry
,
couplingManager
);
using
DarcyProblem
=
typename
GET_PROP_TYPE
(
DarcyTypeTag
,
Problem
)
;
using
DarcyProblem
=
GetPropType
<
DarcyTypeTag
,
Properties
::
Problem
>
;
auto
darcyProblem
=
std
::
make_shared
<
DarcyProblem
>
(
darcyFvGridGeometry
,
couplingManager
);
// the solution vector
...
...
@@ -181,10 +183,10 @@ int main(int argc, char** argv) try
couplingManager
->
init
(
stokesProblem
,
darcyProblem
,
sol
);
// the grid variables
using
StokesGridVariables
=
typename
GET_PROP_TYPE
(
StokesTypeTag
,
GridVariables
)
;
using
StokesGridVariables
=
GetPropType
<
StokesTypeTag
,
Properties
::
GridVariables
>
;
auto
stokesGridVariables
=
std
::
make_shared
<
StokesGridVariables
>
(
stokesProblem
,
stokesFvGridGeometry
);
stokesGridVariables
->
init
(
stokesSol
);
using
DarcyGridVariables
=
typename
GET_PROP_TYPE
(
DarcyTypeTag
,
GridVariables
)
;
using
DarcyGridVariables
=
GetPropType
<
DarcyTypeTag
,
Properties
::
GridVariables
>
;
auto
darcyGridVariables
=
std
::
make_shared
<
DarcyGridVariables
>
(
darcyProblem
,
darcyFvGridGeometry
);
darcyGridVariables
->
init
(
sol
[
darcyIdx
]);
...
...
exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_ffproblem.hh
View file @
7ea2877b
...
...
@@ -43,20 +43,25 @@ class StokesSubProblem;
namespace
Properties
{
NEW_TYPE_TAG
(
StokesOneP
,
INHERITS_FROM
(
StaggeredFreeFlowModel
,
NavierStokes
));
// Create new type tags
namespace
TTag
{
struct
StokesOneP
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokes
,
StaggeredFreeFlowModel
>
;
};
}
// end namespace TTag
// the fluid system
SET_PROP
(
StokesOneP
,
FluidSystem
)
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
StokesOneP
>
{
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
type
=
FluidSystems
::
OnePLiquid
<
Scalar
,
Dumux
::
Components
::
SimpleH2O
<
Scalar
>
>
;
};
// Set the grid type
SET_PROP
(
StokesOneP
,
Grid
)
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
StokesOneP
>
{
static
constexpr
auto
dim
=
2
;
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
TensorGrid
=
Dune
::
YaspGrid
<
2
,
Dune
::
TensorProductCoordinates
<
Scalar
,
dim
>
>
;
#if EXNUMBER < 3 // use "normal" grid
...
...
@@ -68,12 +73,15 @@ SET_PROP(StokesOneP, Grid)
};
// Set the problem property
SET_TYPE_PROP
(
StokesOneP
,
Problem
,
Dumux
::
StokesSubProblem
<
TypeTag
>
);
SET_BOOL_PROP
(
StokesOneP
,
EnableFVGridGeometryCache
,
true
);
SET_BOOL_PROP
(
StokesOneP
,
EnableGridFluxVariablesCache
,
true
);
SET_BOOL_PROP
(
StokesOneP
,
EnableGridVolumeVariablesCache
,
true
);
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
StokesOneP
>
{
using
type
=
Dumux
::
StokesSubProblem
<
TypeTag
>
;
};
template
<
class
TypeTag
>
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
StokesOneP
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
StokesOneP
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
StokesOneP
>
{
static
constexpr
bool
value
=
true
;
};
}
/*!
...
...
@@ -84,25 +92,25 @@ class StokesSubProblem : public NavierStokesProblem<TypeTag>
{
using
ParentType
=
NavierStokesProblem
<
TypeTag
>
;
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
)
;
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
;
using
GridView
=
GetPropType
<
TypeTag
,
Properties
::
GridView
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
Indices
=
typename
G
ET_PROP_TYPE
(
TypeTag
,
ModelTraits
)
::
Indices
;
using
Indices
=
typename
G
etPropType
<
TypeTag
,
Properties
::
ModelTraits
>
::
Indices
;
using
BoundaryTypes
=
typename
GET_PROP_TYPE
(
TypeTag
,
BoundaryTypes
)
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
using
PrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
)
;
using
NumEqVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
)
;
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
;
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
CouplingManager
=
typename
GET_PROP_TYPE
(
TypeTag
,
CouplingManager
)
;
using
CouplingManager
=
GetPropType
<
TypeTag
,
Properties
::
CouplingManager
>
;
public:
StokesSubProblem
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
,
std
::
shared_ptr
<
CouplingManager
>
couplingManager
)
...
...
exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_pmproblem.hh
View file @
7ea2877b
...
...
@@ -84,7 +84,6 @@ template<class TypeTag>
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyOneP
>
{
using
type
=
OnePSpatialParams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
}
// end namespace Properties
/*!
...
...
exercises/solution/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh
View file @
7ea2877b
...
...
@@ -83,9 +83,9 @@ template<class TypeTag>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
static
constexpr
int
value
=
3
;
};
//! Use a model with constant tortuosity for the effective diffusivity
SET_TYPE_PROP
(
DarcyOnePNC
,
EffectiveDiffusivityModel
,
DiffusivityConstantTortuosity
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
EffectiveDiffusivityModel
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
DiffusivityConstantTortuosity
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
};
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
...
...
exercises/solution/exercise-fluidsystem/2p2cproblem.hh
View file @
7ea2877b
...
...
@@ -50,7 +50,7 @@ namespace Properties {
// Create a new type tag for the problem
// Create new type tags
namespace
TTag
{
struct
ExerciseFluidsystemTwoPTwoC
{
using
InheritsFrom
=
std
::
tuple
<
BoxModel
,
TwoPTwoC
>
;
};
struct
ExerciseFluidsystemTwoPTwoC
{
using
InheritsFrom
=
std
::
tuple
<
TwoPTwoC
,
BoxModel
>
;
};
}
// end namespace TTag
// Set the "Problem" property
...
...
@@ -58,9 +58,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoPTwoC
>
{
using
type
=
ExerciseFluidsystemProblemTwoPTwoC
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
ExerciseFluidsystemTwoPTwoC
,
SpatialParams
,
ExerciseFluidsystemSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoPTwoC
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
ExerciseFluidsystemSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set grid and the grid creator to be used
template
<
class
TypeTag
>
...
...
exercises/solution/exercise-fluidsystem/2pproblem.hh
View file @
7ea2877b
...
...
@@ -64,7 +64,7 @@ namespace Properties {
// Create a new type tag for the problem
// Create new type tags
namespace
TTag
{
struct
ExerciseFluidsystemTwoP
{
using
InheritsFrom
=
std
::
tuple
<
BoxModel
,
TwoP
>
;
};
struct
ExerciseFluidsystemTwoP
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
,
BoxModel
>
;
};
}
// end namespace TTag
// Set the "Problem" property
...
...
@@ -72,9 +72,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
using
type
=
ExerciseFluidsystemProblemTwoP
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
ExerciseFluidsystemTwoP
,
SpatialParams
,
ExerciseFluidsystemSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
ExerciseFluidsystemSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set grid to be used
template
<
class
TypeTag
>
...
...
exercises/solution/exercise-fractures/fractureproblem.hh
View file @
7ea2877b
...
...
@@ -51,7 +51,7 @@ namespace Properties {
// Create new type tag node
namespace
TTag
{
struct
FractureProblem
{
using
InheritsFrom
=
std
::
tuple
<
CCTpfaModel
,
TwoP
>
;
};
struct
FractureProblem
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the grid type
...
...
exercises/solution/exercise-grids/injection2pproblem.hh
View file @
7ea2877b
...
...
@@ -68,9 +68,15 @@ template<class TypeTag>
struct
Problem
<
TypeTag
,
TTag
::
Injection2p
>
{
using
type
=
InjectionProblem2P
<
TypeTag
>
;
};
// Set the spatial parameters
SET_TYPE_PROP
(
Injection2p
,
SpatialParams
,
InjectionSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
template
<
class
TypeTag
>