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
067b057b
Commit
067b057b
authored
Dec 20, 2018
by
Felix Weinhardt
Browse files
[exercis-coupling-ff-pm models]
removed TypeTag ending and and added suffix NC for Stokes and OnePNC for Darcy
parent
1451d0c3
Changes
6
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-coupling-ff-pm/models/ex_models_coupling_ff-pm.cc
View file @
067b057b
...
...
@@ -56,16 +56,16 @@ namespace Dumux {
namespace
Properties
{
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Stokes
NC
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
Darcy
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
Darcy
OnePNC
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
Stokes
TypeTag
,
Properties
::
TTag
::
Stokes
TypeTag
,
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
Stokes
NC
,
Properties
::
TTag
::
Stokes
NC
,
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
::
Stokes
TypeTag
;
using
DarcyTypeTag
=
Properties
::
TTag
::
Darcy
TypeTag
;
using
StokesTypeTag
=
Properties
::
TTag
::
Stokes
NC
;
using
DarcyTypeTag
=
Properties
::
TTag
::
Darcy
OnePNC
;
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
...
...
exercises/exercise-coupling-ff-pm/models/ex_models_ffproblem.hh
View file @
067b057b
...
...
@@ -42,16 +42,16 @@ namespace Properties
{
// Create new type tags
namespace
TTag
{
struct
Stokes
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNC
,
StaggeredFreeFlowModel
>
;
};
struct
Stokes
NC
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNC
,
StaggeredFreeFlowModel
>
;
};
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
struct
Grid
<
TypeTag
,
TTag
::
Stokes
NC
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
// The fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Stokes
NC
>
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
H2OAir
::
gasPhaseIdx
>
;
...
...
@@ -59,22 +59,22 @@ struct FluidSystem<TypeTag, TTag::StokesTypeTag>
// Do not replace one equation with a total mass balance
template
<
class
TypeTag
>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
int
value
=
3
;
};
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
int
value
=
3
;
};
// Use formulation based on mass fractions
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
UseMoles
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
bool
value
=
true
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
using
type
=
Dumux
::
StokesSubProblem
<
TypeTag
>
;
};
struct
Problem
<
TypeTag
,
TTag
::
Stokes
NC
>
{
using
type
=
Dumux
::
StokesSubProblem
<
TypeTag
>
;
};
template
<
class
TypeTag
>
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
bool
value
=
true
;
};
}
/*!
...
...
exercises/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh
View file @
067b057b
...
...
@@ -46,16 +46,16 @@ namespace Properties
{
// Create new type tags
namespace
TTag
{
struct
Darcy
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
OnePNC
,
CCTpfaModel
>
;
};
struct
Darcy
OnePNC
{
using
InheritsFrom
=
std
::
tuple
<
OnePNC
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};
struct
Problem
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};
// The fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
H2OAir
::
gasPhaseIdx
>
;
...
...
@@ -63,23 +63,23 @@ struct FluidSystem<TypeTag, TTag::DarcyTypeTag>
// Use moles
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
UseMoles
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
static
constexpr
bool
value
=
true
;
};
// Do not replace one equation with a total mass balance
template
<
class
TypeTag
>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
static
constexpr
int
value
=
3
;
};
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
static
constexpr
int
value
=
3
;
};
//! Use a model with constant tortuosity for the effective diffusivity
SET_TYPE_PROP
(
Darcy
TypeTag
,
EffectiveDiffusivityModel
,
SET_TYPE_PROP
(
Darcy
OnePNC
,
EffectiveDiffusivityModel
,
DiffusivityConstantTortuosity
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
struct
Grid
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
// Set the spatial paramaters type
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
using
type
=
OnePSpatialParams
<
TypeTag
>
;
};
struct
SpatialParams
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
type
=
OnePSpatialParams
<
TypeTag
>
;
};
}
template
<
class
TypeTag
>
...
...
exercises/solution/exercise-coupling-ff-pm/models/ex_models_coupling_ff-pm.cc
View file @
067b057b
...
...
@@ -56,16 +56,16 @@ namespace Dumux {
namespace
Properties
{
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Stokes
NC
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
Darcy
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
Darcy
OnePNC
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
Stokes
TypeTag
,
Properties
::
TTag
::
Stokes
TypeTag
,
TypeTag
>
;
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
Stokes
NC
,
Properties
::
TTag
::
Stokes
NC
,
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
::
Stokes
TypeTag
;
using
DarcyTypeTag
=
Properties
::
TTag
::
Darcy
TypeTag
;
using
StokesTypeTag
=
Properties
::
TTag
::
Stokes
NC
;
using
DarcyTypeTag
=
Properties
::
TTag
::
Darcy
OnePNC
;
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
...
...
exercises/solution/exercise-coupling-ff-pm/models/ex_models_ffproblem.hh
View file @
067b057b
...
...
@@ -42,16 +42,16 @@ namespace Properties
{
// Create new type tags
namespace
TTag
{
struct
Stokes
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNC
,
StaggeredFreeFlowModel
>
;
};
struct
Stokes
NC
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNC
,
StaggeredFreeFlowModel
>
;
};
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
struct
Grid
<
TypeTag
,
TTag
::
Stokes
NC
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
// The fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Stokes
NC
>
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
H2OAir
::
gasPhaseIdx
>
;
...
...
@@ -59,22 +59,22 @@ struct FluidSystem<TypeTag, TTag::StokesTypeTag>
// Do not replace one equation with a total mass balance
template
<
class
TypeTag
>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
int
value
=
3
;
};
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
int
value
=
3
;
};
// Use formulation based on mass fractions
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
UseMoles
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
bool
value
=
true
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
using
type
=
Dumux
::
StokesSubProblem
<
TypeTag
>
;
};
struct
Problem
<
TypeTag
,
TTag
::
Stokes
NC
>
{
using
type
=
Dumux
::
StokesSubProblem
<
TypeTag
>
;
};
template
<
class
TypeTag
>
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
Stokes
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
Stokes
NC
>
{
static
constexpr
bool
value
=
true
;
};
}
/*!
...
...
exercises/solution/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh
View file @
067b057b
...
...
@@ -52,19 +52,19 @@ namespace Properties
// Create new type tags
namespace
TTag
{
#if EXNUMBER >= 1
struct
Darcy
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
TwoPNC
,
CCTpfaModel
>
;
};
struct
Darcy
OnePNC
{
using
InheritsFrom
=
std
::
tuple
<
TwoPNC
,
CCTpfaModel
>
;
};
#else
struct
Darcy
TypeTag
{
using
InheritsFrom
=
std
::
tuple
<
OnePNC
,
CCTpfaModel
>
;
};
struct
Darcy
OnePNC
{
using
InheritsFrom
=
std
::
tuple
<
OnePNC
,
CCTpfaModel
>
;
};
#endif
}
// end namespace TTag
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};
struct
Problem
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};
// The fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
#if EXNUMBER == 0
...
...
@@ -76,34 +76,34 @@ struct FluidSystem<TypeTag, TTag::DarcyTypeTag>
// Use moles
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
static
constexpr
bool
value
=
true
;
};
struct
UseMoles
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
static
constexpr
bool
value
=
true
;
};
// Do not replace one equation with a total mass balance
template
<
class
TypeTag
>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
static
constexpr
int
value
=
3
;
};
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
static
constexpr
int
value
=
3
;
};
//! Use a model with constant tortuosity for the effective diffusivity
SET_TYPE_PROP
(
Darcy
TypeTag
,
EffectiveDiffusivityModel
,
SET_TYPE_PROP
(
Darcy
OnePNC
,
EffectiveDiffusivityModel
,
DiffusivityConstantTortuosity
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
);
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
struct
Grid
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
#if EXNUMBER >= 1
//! Set the default formulation to pw-Sn: This can be over written in the problem.
template
<
class
TypeTag
>
struct
Formulation
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
struct
Formulation
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
static
constexpr
auto
value
=
TwoPFormulation
::
p1s0
;
};
#endif
// Set the spatial paramaters type
#if EXNUMBER >= 1
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
using
type
=
TwoPSpatialParams
<
TypeTag
>
;
};
struct
SpatialParams
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
type
=
TwoPSpatialParams
<
TypeTag
>
;
};
#else
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Darcy
TypeTag
>
{
using
type
=
OnePSpatialParams
<
TypeTag
>
;
};
struct
SpatialParams
<
TypeTag
,
TTag
::
Darcy
OnePNC
>
{
using
type
=
OnePSpatialParams
<
TypeTag
>
;
};
#endif
}
...
...
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