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
1a648625
Commit
1a648625
authored
Apr 06, 2020
by
Maziar Veyskarami
Committed by
Ned Coltman
Apr 06, 2020
Browse files
[ex-coupling][models][propertiesheader] move properties to property header
parent
7d381b38
Changes
4
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-coupling-ff-pm/models/freeflowsubproblem.hh
View file @
1a648625
...
...
@@ -24,58 +24,10 @@
#ifndef DUMUX_STOKES1P2C_SUBPROBLEM_HH
#define DUMUX_STOKES1P2C_SUBPROBLEM_HH
#include <dune/grid/yaspgrid.hh>
#include <dumux/material/fluidsystems/1padapter.hh>
#include <dumux/material/fluidsystems/h2oair.hh>
#include <dumux/freeflow/navierstokes/problem.hh>
#include <dumux/discretization/staggered/freeflow/properties.hh>
#include <dumux/freeflow/compositional/navierstokesncmodel.hh>
#include <dumux/common/properties.hh>
namespace
Dumux
{
template
<
class
TypeTag
>
class
FreeFlowSubProblem
;
namespace
Properties
{
// Create new type tags
namespace
TTag
{
struct
StokesNC
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNC
,
StaggeredFreeFlowModel
>
;
};
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
StokesNC
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
// The fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
StokesNC
>
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
H2OAir
::
gasPhaseIdx
>
;
};
// Do not replace one equation with a total mass balance
template
<
class
TypeTag
>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
StokesNC
>
{
static
constexpr
int
value
=
3
;
};
// Use formulation based on mass fractions
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
StokesNC
>
{
static
constexpr
bool
value
=
true
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
StokesNC
>
{
using
type
=
Dumux
::
FreeFlowSubProblem
<
TypeTag
>
;
};
template
<
class
TypeTag
>
struct
EnableGridGeometryCache
<
TypeTag
,
TTag
::
StokesNC
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridFluxVariablesCache
<
TypeTag
,
TTag
::
StokesNC
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
EnableGridVolumeVariablesCache
<
TypeTag
,
TTag
::
StokesNC
>
{
static
constexpr
bool
value
=
true
;
};
}
namespace
Dumux
{
/*!
* \ingroup NavierStokesTests
...
...
@@ -349,6 +301,7 @@ private:
std
::
shared_ptr
<
CouplingManager
>
couplingManager_
;
};
}
//end namespace
}
//end namespace Dumux
#endif // DUMUX_STOKES1P2C_SUBPROBLEM_HH
exercises/exercise-coupling-ff-pm/models/main.cc
View file @
1a648625
...
...
@@ -49,28 +49,7 @@
#include <dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh>
#include "porousmediumsubproblem.hh"
#include "freeflowsubproblem.hh"
namespace
Dumux
{
namespace
Properties
{
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
StokesNC
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
DarcyOnePNC
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
StokesNC
,
Properties
::
TTag
::
StokesNC
,
TypeTag
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
}
// end namespace Properties
}
// end namespace Dumux
#include "properties.hh"
int
main
(
int
argc
,
char
**
argv
)
try
{
...
...
exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh
View file @
1a648625
...
...
@@ -24,78 +24,14 @@
#ifndef DUMUX_DARCY_SUBPROBLEM_HH
#define DUMUX_DARCY_SUBPROBLEM_HH
#include <dune/grid/yaspgrid.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/io/gnuplotinterface.hh>
#include <dumux/material/fluidsystems/1padapter.hh>
#include <dumux/material/fluidsystems/h2oair.hh>
#include <dumux/material/fluidmatrixinteractions/diffusivityconstanttortuosity.hh>
#include <dumux/porousmediumflow/problem.hh>
// TODO: dumux-course-task 2.A
// Include 2pnc model here
#include <dumux/porousmediumflow/1pnc/model.hh>
// TODO: dumux-course-task 2.A
// Include spatial params for a 2-phase system
#include "../1pspatialparams.hh"
namespace
Dumux
{
template
<
class
TypeTag
>
class
PorousMediumSubProblem
;
namespace
Properties
{
// Create new type tags
namespace
TTag
{
// TODO: dumux-course-task 2.A
// Change to property of the `FluidSystem` such that `H2OAir` is used directly.
struct
DarcyOnePNC
{
using
InheritsFrom
=
std
::
tuple
<
OnePNC
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
Dumux
::
PorousMediumSubProblem
<
TypeTag
>
;
};
// The fluid system
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
H2OAir
::
gasPhaseIdx
>
;
};
// Use moles
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
static
constexpr
bool
value
=
true
;
};
#include <dumux/common/properties.hh>
// Do not replace one equation with a total mass balance
template
<
class
TypeTag
>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
static
constexpr
int
value
=
3
;
};
//! Use a model with constant tortuosity for the effective diffusivity
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
>
;
};
// TODO: dumux-course-task 2.A
// Define new formulation for primary variables here.
// Set the spatial paramaters type
template
<
class
TypeTag
>
// TODO: dumux-course-task 2.A
// Adapt the spatial params here.
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
OnePSpatialParams
<
GetPropType
<
TypeTag
,
GridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
}
// end namespace Properties
namespace
Dumux
{
/*!
* \brief The porous medium flow sub problem
*/
template
<
class
TypeTag
>
class
PorousMediumSubProblem
:
public
PorousMediumFlowProblem
<
TypeTag
>
{
...
...
@@ -427,6 +363,7 @@ private:
Dumux
::
GnuplotInterface
<
Scalar
>
gnuplotInterfaceFluxes_
;
Dumux
::
GnuplotInterface
<
Scalar
>
gnuplotStorage_
;
};
}
//end namespace Dumux
#endif //DUMUX_DARCY_SUBPROBLEM_HH
exercises/exercise-coupling-ff-pm/models/properties.hh
View file @
1a648625
...
...
@@ -59,10 +59,23 @@ struct DarcyOnePNC { using InheritsFrom = std::tuple<OnePNC, CCTpfaModel>; };
struct
StokesNC
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNC
,
StaggeredFreeFlowModel
>
;
};
}
// end namespace TTag
// Set the coupling manager
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
StokesNC
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
TypeTag
,
TypeTag
,
Properties
::
TTag
::
DarcyOnePNC
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
template
<
class
TypeTag
>
struct
CouplingManager
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
Traits
=
StaggeredMultiDomainTraits
<
Properties
::
TTag
::
StokesNC
,
Properties
::
TTag
::
StokesNC
,
TypeTag
>
;
using
type
=
Dumux
::
StokesDarcyCouplingManager
<
Traits
>
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
Dumux
::
PorousMediumSubProblem
<
TypeTag
>
;
};
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
StokesNC
>
{
using
type
=
Dumux
::
FreeFlowSubProblem
<
TypeTag
>
;
};
...
...
@@ -73,7 +86,6 @@ struct FluidSystem<TypeTag, TTag::DarcyOnePNC>
using
H2OAir
=
FluidSystems
::
H2OAir
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
H2OAir
::
gasPhaseIdx
>
;
};
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
StokesNC
>
{
...
...
@@ -84,29 +96,26 @@ struct FluidSystem<TypeTag, TTag::StokesNC>
// Use moles
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
UseMoles
<
TypeTag
,
TTag
::
StokesNC
>
{
static
constexpr
bool
value
=
true
;
};
// Do not replace one equation with a total mass balance
template
<
class
TypeTag
>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
static
constexpr
int
value
=
3
;
};
template
<
class
TypeTag
>
struct
ReplaceCompEqIdx
<
TypeTag
,
TTag
::
StokesNC
>
{
static
constexpr
int
value
=
3
;
};
//! Use a model with constant tortuosity for the effective diffusivity
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
>
;
};
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
StokesNC
>
{
using
type
=
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
2
>
>
;
};
//! Use a model with constant tortuosity for the effective diffusivity
template
<
class
TypeTag
>
struct
EffectiveDiffusivityModel
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
DiffusivityConstantTortuosity
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
};
// TODO: dumux-course-task 2.A
// Define new formulation for primary variables here.
...
...
@@ -127,4 +136,4 @@ struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesNC> { static constexp
}
// end namespace Dumux::Properties
#endif //DUMUX_
DARCY
_PROPERTIES_HH
#endif //DUMUX_
EXERCISE_COUPLED_MODELS
_PROPERTIES_HH
Write
Preview
Markdown
is supported
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