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
2b60f3e4
Commit
2b60f3e4
authored
Apr 03, 2020
by
Maziar Veyskarami
Committed by
Ned Coltman
Apr 06, 2020
Browse files
[ex-fluidsystem-solution][propertiesheader] move properties to property header for 2p case
parent
425ddbc0
Changes
3
Hide whitespace changes
Inline
Side-by-side
exercises/solution/exercise-fluidsystem/2pproblem.hh
View file @
2b60f3e4
...
...
@@ -24,88 +24,18 @@
#ifndef DUMUX_EXERCISE_FLUIDSYSTEM_A_PROBLEM_HH
#define DUMUX_EXERCISE_FLUIDSYSTEM_A_PROBLEM_HH
// The grid manager
#include <dune/grid/yaspgrid.hh>
// The numerical model
#include <dumux/porousmediumflow/2p/model.hh>
// The box discretization
#include <dumux/discretization/box.hh>
// The porous media base problem
#include <dumux/porousmediumflow/problem.hh>
// Spatially dependent parameters
#include "spatialparams.hh"
#include <dumux/common/properties.hh>
// The water component
#include <dumux/material/components/tabulatedcomponent.hh>
#include <dumux/material/components/h2o.hh>
// The components that will be created in this exercise
#include "components/myincompressiblecomponent.hh"
#include "components/mycompressiblecomponent.hh"
// We will only have liquid phases here
#include <dumux/material/fluidsystems/1pliquid.hh>
// The two-phase immiscible fluid system
#include <dumux/material/fluidsystems/2pimmiscible.hh>
// The interface to create plots during simulation
#include <dumux/io/gnuplotinterface.hh>
namespace
Dumux
{
// Forward declaration of the problem class
template
<
class
TypeTag
>
class
ExerciseFluidsystemProblemTwoP
;
namespace
Properties
{
// Create a new type tag for the problem
// Create new type tags
namespace
TTag
{
struct
ExerciseFluidsystemTwoP
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
,
BoxModel
>
;
};
}
// end namespace TTag
// Set the "Problem" property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
using
type
=
ExerciseFluidsystemProblemTwoP
<
TypeTag
>
;
};
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
ExerciseFluidsystemSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set grid to be used
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
// we use the immiscible fluid system here
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
private:
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
TabulatedH2O
=
Components
::
TabulatedComponent
<
Components
::
H2O
<
Scalar
>>
;
using
LiquidWater
=
typename
FluidSystems
::
OnePLiquid
<
Scalar
,
TabulatedH2O
>
;
/*!
* Uncomment first line and comment second line for using the incompressible component
* Uncomment second line and comment first line for using the compressible component
*/
using
LiquidMyComponentPhase
=
typename
FluidSystems
::
OnePLiquid
<
Scalar
,
MyIncompressibleComponent
<
Scalar
>
>
;
// using LiquidMyComponentPhase = typename FluidSystems::OnePLiquid<Scalar, MyCompressibleComponent<Scalar> >;
public:
using
type
=
typename
FluidSystems
::
TwoPImmiscible
<
Scalar
,
LiquidWater
,
LiquidMyComponentPhase
>
;
};
}
namespace
Dumux
{
/*!
* \ingroup TwoPBoxModel
...
...
@@ -320,6 +250,7 @@ private:
Scalar
depthBOR_
;
//! depth at the bottom of the reservoir
Dumux
::
GnuplotInterface
<
double
>
gnuplot_
;
//! collects data for plotting
};
}
}
// end namespace Dumux
#endif
exercises/solution/exercise-fluidsystem/2pproperties.hh
0 → 100644
View file @
2b60f3e4
// -*- 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 properties file for two phase exercise-fluidsystem.
*/
#ifndef DUMUX_EXERCISE_FLUIDSYSTEM_A_PROPERTIES_HH
#define DUMUX_EXERCISE_FLUIDSYSTEM_A_PROPERTIES_HH
// The grid manager
#include <dune/grid/yaspgrid.hh>
// The numerical model
#include <dumux/porousmediumflow/2p/model.hh>
// The box discretization
#include <dumux/discretization/box.hh>
// Spatially dependent parameters
#include "spatialparams.hh"
// The components that will be created in this exercise
#include "components/myincompressiblecomponent.hh"
#include "components/mycompressiblecomponent.hh"
// We will only have liquid phases here
#include <dumux/material/fluidsystems/1pliquid.hh>
// The two-phase immiscible fluid system
#include <dumux/material/fluidsystems/2pimmiscible.hh>
// The problem file, where setup-specific boundary and initial conditions are defined.
#include"2pproblem.hh"
namespace
Dumux
::
Properties
{
// Create a new type tag for the problem
// Create new type tags
namespace
TTag
{
struct
ExerciseFluidsystemTwoP
{
using
InheritsFrom
=
std
::
tuple
<
TwoP
,
BoxModel
>
;
};
}
// end namespace TTag
// Set the "Problem" property
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
using
type
=
ExerciseFluidsystemProblemTwoP
<
TypeTag
>
;
};
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
ExerciseFluidsystemSpatialParams
<
FVGridGeometry
,
Scalar
>
;
};
// Set grid to be used
template
<
class
TypeTag
>
struct
Grid
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
using
type
=
Dune
::
YaspGrid
<
2
>
;
};
// we use the immiscible fluid system here
template
<
class
TypeTag
>
struct
FluidSystem
<
TypeTag
,
TTag
::
ExerciseFluidsystemTwoP
>
{
private:
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
TabulatedH2O
=
Components
::
TabulatedComponent
<
Components
::
H2O
<
Scalar
>>
;
using
LiquidWater
=
typename
FluidSystems
::
OnePLiquid
<
Scalar
,
TabulatedH2O
>
;
/*!
* Uncomment first line and comment second line for using the incompressible component
* Uncomment second line and comment first line for using the compressible component
*/
using
LiquidMyComponentPhase
=
typename
FluidSystems
::
OnePLiquid
<
Scalar
,
MyIncompressibleComponent
<
Scalar
>
>
;
// using LiquidMyComponentPhase = typename FluidSystems::OnePLiquid<Scalar, MyCompressibleComponent<Scalar> >;
public:
using
type
=
typename
FluidSystems
::
TwoPImmiscible
<
Scalar
,
LiquidWater
,
LiquidMyComponentPhase
>
;
};
}
// end namespace Dumux::Properties
#endif
exercises/solution/exercise-fluidsystem/main.cc
View file @
2b60f3e4
...
...
@@ -32,7 +32,7 @@
#include <dune/grid/io/file/vtk.hh>
#include <dune/istl/io.hh>
#include "2ppro
blem
.hh"
#include "2ppro
perties
.hh"
#include "2p2cproblem.hh"
#include <dumux/common/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