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
Commits
34f1b9d4
Commit
34f1b9d4
authored
Dec 01, 2017
by
Melanie Lipp
Committed by
Timo Koch
Dec 12, 2017
Browse files
[2p2c] Port model and tests to next
parent
21a20b17
Changes
27
Hide whitespace changes
Inline
Side-by-side
dumux/porousmediumflow/2p2c/implicit/indices.hh
View file @
34f1b9d4
...
...
@@ -19,13 +19,12 @@
/*!
* \file
* \brief Defines the indices required for the two-phase two-component
* fully implicit model.
* \brief Defines the indices required for the two-phase two-component model
*/
#ifndef DUMUX_2P2C_INDICES_HH
#define DUMUX_2P2C_INDICES_HH
#include
"
properties.hh
"
#include
<dumux/common/
properties.hh
>
namespace
Dumux
{
...
...
@@ -33,30 +32,20 @@ namespace Dumux
/*!
* \ingroup TwoPTwoCModel
* \ingroup ImplicitIndices
* \brief Enumerates the formulations which the two-phase two-component model accepts.
*/
struct
TwoPTwoCFormulation
{
enum
{
pnsw
,
pwsn
};
};
{
enum
{
pnsw
,
pwsn
};
};
/*!
* \ingroup TwoPTwoCModel
* \ingroup ImplicitIndices
* \brief The indices for the isothermal two-phase two-component model.
*
* \tparam PVOffset The first index in a primary variable vector.
*/
template
<
class
TypeTag
,
int
PVOffset
=
0
>
class
TwoPTwoCIndices
template
<
class
FluidSystem
,
int
PVOffset
=
0
>
struct
TwoPTwoCIndices
{
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
FluidSystem
;
public:
// Phase indices
static
const
int
wPhaseIdx
=
FluidSystem
::
wPhaseIdx
;
//!< Index of the wetting phase
static
const
int
nPhaseIdx
=
FluidSystem
::
nPhaseIdx
;
//!< Index of the non-wetting phase
...
...
@@ -85,6 +74,6 @@ public:
static
const
int
contiNEqIdx
=
conti0EqIdx
+
nCompIdx
;
};
}
}
// end namespace Dumux
#endif
dumux/porousmediumflow/2p2c/implicit/model.hh
View file @
34f1b9d4
...
...
@@ -78,10 +78,5 @@
#define DUMUX_2P2C_MODEL_HH
#include
"properties.hh"
#include
"indices.hh"
#include
"volumevariables.hh"
#include
"primaryvariableswitch.hh"
#include
"vtkoutputfields.hh"
#include
"propertydefaults.hh"
#endif
dumux/porousmediumflow/2p2c/implicit/primaryvariableswitch.hh
View file @
34f1b9d4
...
...
@@ -25,6 +25,7 @@
#define DUMUX_2P2C_PRIMARY_VARIABLE_SWITCH_HH
#include
<dumux/porousmediumflow/compositional/primaryvariableswitch.hh>
#include
"indices.hh"
// for TwoPTwoCFormulation
namespace
Dumux
{
...
...
dumux/porousmediumflow/2p2c/implicit/properties.hh
View file @
34f1b9d4
...
...
@@ -29,10 +29,24 @@
#ifndef DUMUX_2P2C_PROPERTIES_HH
#define DUMUX_2P2C_PROPERTIES_HH
#include
<dumux/implicit/box/properties.hh>
#include
<dumux/implicit/cellcentered/properties.hh>
// property forward declarations
#include
<dumux/common/properties.hh>
#include
<dumux/porousmediumflow/properties.hh>
#include
<dumux/porousmediumflow/nonisothermal/implicit/model.hh>
#include
<dumux/material/spatialparams/implicit.hh>
#include
<dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh>
#include
<dumux/material/fluidmatrixinteractions/diffusivitymillingtonquirk.hh>
#include
<dumux/porousmediumflow/compositional/localresidual.hh>
#include
<dumux/porousmediumflow/compositional/switchableprimaryvariables.hh>
#include
<dumux/porousmediumflow/compositional/privarswitchnewtoncontroller.hh>
#include
"indices.hh"
#include
"volumevariables.hh"
#include
"primaryvariableswitch.hh"
#include
"vtkoutputfields.hh"
namespace
Dumux
{
...
...
@@ -41,43 +55,130 @@ namespace Properties
//////////////////////////////////////////////////////////////////
// Type tags
//////////////////////////////////////////////////////////////////
NEW_TYPE_TAG
(
TwoPTwoC
,
INHERITS_FROM
(
PorousMediumFlow
));
NEW_TYPE_TAG
(
TwoPTwoCNI
,
INHERITS_FROM
(
TwoPTwoC
,
NonIsothermal
));
//! The type tags for the implicit isothermal two-phase two-component problems
NEW_TYPE_TAG
(
TwoPTwoC
);
NEW_TYPE_TAG
(
BoxTwoPTwoC
,
INHERITS_FROM
(
BoxModel
,
TwoPTwoC
));
NEW_TYPE_TAG
(
CCTwoPTwoC
,
INHERITS_FROM
(
CCModel
,
TwoPTwoC
));
//////////////////////////////////////////////////////////////////
// Property values
//////////////////////////////////////////////////////////////////
//! The type tags for the corresponding non-isothermal problems
NEW_TYPE_TAG
(
TwoPTwoCNI
,
INHERITS_FROM
(
TwoPTwoC
,
NonIsothermal
));
NEW_TYPE_TAG
(
BoxTwoPTwoCNI
,
INHERITS_FROM
(
BoxModel
,
TwoPTwoCNI
));
NEW_TYPE_TAG
(
CCTwoPTwoCNI
,
INHERITS_FROM
(
CCModel
,
TwoPTwoCNI
));
//! Set the number of equations to 2
SET_INT_PROP
(
TwoPTwoC
,
NumEq
,
2
);
/*!
* \brief Set the property for the number of components.
*
* We just forward the number from the fluid system and use a static
* assert to make sure it is 2.
*/
SET_PROP
(
TwoPTwoC
,
NumComponents
)
{
static
constexpr
int
value
=
2
;
static_assert
(
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
::
numComponents
==
value
,
"Only fluid systems with 2 components are supported by the 2p-2c model!"
);
};
/*!
* \brief Set the property for the number of fluid phases.
*
* We just forward the number from the fluid system and use a static
* assert to make sure it is 2.
*/
SET_PROP
(
TwoPTwoC
,
NumPhases
)
{
static
constexpr
int
value
=
2
;
static_assert
(
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
::
numPhases
==
value
,
"Only fluid systems with 2 phases are supported by the 2p-2c model!"
);
};
//! Set the vtk output fields specific to the TwoPTwoC model
SET_TYPE_PROP
(
TwoPTwoC
,
VtkOutputFields
,
TwoPTwoCVtkOutputFields
<
TypeTag
>
);
/*!
* \brief The fluid state which is used by the volume variables to
* store the thermodynamic state. This should be chosen
* appropriately for the model ((non-)isothermal, equilibrium, ...).
* This can be done in the problem.
*/
SET_PROP
(
TwoPTwoC
,
FluidState
)
{
private:
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
public:
using
type
=
CompositionalFluidState
<
Scalar
,
FluidSystem
>
;
};
//! Set the default formulation to pw-sn
SET_INT_PROP
(
TwoPTwoC
,
Formulation
,
TwoPTwoCFormulation
::
pwsn
);
//! Set as default that no component mass balance is replaced by the total mass balance
SET_INT_PROP
(
TwoPTwoC
,
ReplaceCompEqIdx
,
GET_PROP_VALUE
(
TypeTag
,
NumComponents
));
//! Use the compositional local residual operator
SET_TYPE_PROP
(
TwoPTwoC
,
LocalResidual
,
CompositionalLocalResidual
<
TypeTag
>
);
//! Enable advection
SET_BOOL_PROP
(
TwoPTwoC
,
EnableAdvection
,
true
);
//! Enable molecular diffusion
SET_BOOL_PROP
(
TwoPTwoC
,
EnableMolecularDiffusion
,
true
);
//! Isothermal model by default
SET_BOOL_PROP
(
TwoPTwoC
,
EnableEnergyBalance
,
false
);
//! The primary variable switch for the 2p2c model
SET_TYPE_PROP
(
TwoPTwoC
,
PrimaryVariableSwitch
,
TwoPTwoCPrimaryVariableSwitch
<
TypeTag
>
);
//! The primary variables vector for the 2p2c model
SET_TYPE_PROP
(
TwoPTwoC
,
PrimaryVariables
,
SwitchablePrimaryVariables
<
TypeTag
,
int
>
);
//! Use the 2p2c VolumeVariables
SET_TYPE_PROP
(
TwoPTwoC
,
VolumeVariables
,
TwoPTwoCVolumeVariables
<
TypeTag
>
);
//! Set the indices required by the isothermal 2p2c
SET_TYPE_PROP
(
TwoPTwoC
,
Indices
,
TwoPTwoCIndices
<
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
),
/*PVOffset=*/
0
>
);
//! Use the ImplicitSpatialParams by default
SET_TYPE_PROP
(
TwoPTwoC
,
SpatialParams
,
ImplicitSpatialParams
<
TypeTag
>
);
//! Use the model after Millington (1961) for the effective diffusivity
SET_TYPE_PROP
(
TwoPTwoC
,
EffectiveDiffusivityModel
,
DiffusivityMillingtonQuirk
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
>
);
//! Use mole fractions in the balance equations by default
SET_BOOL_PROP
(
TwoPTwoC
,
UseMoles
,
true
);
//! Determines whether the constraint solver is used
SET_BOOL_PROP
(
TwoPTwoC
,
UseConstraintSolver
,
true
);
//! Determines whether the Kelvin equation is used to adapt the saturation vapor pressure
SET_BOOL_PROP
(
TwoPTwoC
,
UseKelvinEquation
,
false
);
//! Somerton is used as default model to compute the effective thermal heat conductivity
SET_PROP
(
TwoPTwoCNI
,
ThermalConductivityModel
)
{
private:
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
Indices
=
typename
GET_PROP_TYPE
(
TypeTag
,
Indices
);
public:
using
type
=
ThermalConductivitySomerton
<
Scalar
,
Indices
>
;
};
//////////////////////////////////////////////////////////////////
// Property
tags
// Property
values for isothermal model required for the general non-isothermal model
//////////////////////////////////////////////////////////////////
NEW_PROP_TAG
(
NumPhases
);
//!< Number of fluid phases in the system
NEW_PROP_TAG
(
NumComponents
);
//!< Number of fluid components in the system
NEW_PROP_TAG
(
Indices
);
//!< Enumerations for the model
NEW_PROP_TAG
(
Formulation
);
//!< The formulation of the model
NEW_PROP_TAG
(
SpatialParams
);
//!< The type of the spatial parameters
NEW_PROP_TAG
(
FluidSystem
);
//!< The type of the multi-component relations
NEW_PROP_TAG
(
FluidState
);
//!< The type of the 2p2c fluid state
NEW_PROP_TAG
(
MaterialLaw
);
//!< The material law which ought to be used (extracted from the spatial parameters)
NEW_PROP_TAG
(
EffectiveDiffusivityModel
);
//!< The employed model for the computation of the effective diffusivity
NEW_PROP_TAG
(
ProblemEnableGravity
);
//!< Returns whether gravity is considered in the problem
NEW_PROP_TAG
(
UseMoles
);
//!< Defines whether mole (true) or mass (false) fractions are used
NEW_PROP_TAG
(
UseConstraintSolver
);
//!< Determines whether the constraint solver should be used
NEW_PROP_TAG
(
UseKelvinEquation
);
//!< Determines whether the Kelvin equation is used
NEW_PROP_TAG
(
ReplaceCompEqIdx
);
//!< The index of the total mass balance equation,
//!< if one component balance is replaced (ReplaceCompEqIdx < NumComponents)
NEW_PROP_TAG
(
BaseFluxVariables
);
//!< The base flux variables
NEW_PROP_TAG
(
SpatialParamsForchCoeff
);
//!< Property for the forchheimer coefficient
NEW_PROP_TAG
(
TauTortuosity
);
//!< Tortuosity value (tau) used in macroscopic diffusion
}
}
//set isothermal Indices
SET_TYPE_PROP
(
TwoPTwoCNI
,
IsothermalIndices
,
TwoPTwoCIndices
<
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
),
/*PVOffset=*/
0
>
);
//set isothermal output fields
SET_TYPE_PROP
(
TwoPTwoCNI
,
IsothermalVtkOutputFields
,
TwoPTwoCVtkOutputFields
<
TypeTag
>
);
//set isothermal NumEq
SET_INT_PROP
(
TwoPTwoCNI
,
IsothermalNumEq
,
2
);
}
// end namespace Properties
}
// end namespace Dumux
#endif
dumux/porousmediumflow/2p2c/implicit/propertydefaults.hh
deleted
100644 → 0
View file @
21a20b17
// -*- 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/>. *
*****************************************************************************/
/*!
* \ingroup Properties
* \ingroup ImplicitProperties
* \ingroup TwoPTwoCModel
* \file
*
* \brief Defines default values for most properties required by the
* two-phase two-component fully implicit model.
*/
#ifndef DUMUX_2P2C_PROPERTY_DEFAULTS_HH
#define DUMUX_2P2C_PROPERTY_DEFAULTS_HH
#include
"properties.hh"
#include
"indices.hh"
#include
"volumevariables.hh"
#include
"primaryvariableswitch.hh"
#include
"vtkoutputfields.hh"
#include
<dumux/porousmediumflow/compositional/localresidual.hh>
#include
<dumux/porousmediumflow/compositional/switchableprimaryvariables.hh>
#include
<dumux/porousmediumflow/compositional/privarswitchnewtoncontroller.hh>
#include
<dumux/porousmediumflow/nonisothermal/implicit/propertydefaults.hh>
#include
<dumux/material/fluidmatrixinteractions/diffusivitymillingtonquirk.hh>
#include
<dumux/porousmediumflow/implicit/darcyfluxvariables.hh>
#include
<dumux/material/spatialparams/implicit.hh>
#include
<dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh>
namespace
Dumux
{
namespace
Properties
{
//////////////////////////////////////////////////////////////////
// Property values
//////////////////////////////////////////////////////////////////
/*!
* \brief Set the property for the number of components.
*
* We just forward the number from the fluid system and use a static
* assert to make sure it is 2.
*/
SET_PROP
(
TwoPTwoC
,
NumComponents
)
{
private:
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
FluidSystem
;
public:
static
const
int
value
=
FluidSystem
::
numComponents
;
static_assert
(
value
==
2
,
"Only fluid systems with 2 components are supported by the 2p-2c model!"
);
};
/*!
* \brief Set the property for the number of fluid phases.
*
* We just forward the number from the fluid system and use a static
* assert to make sure it is 2.
*/
SET_PROP
(
TwoPTwoC
,
NumPhases
)
{
private:
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
FluidSystem
;
public:
static
const
int
value
=
FluidSystem
::
numPhases
;
static_assert
(
value
==
2
,
"Only fluid systems with 2 phases are supported by the 2p-2c model!"
);
};
/*!
* \brief The fluid state which is used by the volume variables to
* store the thermodynamic state. This should be chosen
* appropriately for the model ((non-)isothermal, equilibrium, ...).
* This can be done in the problem.
*/
SET_PROP
(
TwoPTwoC
,
FluidState
){
private:
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
Scalar
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
FluidSystem
;
public:
typedef
CompositionalFluidState
<
Scalar
,
FluidSystem
>
type
;
};
//! Set the number of equations to 2
SET_INT_PROP
(
TwoPTwoC
,
NumEq
,
2
);
//! Set the default formulation to pw-sn
SET_INT_PROP
(
TwoPTwoC
,
Formulation
,
TwoPTwoCFormulation
::
pwsn
);
//! Set as default that no component mass balance is replaced by the total mass balance
SET_INT_PROP
(
TwoPTwoC
,
ReplaceCompEqIdx
,
2
);
//! Use the 2p2c local residual operator
SET_TYPE_PROP
(
TwoPTwoC
,
LocalResidual
,
CompositionalLocalResidual
<
TypeTag
>
);
//! Enable advection
SET_BOOL_PROP
(
TwoPTwoC
,
EnableAdvection
,
true
);
//! Enable molecular diffusion
SET_BOOL_PROP
(
TwoPTwoC
,
EnableMolecularDiffusion
,
true
);
//! Isothermal model by default
SET_BOOL_PROP
(
TwoPTwoC
,
EnableEnergyBalance
,
false
);
//! Use the 2p2c Newton controller
SET_TYPE_PROP
(
TwoPTwoC
,
NewtonController
,
PriVarSwitchNewtonController
<
TypeTag
>
);
//! The primary variable switch for the 2p2c model
SET_TYPE_PROP
(
TwoPTwoC
,
PrimaryVariableSwitch
,
TwoPTwoCPrimaryVariableSwitch
<
TypeTag
>
);
//! The primary variables vector for the 2p2c model
SET_TYPE_PROP
(
TwoPTwoC
,
PrimaryVariables
,
SwitchablePrimaryVariables
<
TypeTag
,
int
>
);
//! Use the 2p2c VolumeVariables
SET_TYPE_PROP
(
TwoPTwoC
,
VolumeVariables
,
TwoPTwoCVolumeVariables
<
TypeTag
>
);
//! Set the indices required by the isothermal 2p2c
SET_TYPE_PROP
(
TwoPTwoC
,
Indices
,
TwoPTwoCIndices
<
TypeTag
,
/*PVOffset=*/
0
>
);
//! Use the ImplicitSpatialParams by default
SET_TYPE_PROP
(
TwoPTwoC
,
SpatialParams
,
ImplicitSpatialParams
<
TypeTag
>
);
//! Use the model after Millington (1961) for the effective diffusivity
SET_TYPE_PROP
(
TwoPTwoC
,
EffectiveDiffusivityModel
,
DiffusivityMillingtonQuirk
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
>
);
//! Disable velocity output by default
//! Enable gravity by default
SET_BOOL_PROP
(
TwoPTwoC
,
ProblemEnableGravity
,
true
);
//! Use mole fractions in the balance equations by default
SET_BOOL_PROP
(
TwoPTwoC
,
UseMoles
,
true
);
//! Determines whether the constraint solver is used
SET_BOOL_PROP
(
TwoPTwoC
,
UseConstraintSolver
,
true
);
//! Determines whether the Kelvin equation is used to adapt the saturation vapor pressure
SET_BOOL_PROP
(
TwoPTwoC
,
UseKelvinEquation
,
false
);
//! Set default value for the Forchheimer coefficient
// Source: Ward, J.C. 1964 Turbulent flow in porous media. ASCE J. Hydraul. Div 90.
// Actually the Forchheimer coefficient is also a function of the dimensions of the
// porous medium. Taking it as a constant is only a first approximation
// (Nield, Bejan, Convection in porous media, 2006, p. 10)
SET_SCALAR_PROP
(
TwoPTwoC
,
SpatialParamsForchCoeff
,
0.55
);
/*!
* \brief default value for tortuosity value (tau) used in macroscopic diffusion
*
* Value is 0.5 according to Carman 1937: <i>Fluid flow through granular beds</i>
* \cite carman1937
*/
SET_SCALAR_PROP
(
TwoPTwoC
,
TauTortuosity
,
0.5
);
//! Set the vtk output fields specific to the TwoPTwoC model
SET_TYPE_PROP
(
TwoPTwoC
,
VtkOutputFields
,
TwoPTwoCVtkOutputFields
<
TypeTag
>
);
//! Somerton is used as default model to compute the effective thermal heat conductivity
SET_PROP
(
TwoPTwoCNI
,
ThermalConductivityModel
)
{
private:
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
Scalar
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
Indices
)
Indices
;
public:
typedef
ThermalConductivitySomerton
<
Scalar
,
Indices
>
type
;
};
//! temperature is already written by the isothermal model
SET_BOOL_PROP
(
TwoPTwoCNI
,
NiOutputLevel
,
0
);
//////////////////////////////////////////////////////////////////
// Property values for isothermal model required for the general non-isothermal model
//////////////////////////////////////////////////////////////////
//set isothermal Indices
SET_TYPE_PROP
(
TwoPTwoCNI
,
IsothermalIndices
,
TwoPTwoCIndices
<
TypeTag
,
/*PVOffset=*/
0
>
);
//set isothermal NumEq
SET_INT_PROP
(
TwoPTwoCNI
,
IsothermalNumEq
,
2
);
}
}
#endif
dumux/porousmediumflow/2p2c/implicit/volumevariables.hh
View file @
34f1b9d4
...
...
@@ -25,10 +25,12 @@
#ifndef DUMUX_2P2C_VOLUME_VARIABLES_HH
#define DUMUX_2P2C_VOLUME_VARIABLES_HH
#include
<dumux/implicit/model.hh>
//
#include <dumux/implicit/model.hh>
#include
<dumux/material/fluidstates/compositional.hh>
#include
<dumux/material/constraintsolvers/computefromreferencephase.hh>
#include
<dumux/material/constraintsolvers/misciblemultiphasecomposition.hh>
#include
<dumux/discretization/volumevariables.hh>
#include
<dumux/discretization/methods.hh>
#include
"properties.hh"
#include
"indices.hh"
...
...
@@ -93,7 +95,6 @@ class TwoPTwoCVolumeVariables : public ImplicitVolumeVariables<TypeTag>
using
PermeabilityType
=
typename
SpatialParams
::
PermeabilityType
;
using
ComputeFromReferencePhase
=
Dumux
::
ComputeFromReferencePhase
<
Scalar
,
FluidSystem
>
;
static
constexpr
bool
isBox
=
GET_PROP_VALUE
(
TypeTag
,
ImplicitIsBox
);
static
constexpr
bool
useMoles
=
GET_PROP_VALUE
(
TypeTag
,
UseMoles
);
static
constexpr
bool
useKelvinEquation
=
GET_PROP_VALUE
(
TypeTag
,
UseKelvinEquation
);
static
constexpr
bool
useConstraintSolver
=
GET_PROP_VALUE
(
TypeTag
,
UseConstraintSolver
);
...
...
@@ -105,7 +106,8 @@ class TwoPTwoCVolumeVariables : public ImplicitVolumeVariables<TypeTag>
static
constexpr
int
dim
=
GridView
::
dimension
;
static
constexpr
int
numPhases
=
GET_PROP_VALUE
(
TypeTag
,
NumPhases
);
static
constexpr
int
numComponents
=
GET_PROP_VALUE
(
TypeTag
,
NumComponents
);
static
constexpr
int
dofCodim
=
isBox
?
dim
:
0
;
enum
{
isBox
=
GET_PROP_VALUE
(
TypeTag
,
DiscretizationMethod
)
==
DiscretizationMethods
::
Box
};
enum
{
dofCodim
=
isBox
?
dim
:
0
};
public:
...
...
dumux/porousmediumflow/2p2c/implicit/vtkoutputfields.hh
View file @
34f1b9d4
...
...
@@ -20,18 +20,17 @@
* \file
* \brief Adds vtk output fields specific to the twop model
*/
#ifndef DUMUX_TWOP
_
TWOC_VTK_OUTPUT_FIELDS_HH
#define DUMUX_TWOP
_
TWOC_VTK_OUTPUT_FIELDS_HH
#ifndef DUMUX_TWOPTWOC_VTK_OUTPUT_FIELDS_HH
#define DUMUX_TWOPTWOC_VTK_OUTPUT_FIELDS_HH
#include
<dumux/implicit/properties.hh>
#include
<dumux/porousmediumflow/2p/implicit/vtkoutputfields.hh>
#include
<dumux/common/properties.hh>
namespace
Dumux
{
/*!
* \ingroup TwoPTwoC, InputOutput
* \brief Adds vtk output fields specific to the
T
wo
PTwoC
model
* \brief Adds vtk output fields specific to the
t
wo
-phase two-component
model
*/
template
<
class
TypeTag
>
class
TwoPTwoCVtkOutputFields
...
...
@@ -47,20 +46,27 @@ public:
template
<
class
VtkOutputModule
>
static
void
init
(
VtkOutputModule
&
vtk
)
{
// use default fields from the 2p model
TwoPVtkOutputFields
<
TypeTag
>::
init
(
vtk
);
// register standardized vtk output fields
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
saturation
(
Indices
::
nPhaseIdx
);
},
"Sn"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
saturation
(
Indices
::
wPhaseIdx
);
},
"Sw"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
pressure
(
Indices
::
nPhaseIdx
);
},
"pn"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
pressure
(
Indices
::
wPhaseIdx
);
},
"pw"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
capillaryPressure
();
},
"pc"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
density
(
Indices
::
wPhaseIdx
);
},
"rhoW"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
density
(
Indices
::
nPhaseIdx
);
},
"rhoN"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
mobility
(
Indices
::
wPhaseIdx
);
},
"mobW"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
mobility
(
Indices
::
nPhaseIdx
);
},
"mobN"
);
for
(
int
i
=
0
;
i
<
numPhases
;
++
i
)
for
(
int
j
=
0
;
j
<
numComponents
;
++
j
)
vtk
.
addSecondaryVariable
(
"x_"
+
FluidSystem
::
phaseName
(
i
)
+
"^"
+
FluidSystem
::
componentName
(
j
),
[
i
,
j
](
const
VolumeVariables
&
v
){
return
v
.
moleFraction
(
i
,
j
);
});
vtk
.
addVolumeVariable
([
i
,
j
](
const
VolumeVariables
&
v
){
return
v
.
massFraction
(
i
,
j
);
},
"X_"
+
FluidSystem
::
phaseName
(
i
)
+
"^"
+
FluidSystem
::
componentName
(
j
));
for
(
int
i
=
0
;
i
<
numPhases
;
++
i
)
for
(
int
j
=
0
;
j
<
numComponents
;
++
j
)
vtk
.
addSecondaryVariable
(
"X_"
+
FluidSystem
::
phaseName
(
i
)
+
"^"
+
FluidSystem
::
componentName
(
j
),
[
i
,
j
](
const
VolumeVariables
&
v
){
return
v
.
massFraction
(
i
,
j
);
});
vtk
.
addVolumeVariable
([
i
,
j
](
const
VolumeVariables
&
v
){
return
v
.
moleFraction
(
i
,
j
);
},
"x_"
+
FluidSystem
::
phaseName
(
i
)
+
"^"
+
FluidSystem
::
componentName
(
j
));
vtk
.
addSecondaryVariable
(
"phasePresence"
,
[](
const
VolumeVariables
&
v
){
return
v
.
priVars
().
state
();
});
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
porosity
();
},
"porosity"
);
vtk
.
addVolumeVariable
([](
const
VolumeVariables
&
v
){
return
v
.
priVars
().
state
();
},
"phase presence"
);
}
};
...
...
test/porousmediumflow/2p2c/implicit/injectionproblem.hh
View file @
34f1b9d4
...
...
@@ -24,11 +24,14 @@
#ifndef DUMUX_INJECTION_PROBLEM_HH
#define DUMUX_INJECTION_PROBLEM_HH
#include
<dumux/implicit/cellcentered/tpfa/properties.hh>
#include
<dumux/implicit/cellcentered/mpfa/properties.hh>
#include
<dumux/porousmediumflow/2p2c/implicit/model.hh>
#include
<dumux/discretization/cellcentered/mpfa/properties.hh>
#include
<dumux/discretization/cellcentered/tpfa/properties.hh>
#include
<dumux/discretization/box/properties.hh>
#include
<dumux/discretization/methods.hh>
#include
<dumux/porousmediumflow/problem.hh>
#include
<dumux/porousmediumflow/2p2c/implicit/model.hh>
#include
<dumux/material/fluidsystems/h2on2.hh>
#include
<dumux/linear/seqsolverbackend.hh>
#include
"injectionspatialparams.hh"
...
...
@@ -92,15 +95,20 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag>
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
using
Indices
=
typename
GET_PROP_TYPE
(
TypeTag
,
Indices
);
enum
{
pressureIdx
=
Indices
::
pressureIdx
,
// swIdx = Indices::swIdx,
// snIdx = Indices::snIdx,