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
b7a5f1d8
Commit
b7a5f1d8
authored
Jul 27, 2018
by
Bernd Flemisch
Committed by
Timo Koch
Aug 10, 2018
Browse files
[io][vtk] add primaryVariableName functions to almost all models
Missing: elastic, mpnc, nonequilibrium, mineralization.
parent
fa05944b
Changes
23
Hide whitespace changes
Inline
Side-by-side
dumux/freeflow/compositional/kepsilonncmodel.hh
View file @
b7a5f1d8
...
...
@@ -69,6 +69,19 @@ struct KEpsilonNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, useMo
//! the indices
using
Indices
=
KEpsilonIndices
<
dimension
,
nComp
>
;
//! return the names of the primary variables in cells
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
,
int
state
=
0
)
{
using
ParentType
=
NavierStokesNCModelTraits
<
dimension
,
nComp
,
useMoles
,
replaceCompEqIdx
>
;
if
(
pvIdx
<
nComp
)
return
ParentType
::
template
primaryVariableNameCell
<
FluidSystem
>(
pvIdx
,
state
);
else
if
(
pvIdx
==
nComp
)
return
"k"
;
else
return
"epsilon"
;
}
};
//!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model
...
...
dumux/freeflow/compositional/komegancmodel.hh
View file @
b7a5f1d8
...
...
@@ -74,6 +74,19 @@ struct KOmegaNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, useMole
//! the indices
using
Indices
=
KOmegaIndices
<
dimension
,
nComp
>
;
//! return the names of the primary variables in cells
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
,
int
state
=
0
)
{
using
ParentType
=
NavierStokesNCModelTraits
<
dimension
,
nComp
,
useMoles
,
replaceCompEqIdx
>
;
if
(
pvIdx
<
nComp
)
return
ParentType
::
template
primaryVariableNameCell
<
FluidSystem
>(
pvIdx
,
state
);
else
if
(
pvIdx
==
nComp
)
return
"k"
;
else
return
"omega"
;
}
};
//!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model
...
...
dumux/freeflow/compositional/lowrekepsilonncmodel.hh
View file @
b7a5f1d8
...
...
@@ -74,6 +74,19 @@ struct LowReKEpsilonNCModelTraits : NavierStokesNCModelTraits<dimension, nComp,
//! the indices
using
Indices
=
LowReKEpsilonIndices
<
dimension
,
nComp
>
;
//! return the names of the primary variables in cells
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
,
int
state
=
0
)
{
using
ParentType
=
NavierStokesNCModelTraits
<
dimension
,
nComp
,
useMoles
,
replaceCompEqIdx
>
;
if
(
pvIdx
<
nComp
)
return
ParentType
::
template
primaryVariableNameCell
<
FluidSystem
>(
pvIdx
,
state
);
else
if
(
pvIdx
==
nComp
)
return
"k"
;
else
return
"epsilon"
;
}
};
//!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model
...
...
dumux/freeflow/compositional/navierstokesncmodel.hh
View file @
b7a5f1d8
...
...
@@ -102,6 +102,18 @@ struct NavierStokesNCModelTraits : NavierStokesModelTraits<dimension>
//! the indices
using
Indices
=
NavierStokesIndices
<
dimension
>
;
//! return the names of the primary variables in cells
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
=
0
,
int
state
=
0
)
{
const
std
::
string
xString
=
useMoles
()
?
"x"
:
"X"
;
if
(
pvIdx
==
0
)
return
NavierStokesModelTraits
<
dimension
>::
primaryVariableNameCell
(
pvIdx
,
state
);
else
return
xString
+
"^"
+
FluidSystem
::
componentName
(
pvIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
0
);
}
};
///////////////////////////////////////////////////////////////////////////
...
...
dumux/freeflow/compositional/oneeqncmodel.hh
View file @
b7a5f1d8
...
...
@@ -74,6 +74,17 @@ struct OneEqNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, useMoles
//! the indices
using
Indices
=
OneEqIndices
<
dimension
,
nComp
>
;
//! return the names of the primary variables in cells
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
,
int
state
=
0
)
{
using
ParentType
=
NavierStokesNCModelTraits
<
dimension
,
nComp
,
useMoles
,
replaceCompEqIdx
>
;
if
(
pvIdx
<
nComp
)
return
ParentType
::
template
primaryVariableNameCell
<
FluidSystem
>(
pvIdx
,
state
);
else
return
"nu_tilde"
;
}
};
//!< states some specifics of the isothermal multi-component one-equation model
...
...
dumux/freeflow/nonisothermal/model.hh
View file @
b7a5f1d8
...
...
@@ -62,6 +62,23 @@ struct FreeflowNIModelTraits : public IsothermalTraits
static
constexpr
bool
enableEnergyBalance
()
{
return
true
;
}
//! the indices
using
Indices
=
FreeflowNonIsothermalIndices
<
typename
IsothermalTraits
::
Indices
,
numEq
()
>
;
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
=
0
)
{
if
(
pvIdx
<
numEq
()
-
1
)
return
IsothermalTraits
::
primaryVariableName
(
pvIdx
,
state
);
else
return
"T"
;
}
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
=
0
)
{
if
(
pvIdx
<
numEq
()
-
1
)
return
IsothermalTraits
::
template
primaryVariableName
<
FluidSystem
>(
pvIdx
,
state
);
else
return
"T"
;
}
};
}
// end namespace Dumux
...
...
dumux/freeflow/rans/oneeq/model.hh
View file @
b7a5f1d8
...
...
@@ -104,7 +104,7 @@ struct OneEqModelTraits : RANSModelTraits<dimension>
static
constexpr
int
dim
()
{
return
dimension
;
}
//! There are as many momentum balance equations as dimensions,
//! one mass balance equation and
two
turbulent transport equation
s
//! one mass balance equation and
one
turbulent transport equation
static
constexpr
int
numEq
()
{
return
dim
()
+
1
+
1
;
}
//! The number of components
...
...
@@ -112,6 +112,16 @@ struct OneEqModelTraits : RANSModelTraits<dimension>
//! the indices
using
Indices
=
OneEqIndices
<
dim
(),
numComponents
()
>
;
//! return the names of the primary variables in cells
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
,
int
state
=
0
)
{
using
ParentType
=
RANSModelTraits
<
dimension
>
;
if
(
pvIdx
==
0
)
return
ParentType
::
primaryVariableNameCell
(
pvIdx
,
state
);
else
return
"nu_tilde"
;
}
};
///////////////////////////////////////////////////////////////////////////
...
...
dumux/freeflow/rans/twoeq/kepsilon/model.hh
View file @
b7a5f1d8
...
...
@@ -99,6 +99,20 @@ struct KEpsilonModelTraits : RANSModelTraits<dimension>
//! the indices
using
Indices
=
KEpsilonIndices
<
dim
(),
numComponents
()
>
;
//! return the names of the primary variables in cells
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
,
int
state
=
0
)
{
using
ParentType
=
RANSModelTraits
<
dimension
>
;
switch
(
pvIdx
)
{
case
0
:
return
ParentType
::
primaryVariableNameCell
(
pvIdx
,
state
);
case
1
:
return
"k"
;
default:
return
"epsilon"
;
}
}
};
///////////////////////////////////////////////////////////////////////////
...
...
dumux/freeflow/rans/twoeq/komega/model.hh
View file @
b7a5f1d8
...
...
@@ -106,6 +106,20 @@ struct KOmegaModelTraits : RANSModelTraits<dimension>
//! The indices
using
Indices
=
KOmegaIndices
<
dim
(),
numComponents
()
>
;
//! return the names of the primary variables in cells
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
,
int
state
=
0
)
{
using
ParentType
=
RANSModelTraits
<
dimension
>
;
switch
(
pvIdx
)
{
case
0
:
return
ParentType
::
primaryVariableNameCell
(
pvIdx
,
state
);
case
1
:
return
"k"
;
default:
return
"omega"
;
}
}
};
///////////////////////////////////////////////////////////////////////////
...
...
dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh
View file @
b7a5f1d8
...
...
@@ -115,6 +115,20 @@ struct LowReKEpsilonModelTraits : RANSModelTraits<dimension>
//! the indices
using
Indices
=
LowReKEpsilonIndices
<
dim
(),
numComponents
()
>
;
//! return the names of the primary variables in cells
static
std
::
string
primaryVariableNameCell
(
int
pvIdx
,
int
state
=
0
)
{
using
ParentType
=
RANSModelTraits
<
dimension
>
;
switch
(
pvIdx
)
{
case
0
:
return
ParentType
::
primaryVariableNameCell
(
pvIdx
,
state
);
case
1
:
return
"k"
;
default:
return
"epsilon"
;
}
}
};
///////////////////////////////////////////////////////////////////////////
...
...
dumux/porousmediumflow/1p/model.hh
View file @
b7a5f1d8
...
...
@@ -77,7 +77,7 @@ struct OnePModelTraits
static
std
::
string
primaryVariableName
(
int
pvIdx
=
0
,
int
state
=
0
)
{
return
"p
ressure
"
;
return
"p"
;
}
};
...
...
dumux/porousmediumflow/1pnc/model.hh
View file @
b7a5f1d8
...
...
@@ -97,6 +97,17 @@ struct OnePNCModelTraits
static
constexpr
bool
enableAdvection
()
{
return
true
;
}
static
constexpr
bool
enableMolecularDiffusion
()
{
return
true
;
}
static
constexpr
bool
enableEnergyBalance
()
{
return
false
;
}
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
=
0
)
{
const
std
::
string
xString
=
useMoles
()
?
"x"
:
"X"
;
if
(
pvIdx
==
0
)
return
"p"
;
else
return
xString
+
"^"
+
FluidSystem
::
componentName
(
pvIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
0
);
}
};
/*!
...
...
dumux/porousmediumflow/2p1c/model.hh
View file @
b7a5f1d8
...
...
@@ -95,6 +95,17 @@ struct TwoPOneCModelTraits
static
constexpr
bool
enableAdvection
()
{
return
true
;
}
static
constexpr
bool
enableMolecularDiffusion
()
{
return
false
;
}
static
constexpr
bool
enableEnergyBalance
()
{
return
false
;
}
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
)
{
if
(
pvIdx
==
0
)
return
"p_n"
;
else
if
(
state
==
Indices
::
twoPhases
)
return
"S_w"
;
else
return
"T"
;
}
};
/*!
...
...
dumux/porousmediumflow/2pnc/model.hh
View file @
b7a5f1d8
...
...
@@ -134,6 +134,39 @@ struct TwoPNCModelTraits
static
constexpr
bool
setMoleFractionsForFirstPhase
()
{
return
setMoleFractionForFP
;
}
static
constexpr
TwoPFormulation
priVarFormulation
()
{
return
formulation
;
}
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
)
{
const
std
::
string
xString
=
useMoles
()
?
"x"
:
"X"
;
std
::
string
phaseNameSecComps
;
if
(
state
==
Indices
::
firstPhaseOnly
||
(
state
==
Indices
::
bothPhases
&&
setMoleFractionsForFirstPhase
()))
phaseNameSecComps
=
FluidSystem
::
phaseName
(
FluidSystem
::
phase0Idx
);
else
phaseNameSecComps
=
FluidSystem
::
phaseName
(
FluidSystem
::
phase1Idx
);
if
(
pvIdx
>
1
)
return
xString
+
"^"
+
FluidSystem
::
componentName
(
pvIdx
)
+
"_"
+
phaseNameSecComps
;
const
std
::
vector
<
std
::
string
>
p0s1SwitchedPvNames
=
{
xString
+
"^"
+
FluidSystem
::
componentName
(
FluidSystem
::
comp1Idx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
phase0Idx
),
xString
+
"^"
+
FluidSystem
::
componentName
(
FluidSystem
::
comp0Idx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
phase1Idx
),
"S_n"
};
const
std
::
vector
<
std
::
string
>
p1s0SwitchedPvNames
=
{
xString
+
"^"
+
FluidSystem
::
componentName
(
FluidSystem
::
comp1Idx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
phase0Idx
),
xString
+
"^"
+
FluidSystem
::
componentName
(
FluidSystem
::
comp0Idx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
phase1Idx
),
"S_w"
};
switch
(
priVarFormulation
())
{
case
TwoPFormulation
::
p0s1
:
return
pvIdx
==
0
?
"p_w"
:
p0s1SwitchedPvNames
[
state
-
1
];
case
TwoPFormulation
::
p1s0
:
return
pvIdx
==
0
?
"p_n"
:
p1s0SwitchedPvNames
[
state
-
1
];
}
}
};
/*!
...
...
dumux/porousmediumflow/3p/model.hh
View file @
b7a5f1d8
...
...
@@ -89,6 +89,18 @@ struct ThreePModelTraits
static
constexpr
bool
enableAdvection
()
{
return
true
;
}
static
constexpr
bool
enableMolecularDiffusion
()
{
return
false
;
}
static
constexpr
bool
enableEnergyBalance
()
{
return
false
;
}
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
=
0
)
{
switch
(
pvIdx
)
{
case
0
:
return
"p_g"
;
case
1
:
return
"S_w"
;
default:
return
"S_n"
;
}
}
};
/*!
...
...
dumux/porousmediumflow/3p3c/model.hh
View file @
b7a5f1d8
...
...
@@ -121,6 +121,43 @@ struct ThreePThreeCModelTraits
static
constexpr
bool
useConstraintSolver
()
{
return
useCS
;
}
static
constexpr
bool
useMoles
()
{
return
useMol
;
}
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
=
0
)
{
switch
(
state
)
{
case
Indices
::
threePhases
:
const
std
::
vector
<
std
::
string
>
s1
=
{
"p_g"
,
"S_w"
,
"S_n"
};
return
s1
[
pvIdx
];
case
Indices
::
wPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s2
=
{
"p_g"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
gCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
wPhaseIdx
),
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
nCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
wPhaseIdx
)};
return
s2
[
pvIdx
];
case
Indices
::
gnPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s3
=
{
"p_g"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
wCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
gPhaseIdx
),
"S_n"
};
return
s3
[
pvIdx
];
case
Indices
::
wnPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s4
=
{
"p_g"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
gCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
wPhaseIdx
),
"S_n"
};
return
s4
[
pvIdx
];
case
Indices
::
gPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s5
=
{
"p_g"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
wCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
gPhaseIdx
),
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
nCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
gPhaseIdx
)};
return
s5
[
pvIdx
];
case
Indices
::
wgPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s6
=
{
"p_g"
,
"S_w"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
nCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
gPhaseIdx
)};
return
s6
[
pvIdx
];
}
}
};
/*!
...
...
dumux/porousmediumflow/3pwateroil/model.hh
View file @
b7a5f1d8
...
...
@@ -111,6 +111,43 @@ struct ThreePWaterOilModelTraits
static
constexpr
bool
enableEnergyBalance
()
{
return
false
;
}
static
constexpr
bool
onlyGasPhaseCanDisappear
()
{
return
onlyGasPhase
;
}
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
=
0
)
{
switch
(
state
)
{
case
Indices
::
threePhases
:
const
std
::
vector
<
std
::
string
>
s1
=
{
"p_g"
,
"S_w"
,
"S_n"
};
return
s1
[
pvIdx
];
case
Indices
::
wPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s2
=
{
"p_w"
,
"T"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
nCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
wPhaseIdx
)};
return
s2
[
pvIdx
];
case
Indices
::
gnPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s3
=
{
"p_g"
,
"S_n"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
wCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
nPhaseIdx
)};
return
s3
[
pvIdx
];
case
Indices
::
wnPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s4
=
{
"p_w"
,
"T"
,
"S_n"
};
return
s4
[
pvIdx
];
case
Indices
::
gPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s5
=
{
"p_g"
,
"T"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
nCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
gPhaseIdx
)};
return
s5
[
pvIdx
];
case
Indices
::
wgPhaseOnly
:
const
std
::
vector
<
std
::
string
>
s6
=
{
"p_g"
,
"S_w"
,
"x^"
+
FluidSystem
::
componentName
(
FluidSystem
::
nCompIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
FluidSystem
::
gPhaseIdx
)};
return
s6
[
pvIdx
];
}
}
};
/*!
...
...
dumux/porousmediumflow/nonisothermal/model.hh
View file @
b7a5f1d8
...
...
@@ -80,7 +80,16 @@ struct PorousMediumFlowNIModelTraits : public IsothermalTraits
if
(
pvIdx
<
numEq
()
-
1
)
return
IsothermalTraits
::
primaryVariableName
(
pvIdx
,
state
);
else
return
"temperature"
;
return
"T"
;
}
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
=
0
)
{
if
(
pvIdx
<
numEq
()
-
1
)
return
IsothermalTraits
::
template
primaryVariableName
<
FluidSystem
>(
pvIdx
,
state
);
else
return
"T"
;
}
};
...
...
dumux/porousmediumflow/richards/model.hh
View file @
b7a5f1d8
...
...
@@ -135,6 +135,14 @@ struct RichardsModelTraits
static
constexpr
bool
enableAdvection
()
{
return
true
;
}
static
constexpr
bool
enableMolecularDiffusion
()
{
return
enableDiff
;
}
static
constexpr
bool
enableEnergyBalance
()
{
return
false
;
}
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
)
{
if
(
state
==
Indices
::
gasPhaseOnly
)
return
"x^w_n"
;
else
return
"p_w"
;
}
};
/*!
...
...
dumux/porousmediumflow/richardsnc/model.hh
View file @
b7a5f1d8
...
...
@@ -114,6 +114,17 @@ struct RichardsNCModelTraits
static
constexpr
bool
enableEnergyBalance
()
{
return
false
;
}
static
constexpr
bool
useMoles
()
{
return
useMol
;
}
template
<
class
FluidSystem
>
static
std
::
string
primaryVariableName
(
int
pvIdx
,
int
state
=
0
)
{
const
std
::
string
xString
=
useMoles
()
?
"x"
:
"X"
;
if
(
pvIdx
==
0
)
return
"p_"
+
FluidSystem
::
phaseName
(
0
);
else
return
xString
+
"^"
+
FluidSystem
::
componentName
(
pvIdx
)
+
"_"
+
FluidSystem
::
phaseName
(
0
);
}
};
namespace
Properties
{
...
...
Prev
1
2
Next
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