Skip to content
GitLab
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
453814d3
Commit
453814d3
authored
Mar 31, 2020
by
Ned Coltman
Browse files
[basics][propertiesheader] add the properties header for the 2pni exercise
parent
e1b5ebb4
Changes
5
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-basic/injection2pniproblem.hh
View file @
453814d3
...
...
@@ -25,61 +25,11 @@
#ifndef DUMUX_EX_BASIC_PROBLEM_2PNI_HH
#define DUMUX_EX_BASIC_PROBLEM_2PNI_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/discretization/cctpfa.hh>
#include
<dumux/porousmediumflow/2p/model.hh>
#include
<dumux/common/properties.hh>
#include
<dumux/porousmediumflow/problem.hh>
#include
<dumux/material/fluidsystems/h2on2.hh>
#include
"spatialparams.hh"
namespace
Dumux
{
// forward declare problem
template
<
class
TypeTag
>
class
Injection2PNIProblem
;
namespace
Properties
{
/*!
* TODO:dumux-course-task 4
* Inherit from the TwoPNI model instead of TwoP here
*/
// Create new type tags
namespace
TTag
{
struct
Injection2pNITypeTag
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
>
;
};
struct
Injection2pNICC
{
using
InheritsFrom
=
std
::
tuple
<
Injection2pNITypeTag
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
Injection2PNIProblem
<
TypeTag
>
;
};
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
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
>>
;
};
}
// end namespace Properties
/*!
* \ingroup TwoPModel
* \ingroup ImplicitTestProblems
...
...
exercises/exercise-basic/properties2pni.hh
0 → 100644
View file @
453814d3
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief The two-phase nonisothermal porousmediumflow properties file for exercise-basic
*/
#ifndef DUMUX_EX_BASIC_PROPERTIES_2PNI_HH
#define DUMUX_EX_BASIC_PROPERTIES_2PNI_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/discretization/cctpfa.hh>
#include
<dumux/porousmediumflow/2p/model.hh>
#include
<dumux/material/fluidsystems/h2on2.hh>
#include
"spatialparams.hh"
#include
"injection2pniproblem.hh"
namespace
Dumux
::
Properties
{
/*!
* TODO:dumux-course-task 4
* Inherit from the TwoPNI model instead of TwoP here
*/
// Create new type tags
namespace
TTag
{
struct
Injection2pNITypeTag
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
>
;
};
struct
Injection2pNICC
{
using
InheritsFrom
=
std
::
tuple
<
Injection2pNITypeTag
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
Injection2PNIProblem
<
TypeTag
>
;
};
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
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
>
>
;
};
}
// end namespace Dumux::Properties
#endif
exercises/solution/exercise-basic/2pnimain.cc
View file @
453814d3
...
...
@@ -47,8 +47,8 @@
#include
<dumux/io/vtkoutputmodule.hh>
#include
<dumux/io/grid/gridmanager.hh>
// The pro
blem
file, where
setup-specific boundary and initial condi
tions are defined
.
#include
"
injection2pniproblem
.hh"
// The pro
perties
file, where
the compile time op
tions are defined
#include
"
properties2pni
.hh"
////////////////////////
// the main function
...
...
exercises/solution/exercise-basic/injection2pniproblem.hh
View file @
453814d3
...
...
@@ -25,56 +25,10 @@
#ifndef DUMUX_EX_BASIC_PROBLEM_2PNI_HH
#define DUMUX_EX_BASIC_PROBLEM_2PNI_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/discretization/cctpfa.hh>
#include
<dumux/porousmediumflow/2p/model.hh>
#include
<dumux/common/properties.hh>
#include
<dumux/porousmediumflow/problem.hh>
#include
<dumux/material/fluidsystems/h2on2.hh>
#include
"spatialparams.hh"
namespace
Dumux
{
// forward declare problem
template
<
class
TypeTag
>
class
Injection2PNIProblem
;
namespace
Properties
{
// Create new type tags
namespace
TTag
{
struct
Injection2pNITypeTag
{
using
InheritsFrom
=
std
::
tuple
<
TwoPNI
>
;
};
struct
Injection2pNICC
{
using
InheritsFrom
=
std
::
tuple
<
Injection2pNITypeTag
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
Injection2PNIProblem
<
TypeTag
>
;
};
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
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
>>
;
};
}
// end namespace Properties
/*!
* \ingroup TwoPModel
* \ingroup ImplicitTestProblems
...
...
exercises/solution/exercise-basic/properties2pni.hh
0 → 100644
View file @
453814d3
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief The two-phase nonisothermal porousmediumflow properties file for exercise-basic
*/
#ifndef DUMUX_EX_BASIC_PROPERTIES_2PNI_HH
#define DUMUX_EX_BASIC_PROPERTIES_2PNI_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/discretization/cctpfa.hh>
#include
<dumux/porousmediumflow/2p/model.hh>
#include
<dumux/material/fluidsystems/h2on2.hh>
#include
"spatialparams.hh"
#include
"injection2pniproblem.hh"
namespace
Dumux
::
Properties
{
// Create new type tags
namespace
TTag
{
struct
Injection2pNITypeTag
{
using
InheritsFrom
=
std
::
tuple
<
TwoPNI
>
;
};
struct
Injection2pNICC
{
using
InheritsFrom
=
std
::
tuple
<
Injection2pNITypeTag
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the grid type
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
// Set the problem property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
using
type
=
Injection2PNIProblem
<
TypeTag
>
;
};
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
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
>>
;
};
}
// end namespace Dumux::Properties
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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