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
511afdbf
Commit
511afdbf
authored
Jul 18, 2018
by
Kilian Weishaupt
Browse files
[freeflow] Remove phaseIdx by using 1pAdapter
* get rid of fluidSystemPhaseIdx
parent
c146e785
Changes
14
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/staggered/freeflow/fickslaw.hh
View file @
511afdbf
...
...
@@ -70,8 +70,7 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::staggered >
static_assert
(
ModelTraits
::
numPhases
()
==
1
,
"Only one phase allowed supported!"
);
enum
{
conti0EqIdx
=
Indices
::
conti0EqIdx
,
mainCompIdx
=
Indices
::
mainCompIdx
,
conti0EqIdx
=
Indices
::
conti0EqIdx
};
public:
...
...
@@ -97,7 +96,7 @@ public:
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
++
compIdx
)
{
if
(
compIdx
==
mainCompIdx
)
if
(
compIdx
==
FluidSystem
::
getMainComponent
(
0
)
)
continue
;
// get equation index
...
...
@@ -120,7 +119,7 @@ public:
}
const
Scalar
cumulativeFlux
=
std
::
accumulate
(
flux
.
begin
(),
flux
.
end
(),
0.0
);
flux
[
mainCompIdx
]
=
-
cumulativeFlux
;
flux
[
FluidSystem
::
getMainComponent
(
0
)
]
=
-
cumulativeFlux
;
// Fick's law (for binary systems) states that the net flux of moles within the bulk phase has to be zero:
// If a given amount of molecules A travel into one direction, the same amount of molecules B have to
...
...
@@ -146,7 +145,7 @@ public:
const
auto
&
insideVolVars
=
elemVolVars
[
scvf
.
insideScvIdx
()];
const
Scalar
insideDistance
=
(
insideScv
.
dofPosition
()
-
scvf
.
ipGlobal
()).
two_norm
();
const
Scalar
insideD
=
insideVolVars
.
effectiveDiffusivity
(
compIdx
);
const
Scalar
insideD
=
insideVolVars
.
effectiveDiffusivity
(
0
,
compIdx
);
const
Scalar
ti
=
calculateOmega_
(
insideDistance
,
insideD
,
insideVolVars
.
extrusionFactor
());
if
(
scvf
.
boundary
())
...
...
@@ -156,7 +155,7 @@ public:
const
auto
&
outsideScv
=
fvGeometry
.
scv
(
scvf
.
outsideScvIdx
());
const
auto
&
outsideVolVars
=
elemVolVars
[
scvf
.
outsideScvIdx
()];
const
Scalar
outsideDistance
=
(
outsideScv
.
dofPosition
()
-
scvf
.
ipGlobal
()).
two_norm
();
const
Scalar
outsideD
=
outsideVolVars
.
effectiveDiffusivity
(
compIdx
);
const
Scalar
outsideD
=
outsideVolVars
.
effectiveDiffusivity
(
0
,
compIdx
);
const
Scalar
tj
=
calculateOmega_
(
outsideDistance
,
outsideD
,
outsideVolVars
.
extrusionFactor
());
tij
=
scvf
.
area
()
*
(
ti
*
tj
)
/
(
ti
+
tj
);
...
...
dumux/freeflow/compositional/volumevariables.hh
View file @
511afdbf
...
...
@@ -43,7 +43,6 @@ class FreeflowNCVolumeVariables : public FreeFlowVolumeVariables< Traits, Freefl
using
Scalar
=
typename
Traits
::
PrimaryVariables
::
value_type
;
static
constexpr
int
fluidSystemPhaseIdx
=
Traits
::
ModelTraits
::
Indices
::
fluidSystemPhaseIdx
;
static
constexpr
int
numComponents
=
Traits
::
ModelTraits
::
numComponents
();
static
constexpr
bool
useMoles
=
Traits
::
ModelTraits
::
useMoles
();
...
...
@@ -77,6 +76,7 @@ public:
typename
FluidSystem
::
ParameterCache
paramCache
;
paramCache
.
updateAll
(
fluidState_
);
for
(
unsigned
int
compIIdx
=
0
;
compIIdx
<
numComponents
;
++
compIIdx
)
{
for
(
unsigned
int
compJIdx
=
0
;
compJIdx
<
numComponents
;
++
compJIdx
)
...
...
@@ -87,7 +87,7 @@ public:
diffCoefficient_
[
compIIdx
][
compJIdx
]
=
FluidSystem
::
binaryDiffusionCoefficient
(
fluidState_
,
paramCache
,
fluidSystemPhaseIdx
,
0
,
compIIdx
,
compJIdx
);
}
...
...
@@ -106,65 +106,62 @@ public:
FluidState
&
fluidState
)
{
fluidState
.
setTemperature
(
ParentType
::
temperature
(
elemSol
,
problem
,
element
,
scv
));
fluidState
.
setPressure
(
fluidSystemPhaseIdx
,
elemSol
[
0
][
Indices
::
pressureIdx
]);
fluidState
.
setPressure
(
0
,
elemSol
[
0
][
Indices
::
pressureIdx
]);
// saturation in a single phase is always 1 and thus redundant
// to set. But since we use the fluid state shared by the
// immiscible multi-phase models, so we have to set it here...
fluidState
.
setSaturation
(
fluidSystemPhaseIdx
,
1.0
);
fluidState
.
setSaturation
(
0
,
1.0
);
Scalar
sumFracMinorComp
=
0.0
;
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
++
compIdx
)
for
(
int
compIdx
=
1
;
compIdx
<
numComponents
;
++
compIdx
)
{
if
(
compIdx
==
Indices
::
mainCompIdx
)
continue
;
// temporary add 1.0 to remove spurious differences in mole fractions
// which are below the numerical accuracy
Scalar
moleOrMassFraction
=
elemSol
[
0
][
Indices
::
conti0EqIdx
+
compIdx
]
+
1.0
;
moleOrMassFraction
=
moleOrMassFraction
-
1.0
;
if
(
useMoles
)
fluidState
.
setMoleFraction
(
fluidSystemPhaseIdx
,
compIdx
,
moleOrMassFraction
);
fluidState
.
setMoleFraction
(
0
,
compIdx
,
moleOrMassFraction
);
else
fluidState
.
setMassFraction
(
fluidSystemPhaseIdx
,
compIdx
,
moleOrMassFraction
);
fluidState
.
setMassFraction
(
0
,
compIdx
,
moleOrMassFraction
);
sumFracMinorComp
+=
moleOrMassFraction
;
}
if
(
useMoles
)
fluidState
.
setMoleFraction
(
fluidSystemPhaseIdx
,
Indices
::
mainCompIdx
,
1.0
-
sumFracMinorComp
);
fluidState
.
setMoleFraction
(
0
,
0
,
1.0
-
sumFracMinorComp
);
else
fluidState
.
setMassFraction
(
fluidSystemPhaseIdx
,
Indices
::
mainCompIdx
,
1.0
-
sumFracMinorComp
);
fluidState
.
setMassFraction
(
0
,
0
,
1.0
-
sumFracMinorComp
);
typename
FluidSystem
::
ParameterCache
paramCache
;
paramCache
.
update
Phase
(
fluidState
,
fluidSystemPhaseIdx
);
paramCache
.
update
All
(
fluidState
);
Scalar
value
=
FluidSystem
::
density
(
fluidState
,
paramCache
,
fluidSystemPhaseIdx
);
fluidState
.
setDensity
(
fluidSystemPhaseIdx
,
value
);
Scalar
value
=
FluidSystem
::
density
(
fluidState
,
paramCache
,
0
);
fluidState
.
setDensity
(
0
,
value
);
value
=
FluidSystem
::
molarDensity
(
fluidState
,
paramCache
,
fluidSystemPhaseIdx
);
fluidState
.
setMolarDensity
(
fluidSystemPhaseIdx
,
value
);
value
=
FluidSystem
::
molarDensity
(
fluidState
,
paramCache
,
0
);
fluidState
.
setMolarDensity
(
0
,
value
);
value
=
FluidSystem
::
viscosity
(
fluidState
,
paramCache
,
fluidSystemPhaseIdx
);
fluidState
.
setViscosity
(
fluidSystemPhaseIdx
,
value
);
value
=
FluidSystem
::
viscosity
(
fluidState
,
paramCache
,
0
);
fluidState
.
setViscosity
(
0
,
value
);
// compute and set the enthalpy
const
Scalar
h
=
ParentType
::
enthalpy
(
fluidState
,
paramCache
);
fluidState
.
setEnthalpy
(
fluidSystemPhaseIdx
,
h
);
fluidState
.
setEnthalpy
(
0
,
h
);
}
/*!
* \brief Return the effective pressure \f$\mathrm{[Pa]}\f$ of a given phase within
* the control volume.
*/
Scalar
pressure
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
{
return
fluidState_
.
pressure
(
fluidSystemPhaseIdx
);
}
Scalar
pressure
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
pressure
(
0
);
}
/*!
* \brief Return the mass density \f$\mathrm{[kg/m^3]}\f$ of a given phase within the
* control volume.
*/
Scalar
density
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
{
return
fluidState_
.
density
(
fluidSystemPhaseIdx
);
}
Scalar
density
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
density
(
0
);
}
/*!
* \brief Return temperature \f$\mathrm{[K]}\f$ inside the sub-control volume.
...
...
@@ -187,8 +184,8 @@ public:
* \brief Return the dynamic viscosity \f$\mathrm{[Pa s]}\f$ of the fluid within the
* control volume.
*/
Scalar
viscosity
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
{
return
fluidState_
.
viscosity
(
fluidSystemPhaseIdx
);
}
Scalar
viscosity
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
viscosity
(
0
);
}
/*!
* \brief Returns the mass fraction of a component in the phase \f$\mathrm{[-]}\f$
...
...
@@ -198,7 +195,7 @@ public:
*/
Scalar
massFraction
(
int
phaseIdx
,
int
compIdx
)
const
{
return
fluidState_
.
massFraction
(
fluidSystemPhaseIdx
,
compIdx
);
return
fluidState_
.
massFraction
(
0
,
compIdx
);
}
/*!
...
...
@@ -208,7 +205,7 @@ public:
*/
Scalar
massFraction
(
int
compIdx
)
const
{
return
fluidState_
.
massFraction
(
fluidSystemPhaseIdx
,
compIdx
);
return
fluidState_
.
massFraction
(
0
,
compIdx
);
}
/*!
...
...
@@ -219,7 +216,7 @@ public:
*/
Scalar
moleFraction
(
int
phaseIdx
,
int
compIdx
)
const
{
return
fluidState_
.
moleFraction
(
fluidSystemPhaseIdx
,
compIdx
);
return
fluidState_
.
moleFraction
(
0
,
compIdx
);
}
/*!
...
...
@@ -229,15 +226,15 @@ public:
*/
Scalar
moleFraction
(
int
compIdx
)
const
{
return
fluidState_
.
moleFraction
(
fluidSystemPhaseIdx
,
compIdx
);
return
fluidState_
.
moleFraction
(
0
,
compIdx
);
}
/*!
* \brief Returns the mass density of a given phase \f$\mathrm{[kg/m^3]}\f$
*/
Scalar
molarDensity
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
Scalar
molarDensity
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
molarDensity
(
fluidSystemPhaseIdx
);
return
fluidState_
.
molarDensity
(
0
);
}
/*!
...
...
@@ -250,29 +247,30 @@ public:
return
FluidSystem
::
molarMass
(
compIdx
);
}
/*!
* \brief Returns the diffusion coefficient \f$\mathrm{[m^2/s]}\f$
*
* \param compIIdx the index of the component which diffusive
* \param compJIdx the index of the component with respect to which compIIdx diffuses
*/
Scalar
diffusionCoefficient
(
int
compIIdx
,
int
compJIdx
=
fluidSystemPhaseIdx
)
const
{
if
(
compIIdx
==
compJIdx
)
DUNE_THROW
(
Dune
::
InvalidStateException
,
"Diffusion coefficient called for fluidSystemPhaseIdx = compIdx"
);
return
diffCoefficient_
[
compIIdx
][
compJIdx
];
}
/*!
* \brief Returns the diffusion coefficient \f$\mathrm{[m^2/s]}\f$
*
* \param compIIdx the index of the component which diffusive
* \param compJIdx the index of the component with respect to which compIIdx diffuses
*/
Scalar
diffusionCoefficient
(
int
compIIdx
,
int
compJIdx
=
0
)
const
{
if
(
compIIdx
==
compJIdx
)
DUNE_THROW
(
Dune
::
InvalidStateException
,
"Diffusion coefficient called for compIIdx = compJIdx"
);
return
diffCoefficient_
[
compIIdx
][
compJIdx
];
}
/*!
* \brief Returns the effective diffusion coefficient \f$\mathrm{[m^2/s]}\f$
*
* \param compIIdx the index of the component which diffusive
* \param compJIdx the index of the component with respect to which compIIdx diffuses
*/
Scalar
effectiveDiffusivity
(
int
compIIdx
,
int
compJIdx
=
0
)
const
{
return
diffusionCoefficient
(
compIIdx
,
compJIdx
);
}
/*!
* \brief Returns the effective diffusion coefficient \f$\mathrm{[m^2/s]}\f$
*
* \param compIIdx the index of the component which diffusive
* \param compJIdx the index of the component with respect to which compIIdx diffuses
*/
Scalar
effectiveDiffusivity
(
int
compIIdx
,
int
compJIdx
=
fluidSystemPhaseIdx
)
const
{
return
diffusionCoefficient
(
compIIdx
,
compJIdx
);
}
/*!
* \brief Return the fluid state of the control volume.
...
...
@@ -282,7 +280,7 @@ public:
protected:
FluidState
fluidState_
;
std
::
array
<
std
::
array
<
Scalar
,
numComponents
>
,
numComponents
>
diffCoefficient_
;
std
::
array
<
std
::
array
<
Scalar
,
numComponents
>
,
numComponents
>
diffCoefficient_
=
{}
;
};
}
// end namespace Dumux
...
...
dumux/freeflow/compositional/vtkoutputfields.hh
View file @
511afdbf
...
...
@@ -56,12 +56,13 @@ public:
vtk
.
addVolumeVariable
([
j
](
const
auto
&
v
){
return
v
.
moleFraction
(
j
);
},
"x^"
+
FluidSystem
::
componentName
(
j
)
+
"_"
+
FluidSystem
::
phaseName
(
phaseIdx
));
if
(
j
!=
phaseIdx
)
{
vtk
.
addVolumeVariable
([
j
](
const
auto
&
v
){
return
v
.
diffusionCoefficient
(
j
);
},
"D^"
+
FluidSystem
::
componentName
(
j
)
+
"_"
+
FluidSystem
::
phaseName
(
phaseIdx
));
vtk
.
addVolumeVariable
([
j
](
const
auto
&
v
){
return
v
.
diffusionCoefficient
(
0
,
j
);
},
"D^"
+
FluidSystem
::
componentName
(
j
)
+
"_"
+
FluidSystem
::
phaseName
(
phaseIdx
));
if
(
ModelTraits
::
usesTurbulenceModel
())
// the eddy diffusivity is recalculated for an arbitrary component which is not the phase component
vtk
.
addVolumeVariable
([
j
](
const
auto
&
v
){
return
v
.
effectiveDiffusivity
(
0
,
j
)
-
v
.
diffusionCoefficient
(
0
,
j
);
},
"D_t"
);
}
}
if
(
ModelTraits
::
usesTurbulenceModel
())
// the eddy diffusivity is recalculated for an arbitrary component which is not the phase component
vtk
.
addVolumeVariable
([](
const
auto
&
v
){
return
v
.
effectiveDiffusivity
(
1
-
phaseIdx
)
-
v
.
diffusionCoefficient
(
1
-
phaseIdx
);
},
"D_t"
);
}
};
...
...
dumux/freeflow/navierstokes/volumevariables.hh
View file @
511afdbf
...
...
@@ -41,8 +41,6 @@ class NavierStokesVolumeVariables : public FreeFlowVolumeVariables< Traits, Navi
using
Scalar
=
typename
Traits
::
PrimaryVariables
::
value_type
;
static
constexpr
int
fluidSystemPhaseIdx
=
Traits
::
ModelTraits
::
Indices
::
fluidSystemPhaseIdx
;
public:
//! export the underlying fluid system
using
FluidSystem
=
typename
Traits
::
FluidSystem
;
...
...
@@ -83,43 +81,43 @@ public:
const
Scalar
t
=
ParentType
::
temperature
(
elemSol
,
problem
,
element
,
scv
);
fluidState
.
setTemperature
(
t
);
fluidState
.
setPressure
(
fluidSystemPhaseIdx
,
elemSol
[
0
][
Indices
::
pressureIdx
]);
fluidState
.
setPressure
(
0
,
elemSol
[
0
][
Indices
::
pressureIdx
]);
// saturation in a single phase is always 1 and thus redundant
// to set. But since we use the fluid state shared by the
// immiscible multi-phase models, so we have to set it here...
fluidState
.
setSaturation
(
fluidSystemPhaseIdx
,
1.0
);
fluidState
.
setSaturation
(
0
,
1.0
);
typename
FluidSystem
::
ParameterCache
paramCache
;
paramCache
.
update
Phase
(
fluidState
,
fluidSystemPhaseIdx
);
paramCache
.
update
All
(
fluidState
);
Scalar
value
=
FluidSystem
::
density
(
fluidState
,
paramCache
,
fluidSystemPhaseIdx
);
fluidState
.
setDensity
(
fluidSystemPhaseIdx
,
value
);
Scalar
value
=
FluidSystem
::
density
(
fluidState
,
paramCache
,
0
);
fluidState
.
setDensity
(
0
,
value
);
value
=
FluidSystem
::
molarDensity
(
fluidState
,
paramCache
,
fluidSystemPhaseIdx
);
fluidState
.
setMolarDensity
(
fluidSystemPhaseIdx
,
value
);
value
=
FluidSystem
::
molarDensity
(
fluidState
,
paramCache
,
0
);
fluidState
.
setMolarDensity
(
0
,
value
);
value
=
FluidSystem
::
viscosity
(
fluidState
,
paramCache
,
fluidSystemPhaseIdx
);
fluidState
.
setViscosity
(
fluidSystemPhaseIdx
,
value
);
value
=
FluidSystem
::
viscosity
(
fluidState
,
paramCache
,
0
);
fluidState
.
setViscosity
(
0
,
value
);
// compute and set the enthalpy
value
=
ParentType
::
enthalpy
(
fluidState
,
paramCache
);
fluidState
.
setEnthalpy
(
fluidSystemPhaseIdx
,
value
);
fluidState
.
setEnthalpy
(
0
,
value
);
}
/*!
* \brief Return the effective pressure \f$\mathrm{[Pa]}\f$ of a given phase within
* the control volume.
*/
Scalar
pressure
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
{
return
fluidState_
.
pressure
(
fluidSystemPhaseIdx
);
}
Scalar
pressure
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
pressure
(
0
);
}
/*!
* \brief Return the mass density \f$\mathrm{[kg/m^3]}\f$ of a given phase within the
* control volume.
*/
Scalar
density
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
{
return
fluidState_
.
density
(
fluidSystemPhaseIdx
);
}
Scalar
density
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
density
(
0
);
}
/*!
* \brief Return temperature \f$\mathrm{[K]}\f$ inside the sub-control volume.
...
...
@@ -135,26 +133,26 @@ public:
* \brief Returns the mass density of a given phase within the
* control volume.
*/
Scalar
molarDensity
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
Scalar
molarDensity
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
molarDensity
(
fluidSystemPhaseIdx
);
return
fluidState_
.
molarDensity
(
0
);
}
/*!
* \brief Returns the molar mass of a given phase within the
* control volume.
*/
Scalar
molarMass
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
Scalar
molarMass
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
averageMolarMass
(
fluidSystemPhaseIdx
);
return
fluidState_
.
averageMolarMass
(
0
);
}
/*!
* \brief Return the dynamic viscosity \f$\mathrm{[Pa s]}\f$ of the fluid within the
* control volume.
*/
Scalar
viscosity
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
{
return
fluidState_
.
viscosity
(
fluidSystemPhaseIdx
);
}
Scalar
viscosity
(
int
phaseIdx
=
0
)
const
{
return
fluidState_
.
viscosity
(
0
);
}
/*!
* \brief Return the effective dynamic viscosity \f$\mathrm{[Pa s]}\f$ of the fluid within the
...
...
dumux/freeflow/rans/twoeq/kepsilon/problem.hh
View file @
511afdbf
...
...
@@ -391,7 +391,7 @@ public:
continue
;
Scalar
schmidtNumber
=
elemVolVars
[
scvf
.
insideScvIdx
()].
kinematicViscosity
()
/
elemVolVars
[
scvf
.
insideScvIdx
()].
diffusionCoefficient
(
compIdx
);
/
elemVolVars
[
scvf
.
insideScvIdx
()].
diffusionCoefficient
(
0
,
compIdx
);
Scalar
moleToMassConversionFactor
=
useMoles
?
1.0
:
FluidSystem
::
molarMass
(
compIdx
);
wallFunctionFlux
[
compIdx
]
+=
...
...
dumux/freeflow/rans/volumevariables.hh
View file @
511afdbf
...
...
@@ -49,7 +49,6 @@ class RANSVolumeVariables
using
DimMatrix
=
Dune
::
FieldMatrix
<
Scalar
,
dimWorld
,
dimWorld
>
;
static
constexpr
bool
enableEnergyBalance
=
Traits
::
ModelTraits
::
enableEnergyBalance
();
static
constexpr
int
fluidSystemPhaseIdx
=
Traits
::
ModelTraits
::
Indices
::
fluidSystemPhaseIdx
;
public:
...
...
@@ -232,13 +231,13 @@ public:
Scalar
eddyThermalConductivity
()
const
{
return
eddyThermalConductivity_
;
}
/*!
* \brief Returns the effective diffusion coefficient \f$\mathrm{[m^2/s]}\f$
*
* \param compIIdx the index of the component which diffusive
* \param compJIdx the index of the component with respect to which compIIdx diffuses
*/
Scalar
effectiveDiffusivity
(
int
compIIdx
,
int
compJIdx
=
fluidSystemPhaseIdx
)
const
/*!
* \brief Returns the effective diffusion coefficient \f$\mathrm{[m^2/s]}\f$
*
* \param compIIdx the index of the component which diffusive
* \param compJIdx the index of the component with respect to which compIIdx diffuses
*/
Scalar
effectiveDiffusivity
(
int
compIIdx
,
int
compJIdx
)
const
{
return
NavierStokesParentType
::
diffusionCoefficient
(
compIIdx
,
compJIdx
)
+
eddyDiffusivity
();
}
...
...
dumux/freeflow/volumevariables.hh
View file @
511afdbf
...
...
@@ -137,7 +137,6 @@ class FreeFlowVolumeVariablesImplementation<Traits, Impl, true>
{
using
ParentType
=
FreeFlowVolumeVariablesImplementation
<
Traits
,
Impl
,
false
>
;
using
Scalar
=
typename
Traits
::
PrimaryVariables
::
value_type
;
static
constexpr
int
fluidSystemPhaseIdx
=
Traits
::
ModelTraits
::
Indices
::
fluidSystemPhaseIdx
;
public:
//! export the type used for the primary variables
...
...
@@ -171,28 +170,28 @@ public:
* \brief Returns the total internal energy of a phase in the
* sub-control volume.
*/
Scalar
internalEnergy
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
{
return
ParentType
::
asImp_
().
fluidState
().
internalEnergy
(
fluidSystemPhaseIdx
);
}
Scalar
internalEnergy
(
int
phaseIdx
=
0
)
const
{
return
ParentType
::
asImp_
().
fluidState
().
internalEnergy
(
0
);
}
/*!
* \brief Returns the total enthalpy of a phase in the sub-control
* volume.
*/
Scalar
enthalpy
(
int
phaseIdx
=
fluidSystemPhaseIdx
)
const
{
return
ParentType
::
asImp_
().
fluidState
().
enthalpy
(
fluidSystemPhaseIdx
);
}
Scalar
enthalpy
(
int
phaseIdx
=
0
)
const
{
return
ParentType
::
asImp_
().
fluidState
().
enthalpy
(
0
);
}
/*!
* \brief Returns the component enthalpy \f$\mathrm{[J/(kg*K)]}\f$ in the sub-control volume.
*/
Scalar
componentEnthalpy
(
unsigned
int
compIdx
)
const
{
return
FluidSystem
::
componentEnthalpy
(
ParentType
::
asImp_
().
fluidState
(),
fluidSystemPhaseIdx
,
compIdx
);
}
{
return
FluidSystem
::
componentEnthalpy
(
ParentType
::
asImp_
().
fluidState
(),
0
,
compIdx
);
}
/*!
* \brief Returns the thermal conductivity \f$\mathrm{[W/(m*K)]}\f$
* of the fluid phase in the sub-control volume.
*/
Scalar
thermalConductivity
()
const
{
return
FluidSystem
::
thermalConductivity
(
ParentType
::
asImp_
().
fluidState
(),
fluidSystemPhaseIdx
);
}
{
return
FluidSystem
::
thermalConductivity
(
ParentType
::
asImp_
().
fluidState
(),
0
);
}
/*!
* \brief Returns the effective thermal conductivity \f$\mathrm{[W/(m*K)]}\f$
...
...
@@ -208,7 +207,7 @@ public:
* in the sub-control volume.
*/
Scalar
heatCapacity
()
const
{
return
FluidSystem
::
heatCapacity
(
ParentType
::
asImp_
().
fluidState
(),
fluidSystemPhaseIdx
);
}
{
return
FluidSystem
::
heatCapacity
(
ParentType
::
asImp_
().
fluidState
(),
0
);
}
//! The temperature is a primary variable for non-isothermal models
template
<
class
ElemSol
,
class
Problem
,
class
Element
,
class
Scv
>
...
...
@@ -226,7 +225,7 @@ public:
static
Scalar
enthalpy
(
const
FluidState
&
fluidState
,
const
ParameterCache
&
paramCache
)
{
return
FluidSystem
::
enthalpy
(
fluidState
,
paramCache
,
fluidSystemPhaseIdx
);
return
FluidSystem
::
enthalpy
(
fluidState
,
paramCache
,
0
);
}
};
}
...
...
test/freeflow/ransnc/flatplatetestproblem.hh
View file @
511afdbf
...
...
@@ -27,6 +27,7 @@
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/discretization/staggered/freeflow/properties.hh>
#include
<dumux/material/fluidsystems/1padapter.hh>
#include
<dumux/material/fluidsystems/h2oair.hh>
#include
<dumux/freeflow/turbulenceproperties.hh>
...
...
@@ -81,16 +82,16 @@ namespace Properties
#endif
#endif
NEW_PROP_TAG
(
FluidSystem
);
// Select the fluid system
SET_TYPE_PROP
(
FlatPlateNCTestTypeTag
,
FluidSystem
,
FluidSystems
::
H2OAir
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
>
);
SET_INT_PROP
(
FlatPlateNCTestTypeTag
,
PhaseIdx
,
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
::
gasPhaseIdx
);
// The fluid system
SET_PROP
(
FlatPlateNCTestTypeTag
,
FluidSystem
)
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
>
;
static
constexpr
auto
phaseIdx
=
H2OAir
::
gasPhaseIdx
;
// simulate the air phase
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
phaseIdx
>
;
};
SET_INT_PROP
(
FlatPlateNCTestTypeTag
,
ReplaceCompEqIdx
,
GET_PROP_VALUE
(
TypeTag
,
PhaseIdx
));
// replace the main component balance eq with a total balance eq
SET_INT_PROP
(
FlatPlateNCTestTypeTag
,
ReplaceCompEqIdx
,
0
);
// Set the grid type
SET_TYPE_PROP
(
FlatPlateNCTestTypeTag
,
Grid
,
...
...
@@ -158,9 +159,8 @@ class FlatPlateNCTestProblem : public ZeroEqProblem<TypeTag>
using
TimeLoopPtr
=
std
::
shared_ptr
<
CheckPointTimeLoop
<
Scalar
>>
;
static
constexpr
auto
dimWorld
=
GET_PROP_TYPE
(
TypeTag
,
GridView
)
::
dimensionworld
;
static
const
unsigned
int
phaseIdx
=
GET_PROP_VALUE
(
TypeTag
,
PhaseIdx
);
static
constexpr
auto
transportEqIdx
=
Indices
::
conti0EqIdx
;
static
constexpr
auto
transportCompIdx
=
Indices
::
conti0EqIdx
;
static
constexpr
auto
transportEqIdx
=
Indices
::
conti0EqIdx
+
1
;
static
constexpr
auto
transportCompIdx
=
Indices
::
conti0EqIdx
+
1
;
public:
FlatPlateNCTestProblem
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
...
...
@@ -171,6 +171,7 @@ public:
FluidSystem
::
init
();
Dumux
::
TurbulenceProperties
<
Scalar
,
dimWorld
,
true
>
turbulenceProperties
;
FluidState
fluidState
;
const
auto
phaseIdx
=
0
;
fluidState
.
setPressure
(
phaseIdx
,
1e5
);
fluidState
.
setTemperature
(
temperature
());
fluidState
.
setMassFraction
(
phaseIdx
,
phaseIdx
,
1.0
);
...
...
test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/darcyproblem.hh
View file @
511afdbf
...
...
@@ -33,6 +33,7 @@
#include
"./../1pspatialparams.hh"
#include
<dumux/material/fluidsystems/1padapter.hh>
#include
<dumux/material/fluidsystems/h2oair.hh>
#include
<dumux/material/fluidmatrixinteractions/diffusivityconstanttortuosity.hh>
...
...
@@ -49,10 +50,12 @@ NEW_TYPE_TAG(DarcyOnePTwoCTypeTag, INHERITS_FROM(CCTpfaModel, OnePNC));
SET_TYPE_PROP
(
DarcyOnePTwoCTypeTag
,
Problem
,
Dumux
::
DarcySubProblem
<
TypeTag
>
);
// The fluid system
SET_TYPE_PROP
(
DarcyOnePTwoCTypeTag
,
FluidSystem
,
FluidSystems
::
H2OAir
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
>
);
// Use water as phase
SET_INT_PROP
(
DarcyOnePTwoCTypeTag
,
PhaseIdx
,
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
)
::
liquidPhaseIdx
);
SET_PROP
(
DarcyOnePTwoCTypeTag
,
FluidSystem
)
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
>
;
static
constexpr
auto
phaseIdx
=
H2OAir
::
liquidPhaseIdx
;
// simulate the water phase
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
phaseIdx
>
;
};
// Use moles
SET_BOOL_PROP
(
DarcyOnePTwoCTypeTag
,
UseMoles
,
true
);
...
...
test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/stokesproblem.hh
View file @
511afdbf
...
...
@@ -26,6 +26,7 @@
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/material/fluidsystems/1padapter.hh>
#include
<dumux/material/fluidsystems/h2oair.hh>
#include
<dumux/freeflow/navierstokes/problem.hh>
...
...
@@ -41,8 +42,13 @@ namespace Properties
{
NEW_TYPE_TAG
(
StokesOnePTwoCTypeTag
,
INHERITS_FROM
(
StaggeredFreeFlowModel
,
NavierStokesNC
));
// Set the fluid system
SET_TYPE_PROP
(
StokesOnePTwoCTypeTag
,
FluidSystem
,
FluidSystems
::
H2OAir
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
>
);
// The fluid system
SET_PROP
(
StokesOnePTwoCTypeTag
,
FluidSystem
)
{
using
H2OAir
=
FluidSystems
::
H2OAir
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
>
;
static
constexpr
auto
phaseIdx
=
H2OAir
::
liquidPhaseIdx
;
// simulate the water phase
using
type
=
FluidSystems
::
OnePAdapter
<
H2OAir
,
phaseIdx
>
;
};
// Set the grid type
SET_TYPE_PROP
(
StokesOnePTwoCTypeTag
,
Grid
,
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
),
2
>
>
);