mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Added phaseName() method.
This commit is contained in:
@@ -208,6 +208,9 @@ namespace Opm {
|
|||||||
/// The number of active phases in the model.
|
/// The number of active phases in the model.
|
||||||
int numPhases() const;
|
int numPhases() const;
|
||||||
|
|
||||||
|
/// The name of an active phase in the model.
|
||||||
|
const std::string& phaseName(int phase_index) const;
|
||||||
|
|
||||||
/// Update the scaling factors for mass balance equations
|
/// Update the scaling factors for mass balance equations
|
||||||
void updateEquationsScaling();
|
void updateEquationsScaling();
|
||||||
|
|
||||||
@@ -274,6 +277,7 @@ namespace Opm {
|
|||||||
|
|
||||||
std::vector<int> primalVariable_;
|
std::vector<int> primalVariable_;
|
||||||
V pvdt_;
|
V pvdt_;
|
||||||
|
std::vector<std::string> phase_name_;
|
||||||
|
|
||||||
// --------- Protected methods ---------
|
// --------- Protected methods ---------
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,9 @@ namespace detail {
|
|||||||
ADB::null(),
|
ADB::null(),
|
||||||
{ 1.1169, 1.0031, 0.0031 }} ) // the default magic numbers
|
{ 1.1169, 1.0031, 0.0031 }} ) // the default magic numbers
|
||||||
, terminal_output_ (terminal_output)
|
, terminal_output_ (terminal_output)
|
||||||
|
, phase_name_{ "Water", "Oil", "Gas" }
|
||||||
{
|
{
|
||||||
|
assert(numPhases() == 3); // Due to the phase_name_ init above.
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
if ( linsolver_.parallelInformation().type() == typeid(ParallelISTLInformation) )
|
if ( linsolver_.parallelInformation().type() == typeid(ParallelISTLInformation) )
|
||||||
{
|
{
|
||||||
@@ -284,6 +286,19 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template <class Grid, class Implementation>
|
||||||
|
const std::string&
|
||||||
|
BlackoilModelBase<Grid, Implementation>::
|
||||||
|
phaseName(int phase_index) const
|
||||||
|
{
|
||||||
|
assert(phase_index < numPhases());
|
||||||
|
return phase_name_[phase_index];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation>
|
template <class Grid, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation>::
|
BlackoilModelBase<Grid, Implementation>::
|
||||||
|
|||||||
Reference in New Issue
Block a user