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
Commits
6d606fbc
Commit
6d606fbc
authored
Jun 28, 2019
by
Katharina Heck
Committed by
Ned Coltman
Mar 26, 2020
Browse files
[2p][2p1c][2pncmin][co2] add effective coeffs in volvars and adapt volvar traits
parent
42f19e9a
Changes
7
Hide whitespace changes
Inline
Side-by-side
dumux/porousmediumflow/2p/model.hh
View file @
6d606fbc
...
...
@@ -126,6 +126,34 @@ struct TwoPVolumeVariablesTraits
using
SaturationReconstruction
=
SR
;
};
/*!
* \ingroup TwoPModel
* \brief Traits class for the two-phase nonisothermal model.
*
* \tparam PV The type used for primary variables
* \tparam FSY The fluid system type
* \tparam FST The fluid state type
* \tparam SSY The solid system type
* \tparam SST The solid state type
* \tparam PT The type used for permeabilities
* \tparam MT The model traits
* \tparam SR The class used for reconstruction of
* non-wetting phase saturations in scvs
*/
template
<
class
PV
,
class
FSY
,
class
FST
,
class
SSY
,
class
SST
,
class
PT
,
class
MT
,
class
SR
,
class
ETCM
>
struct
TwoPNIVolumeVariablesTraits
{
using
PrimaryVariables
=
PV
;
using
FluidSystem
=
FSY
;
using
FluidState
=
FST
;
using
SolidSystem
=
SSY
;
using
SolidState
=
SST
;
using
PermeabilityType
=
PT
;
using
ModelTraits
=
MT
;
using
SaturationReconstruction
=
SR
;
using
EffectiveThermalConductivityModel
=
ETCM
;
};
// necessary for models derived from 2p
class
TwoPIOFields
;
...
...
@@ -210,6 +238,30 @@ public:
template
<
class
TypeTag
>
struct
ModelTraits
<
TypeTag
,
TTag
::
TwoPNI
>
{
using
type
=
PorousMediumFlowNIModelTraits
<
GetPropType
<
TypeTag
,
Properties
::
BaseModelTraits
>>
;
};
//! Set the volume variables property
template
<
class
TypeTag
>
struct
VolumeVariables
<
TypeTag
,
TTag
::
TwoPNI
>
{
private:
using
PV
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
FSY
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
FST
=
GetPropType
<
TypeTag
,
Properties
::
FluidState
>
;
using
SSY
=
GetPropType
<
TypeTag
,
Properties
::
SolidSystem
>
;
using
SST
=
GetPropType
<
TypeTag
,
Properties
::
SolidState
>
;
using
MT
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
using
PT
=
typename
GetPropType
<
TypeTag
,
Properties
::
SpatialParams
>::
PermeabilityType
;
using
ETCM
=
GetPropType
<
TypeTag
,
Properties
::
ThermalConductivityModel
>
;
static
constexpr
auto
DM
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
discMethod
;
static
constexpr
bool
enableIS
=
getPropValue
<
TypeTag
,
Properties
::
EnableBoxInterfaceSolver
>
();
// class used for scv-wise reconstruction of non-wetting phase saturations
using
SR
=
TwoPScvSaturationReconstruction
<
DM
,
enableIS
>
;
using
Traits
=
TwoPNIVolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
,
SR
,
ETCM
>
;
public:
using
type
=
TwoPVolumeVariables
<
Traits
>
;
};
//! Set the vtk output fields specific to the non-isothermal twop model
template
<
class
TypeTag
>
struct
IOFields
<
TypeTag
,
TTag
::
TwoPNI
>
{
using
type
=
EnergyIOFields
<
TwoPIOFields
>
;
};
...
...
dumux/porousmediumflow/2p/volumevariables.hh
View file @
6d606fbc
...
...
@@ -94,21 +94,21 @@ public:
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
int
wPhaseIdx
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
const
int
nPhaseIdx
=
1
-
wPhaseIdx
;
const
int
nPhaseIdx
=
1
-
wPhaseIdx_
;
mobility_
[
wPhaseIdx
]
=
MaterialLaw
::
krw
(
materialParams
,
fluidState_
.
saturation
(
wPhaseIdx
))
/
fluidState_
.
viscosity
(
wPhaseIdx
);
mobility_
[
wPhaseIdx
_
]
=
MaterialLaw
::
krw
(
materialParams
,
fluidState_
.
saturation
(
wPhaseIdx
_
))
/
fluidState_
.
viscosity
(
wPhaseIdx
_
);
mobility_
[
nPhaseIdx
]
=
MaterialLaw
::
krn
(
materialParams
,
fluidState_
.
saturation
(
wPhaseIdx
))
MaterialLaw
::
krn
(
materialParams
,
fluidState_
.
saturation
(
wPhaseIdx
_
))
/
fluidState_
.
viscosity
(
nPhaseIdx
);
// porosity calculation over inert volumefraction
updateSolidVolumeFractions
(
elemSol
,
problem
,
element
,
scv
,
solidState_
,
numFluidComps
);
EnergyVolVars
::
updateSolidEnergyParams
(
elemSol
,
problem
,
element
,
scv
,
solidState_
);
permeability_
=
problem
.
spatialParams
().
permeability
(
element
,
scv
,
elemSol
);
EnergyVolVars
::
updateEffectiveThermalConductivity
();
}
/*!
...
...
@@ -137,15 +137,15 @@ public:
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()];
const
int
wPhaseIdx
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
wPhaseIdx
_
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
if
(
formulation
==
TwoPFormulation
::
p0s1
)
{
fluidState
.
setPressure
(
phase0Idx
,
priVars
[
pressureIdx
]);
if
(
wPhaseIdx
==
phase1Idx
)
if
(
wPhaseIdx
_
==
phase1Idx
)
{
fluidState
.
setSaturation
(
phase1Idx
,
priVars
[
saturationIdx
]);
fluidState
.
setSaturation
(
phase0Idx
,
1
-
priVars
[
saturationIdx
]);
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
));
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
_
));
fluidState
.
setPressure
(
phase1Idx
,
priVars
[
pressureIdx
]
-
pc_
);
}
else
...
...
@@ -154,27 +154,27 @@ public:
scv
,
elemSol
,
priVars
[
saturationIdx
]);
fluidState
.
setSaturation
(
phase1Idx
,
Sn
);
fluidState
.
setSaturation
(
phase0Idx
,
1
-
Sn
);
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
));
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
_
));
fluidState
.
setPressure
(
phase1Idx
,
priVars
[
pressureIdx
]
+
pc_
);
}
}
else
if
(
formulation
==
TwoPFormulation
::
p1s0
)
{
fluidState
.
setPressure
(
phase1Idx
,
priVars
[
pressureIdx
]);
if
(
wPhaseIdx
==
phase1Idx
)
if
(
wPhaseIdx
_
==
phase1Idx
)
{
const
auto
Sn
=
Traits
::
SaturationReconstruction
::
reconstructSn
(
problem
.
spatialParams
(),
element
,
scv
,
elemSol
,
priVars
[
saturationIdx
]);
fluidState
.
setSaturation
(
phase0Idx
,
Sn
);
fluidState
.
setSaturation
(
phase1Idx
,
1
-
Sn
);
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
));
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
_
));
fluidState
.
setPressure
(
phase0Idx
,
priVars
[
pressureIdx
]
+
pc_
);
}
else
{
fluidState
.
setSaturation
(
phase0Idx
,
priVars
[
saturationIdx
]);
fluidState
.
setSaturation
(
phase1Idx
,
1
-
priVars
[
saturationIdx
]);
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
));
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
_
));
fluidState
.
setPressure
(
phase0Idx
,
priVars
[
pressureIdx
]
-
pc_
);
}
}
...
...
@@ -284,11 +284,18 @@ public:
const
PermeabilityType
&
permeability
()
const
{
return
permeability_
;
}
/*!
* \brief Returns the wetting phase index
*/
const
int
wettingPhaseIdx
()
const
{
return
wPhaseIdx_
;
}
protected:
FluidState
fluidState_
;
SolidState
solidState_
;
private:
int
wPhaseIdx_
;
Scalar
pc_
;
Scalar
porosity_
;
PermeabilityType
permeability_
;
...
...
dumux/porousmediumflow/2p1c/model.hh
View file @
6d606fbc
...
...
@@ -113,7 +113,7 @@ struct TwoPOneCNIModelTraits
* \tparam PT The type used for permeabilities
* \tparam MT The model traits
*/
template
<
class
PV
,
class
FSY
,
class
FST
,
class
SSY
,
class
SST
,
class
PT
,
class
MT
>
template
<
class
PV
,
class
FSY
,
class
FST
,
class
SSY
,
class
SST
,
class
PT
,
class
MT
,
class
ETCM
>
struct
TwoPOneCNIVolumeVariablesTraits
{
using
PrimaryVariables
=
PV
;
...
...
@@ -123,6 +123,7 @@ struct TwoPOneCNIVolumeVariablesTraits
using
SolidState
=
SST
;
using
PermeabilityType
=
PT
;
using
ModelTraits
=
MT
;
using
EffectiveThermalConductivityModel
=
ETCM
;
};
namespace
Properties
{
...
...
@@ -181,11 +182,12 @@ private:
using
SST
=
GetPropType
<
TypeTag
,
Properties
::
SolidState
>
;
using
MT
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
using
PT
=
typename
GetPropType
<
TypeTag
,
Properties
::
SpatialParams
>::
PermeabilityType
;
using
ETCM
=
GetPropType
<
TypeTag
,
Properties
::
ThermalConductivityModel
>
;
static_assert
(
FSY
::
numComponents
==
1
,
"Only fluid systems with 1 component are supported by the 2p1cni model!"
);
static_assert
(
FSY
::
numPhases
==
2
,
"Only fluid systems with 2 phases are supported by the 2p1cni model!"
);
using
Traits
=
TwoPOneCNIVolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
>
;
using
Traits
=
TwoPOneCNIVolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
,
ETCM
>
;
public:
using
type
=
TwoPOneCVolumeVariables
<
Traits
>
;
};
...
...
dumux/porousmediumflow/2p1c/volumevariables.hh
View file @
6d606fbc
...
...
@@ -129,7 +129,6 @@ public:
/////////////
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
int
wPhaseIdx
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
// Second instance of a parameter cache.
// Could be avoided if diffusion coefficients also
...
...
@@ -140,11 +139,11 @@ public:
{
// relative permeabilities
Scalar
kr
;
if
(
phaseIdx
==
wPhaseIdx
)
kr
=
MaterialLaw
::
krw
(
materialParams
,
saturation
(
wPhaseIdx
));
if
(
phaseIdx
==
wPhaseIdx
_
)
kr
=
MaterialLaw
::
krw
(
materialParams
,
saturation
(
wPhaseIdx
_
));
else
// ATTENTION: krn requires the wetting phase saturation
// as parameter!
kr
=
MaterialLaw
::
krn
(
materialParams
,
saturation
(
wPhaseIdx
));
kr
=
MaterialLaw
::
krn
(
materialParams
,
saturation
(
wPhaseIdx
_
));
relativePermeability_
[
phaseIdx
]
=
kr
;
Valgrind
::
CheckDefined
(
relativePermeability_
[
phaseIdx
]);
}
...
...
@@ -154,6 +153,7 @@ public:
updateSolidVolumeFractions
(
elemSol
,
problem
,
element
,
scv
,
solidState_
,
numFluidComps
);
EnergyVolVars
::
updateSolidEnergyParams
(
elemSol
,
problem
,
element
,
scv
,
solidState_
);
permeability_
=
problem
.
spatialParams
().
permeability
(
element
,
scv
,
elemSol
);
EnergyVolVars
::
updateEffectiveThermalConductivity
();
}
/*!
...
...
@@ -178,8 +178,8 @@ public:
// capillary pressure parameters
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
int
wPhaseIdx
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
fluidState
.
setWettingPhase
(
wPhaseIdx
);
wPhaseIdx
_
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
fluidState
.
setWettingPhase
(
wPhaseIdx
_
);
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()];
const
auto
phasePresence
=
priVars
.
state
();
...
...
@@ -213,17 +213,17 @@ public:
// set pressures of the fluid phases
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
));
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
_
));
if
(
formulation
==
TwoPFormulation
::
p0s1
)
{
fluidState
.
setPressure
(
liquidPhaseIdx
,
priVars
[
pressureIdx
]);
fluidState
.
setPressure
(
gasPhaseIdx
,
(
wPhaseIdx
==
liquidPhaseIdx
)
?
priVars
[
pressureIdx
]
+
pc_
fluidState
.
setPressure
(
gasPhaseIdx
,
(
wPhaseIdx
_
==
liquidPhaseIdx
)
?
priVars
[
pressureIdx
]
+
pc_
:
priVars
[
pressureIdx
]
-
pc_
);
}
else
{
fluidState
.
setPressure
(
gasPhaseIdx
,
priVars
[
pressureIdx
]);
fluidState
.
setPressure
(
liquidPhaseIdx
,
(
wPhaseIdx
==
liquidPhaseIdx
)
?
priVars
[
pressureIdx
]
-
pc_
fluidState
.
setPressure
(
liquidPhaseIdx
,
(
wPhaseIdx
_
==
liquidPhaseIdx
)
?
priVars
[
pressureIdx
]
-
pc_
:
priVars
[
pressureIdx
]
+
pc_
);
}
...
...
@@ -270,14 +270,13 @@ public:
{
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()];
const
auto
phasePresence
=
priVars
.
state
();
const
int
wPhaseIdx
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
// get temperature
Scalar
fluidTemperature
;
if
(
phasePresence
==
liquidPhaseOnly
||
phasePresence
==
gasPhaseOnly
)
fluidTemperature
=
priVars
[
switchIdx
];
else
if
(
phasePresence
==
twoPhases
)
fluidTemperature
=
FluidSystem
::
vaporTemperature
(
fluidState
,
wPhaseIdx
);
fluidTemperature
=
FluidSystem
::
vaporTemperature
(
fluidState
,
wPhaseIdx
_
);
else
DUNE_THROW
(
Dune
::
InvalidStateException
,
"phasePresence: "
<<
phasePresence
<<
" is invalid."
);
...
...
@@ -399,11 +398,18 @@ public:
Scalar
vaporTemperature
()
const
{
return
FluidSystem
::
vaporTemperature
(
fluidState_
,
liquidPhaseIdx
);}
/*!
* \brief Returns the wetting phase index
*/
const
int
wettingPhaseIdx
()
const
{
return
wPhaseIdx_
;
}
protected:
FluidState
fluidState_
;
SolidState
solidState_
;
private:
int
wPhaseIdx_
;
Scalar
pc_
;
// The capillary pressure
PermeabilityType
permeability_
;
// Effective permeability within the control volume
...
...
dumux/porousmediumflow/2pncmin/model.hh
View file @
6d606fbc
...
...
@@ -136,8 +136,9 @@ private:
using
SST
=
GetPropType
<
TypeTag
,
Properties
::
SolidState
>
;
using
MT
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
using
PT
=
typename
GetPropType
<
TypeTag
,
Properties
::
SpatialParams
>::
PermeabilityType
;
using
EDM
=
GetPropType
<
TypeTag
,
Properties
::
EffectiveDiffusivityModel
>
;
using
Traits
=
TwoPNCVolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
>
;
using
Traits
=
TwoPNCVolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
,
EDM
>
;
using
NonMinVolVars
=
TwoPNCVolumeVariables
<
Traits
>
;
public:
using
type
=
MineralizationVolumeVariables
<
Traits
,
NonMinVolVars
>
;
...
...
@@ -186,6 +187,26 @@ public:
using
type
=
PorousMediumFlowNIModelTraits
<
IsothermalTraits
>
;
};
//! Set the volume variables property
template
<
class
TypeTag
>
struct
VolumeVariables
<
TypeTag
,
TTag
::
TwoPNCMinNI
>
{
private:
using
PV
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
FSY
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
FST
=
GetPropType
<
TypeTag
,
Properties
::
FluidState
>
;
using
SSY
=
GetPropType
<
TypeTag
,
Properties
::
SolidSystem
>
;
using
SST
=
GetPropType
<
TypeTag
,
Properties
::
SolidState
>
;
using
MT
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
using
PT
=
typename
GetPropType
<
TypeTag
,
Properties
::
SpatialParams
>::
PermeabilityType
;
using
EDM
=
GetPropType
<
TypeTag
,
Properties
::
EffectiveDiffusivityModel
>
;
using
ETCM
=
GetPropType
<
TypeTag
,
Properties
::
ThermalConductivityModel
>
;
using
Traits
=
TwoPNCNIVolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
,
EDM
,
ETCM
>
;
using
NonMinVolVars
=
TwoPNCVolumeVariables
<
Traits
>
;
public:
using
type
=
MineralizationVolumeVariables
<
Traits
,
NonMinVolVars
>
;
};
//! Non-isothermal vtkoutput
template
<
class
TypeTag
>
struct
IOFields
<
TypeTag
,
TTag
::
TwoPNCMinNI
>
...
...
dumux/porousmediumflow/co2/model.hh
View file @
6d606fbc
...
...
@@ -59,8 +59,9 @@ namespace Dumux {
* \tparam FST The fluid state type
* \tparam PT The type used for permeabilities
* \tparam MT The model traits
* \tparam EDM The effective diffusivity model
*/
template
<
class
PV
,
class
FSY
,
class
FST
,
class
SSY
,
class
SST
,
class
PT
,
class
MT
>
template
<
class
PV
,
class
FSY
,
class
FST
,
class
SSY
,
class
SST
,
class
PT
,
class
MT
,
class
EDM
>
struct
TwoPTwoCCO2VolumeVariablesTraits
{
using
PrimaryVariables
=
PV
;
...
...
@@ -70,6 +71,33 @@ struct TwoPTwoCCO2VolumeVariablesTraits
using
SolidState
=
SST
;
using
PermeabilityType
=
PT
;
using
ModelTraits
=
MT
;
using
EffectiveDiffusivityModel
=
EDM
;
};
/*!
* \ingroup CO2Model
* \brief Traits class for the two-phase two-component CO2 model.
*
* \tparam PV The type used for primary variables
* \tparam FSY The fluid system type
* \tparam FST The fluid state type
* \tparam PT The type used for permeabilities
* \tparam MT The model traits
* \tparam EDM The effective diffusivity model
* \tparam ETCM The effective thermal conductivity model
*/
template
<
class
PV
,
class
FSY
,
class
FST
,
class
SSY
,
class
SST
,
class
PT
,
class
MT
,
class
EDM
,
class
ETCM
>
struct
TwoPTwoCCO2NIVolumeVariablesTraits
{
using
PrimaryVariables
=
PV
;
using
FluidSystem
=
FSY
;
using
FluidState
=
FST
;
using
SolidSystem
=
SSY
;
using
SolidState
=
SST
;
using
PermeabilityType
=
PT
;
using
ModelTraits
=
MT
;
using
EffectiveDiffusivityModel
=
EDM
;
using
EffectiveThermalConductivityModel
=
ETCM
;
};
namespace
Properties
{
...
...
@@ -92,8 +120,9 @@ private:
using
SST
=
GetPropType
<
TypeTag
,
Properties
::
SolidState
>
;
using
MT
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
using
PT
=
typename
GetPropType
<
TypeTag
,
Properties
::
SpatialParams
>::
PermeabilityType
;
using
EDM
=
GetPropType
<
TypeTag
,
Properties
::
EffectiveDiffusivityModel
>
;
using
Traits
=
TwoPTwoCCO2VolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
>
;
using
Traits
=
TwoPTwoCCO2VolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
,
EDM
>
;
public:
using
type
=
TwoPTwoCCO2VolumeVariables
<
Traits
>
;
};
...
...
@@ -109,8 +138,10 @@ private:
using
SST
=
GetPropType
<
TypeTag
,
Properties
::
SolidState
>
;
using
MT
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
using
PT
=
typename
GetPropType
<
TypeTag
,
Properties
::
SpatialParams
>::
PermeabilityType
;
using
EDM
=
GetPropType
<
TypeTag
,
Properties
::
EffectiveDiffusivityModel
>
;
using
ETCM
=
GetPropType
<
TypeTag
,
Properties
::
ThermalConductivityModel
>
;
using
Traits
=
TwoPTwoCCO2VolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
>
;
using
Traits
=
TwoPTwoCCO2
NI
VolumeVariablesTraits
<
PV
,
FSY
,
FST
,
SSY
,
SST
,
PT
,
MT
,
EDM
,
ETCM
>
;
public:
using
type
=
TwoPTwoCCO2VolumeVariables
<
Traits
>
;
};
...
...
dumux/porousmediumflow/co2/volumevariables.hh
View file @
6d606fbc
...
...
@@ -54,6 +54,7 @@ class TwoPTwoCCO2VolumeVariables
using
Scalar
=
typename
Traits
::
PrimaryVariables
::
value_type
;
using
ModelTraits
=
typename
Traits
::
ModelTraits
;
using
EffDiffModel
=
typename
Traits
::
EffectiveDiffusivityModel
;
static
constexpr
int
numFluidComps
=
ParentType
::
numFluidComponents
();
// component indices
...
...
@@ -131,21 +132,24 @@ public:
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
const
auto
&
matParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
int
wPhaseIdx
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
const
int
nPhaseIdx
=
1
-
wPhaseIdx
;
const
int
nPhaseIdx
=
1
-
wPhaseIdx_
;
// relative permeabilities -> require wetting phase saturation as parameter!
relativePermeability_
[
wPhaseIdx
]
=
MaterialLaw
::
krw
(
matParams
,
saturation
(
wPhaseIdx
));
relativePermeability_
[
nPhaseIdx
]
=
MaterialLaw
::
krn
(
matParams
,
saturation
(
wPhaseIdx
));
// binary diffusion coefficients
diffCoeff_
[
phase0Idx
]
=
FluidSystem
::
binaryDiffusionCoefficient
(
fluidState_
,
paramCache
,
phase0Idx
,
comp0Idx
,
comp1Idx
);
diffCoeff_
[
phase1Idx
]
=
FluidSystem
::
binaryDiffusionCoefficient
(
fluidState_
,
paramCache
,
phase1Idx
,
comp0Idx
,
comp1Idx
);
relativePermeability_
[
wPhaseIdx_
]
=
MaterialLaw
::
krw
(
matParams
,
saturation
(
wPhaseIdx_
));
relativePermeability_
[
nPhaseIdx
]
=
MaterialLaw
::
krn
(
matParams
,
saturation
(
wPhaseIdx_
));
// porosity & permeabilty
updateSolidVolumeFractions
(
elemSol
,
problem
,
element
,
scv
,
solidState_
,
numFluidComps
);
EnergyVolVars
::
updateSolidEnergyParams
(
elemSol
,
problem
,
element
,
scv
,
solidState_
);
permeability_
=
problem
.
spatialParams
().
permeability
(
element
,
scv
,
elemSol
);
EnergyVolVars
::
updateEffectiveThermalConductivity
();
// binary diffusion coefficients and effective coefficients
diffCoeff_
[
phase0Idx
]
=
FluidSystem
::
binaryDiffusionCoefficient
(
fluidState_
,
paramCache
,
phase0Idx
,
comp0Idx
,
comp1Idx
);
diffCoeff_
[
phase1Idx
]
=
FluidSystem
::
binaryDiffusionCoefficient
(
fluidState_
,
paramCache
,
phase1Idx
,
comp0Idx
,
comp1Idx
);
effectiveDiffCoeff_
[
phase0Idx
]
=
EffDiffModel
::
effectiveDiffusivity
(
*
this
,
diffCoeff_
[
phase0Idx
],
phase0Idx
);
effectiveDiffCoeff_
[
phase1Idx
]
=
EffDiffModel
::
effectiveDiffusivity
(
*
this
,
diffCoeff_
[
phase1Idx
],
phase1Idx
);
}
/*!
...
...
@@ -177,8 +181,8 @@ public:
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
int
wPhaseIdx
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
fluidState
.
setWettingPhase
(
wPhaseIdx
);
wPhaseIdx
_
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
fluidState
.
setWettingPhase
(
wPhaseIdx
_
);
// set the saturations
if
(
phasePresence
==
secondPhaseOnly
)
...
...
@@ -208,17 +212,17 @@ public:
DUNE_THROW
(
Dune
::
InvalidStateException
,
"Invalid phase presence."
);
// set pressures of the fluid phases
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
));
pc_
=
MaterialLaw
::
pc
(
materialParams
,
fluidState
.
saturation
(
wPhaseIdx
_
));
if
(
formulation
==
TwoPFormulation
::
p0s1
)
{
fluidState
.
setPressure
(
phase0Idx
,
priVars
[
pressureIdx
]);
fluidState
.
setPressure
(
phase1Idx
,
(
wPhaseIdx
==
phase0Idx
)
?
priVars
[
pressureIdx
]
+
pc_
fluidState
.
setPressure
(
phase1Idx
,
(
wPhaseIdx
_
==
phase0Idx
)
?
priVars
[
pressureIdx
]
+
pc_
:
priVars
[
pressureIdx
]
-
pc_
);
}
else
{
fluidState
.
setPressure
(
phase1Idx
,
priVars
[
pressureIdx
]);
fluidState
.
setPressure
(
phase0Idx
,
(
wPhaseIdx
==
phase0Idx
)
?
priVars
[
pressureIdx
]
-
pc_
fluidState
.
setPressure
(
phase0Idx
,
(
wPhaseIdx
_
==
phase0Idx
)
?
priVars
[
pressureIdx
]
-
pc_
:
priVars
[
pressureIdx
]
+
pc_
);
}
...
...
@@ -454,7 +458,26 @@ public:
return
diffCoeff_
[
phaseIdx
];
}
/*!
* \brief Returns the effective diffusion coefficients for a phase in \f$[m^2/s]\f$.
*/
Scalar
effectiveDiffusivity
(
int
phaseIdx
,
int
compIdx
)
const
{
if
(
phaseIdx
==
compIdx
)
DUNE_THROW
(
Dune
::
InvalidStateException
,
"Diffusion coefficient called for phaseIdx = compIdx"
);
else
return
effectiveDiffCoeff_
[
phaseIdx
];
}
/*!
* \brief Returns the wetting phase index
*/
const
int
wettingPhaseIdx
()
const
{
return
wPhaseIdx_
;
}
private:
int
wPhaseIdx_
;
FluidState
fluidState_
;
SolidState
solidState_
;
Scalar
pc_
;
// The capillary pressure
...
...
@@ -465,6 +488,8 @@ private:
// Binary diffusion coefficients for the phases
std
::
array
<
Scalar
,
ModelTraits
::
numFluidPhases
()
>
diffCoeff_
;
// Effective diffusion coefficients for the phases
std
::
array
<
Scalar
,
ModelTraits
::
numFluidPhases
()
>
effectiveDiffCoeff_
;
};
}
// end namespace Dumux
...
...
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