Merge pull request #857 from iLoop2/ThresholdPressure
Threshold pressure
This commit is contained in:
commit
9ad6e59ee7
@ -19,7 +19,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
||||
|
||||
#ifndef OPM_THRESHOLDPRESSURES_HEADER_INCLUDED
|
||||
#define OPM_THRESHOLDPRESSURES_HEADER_INCLUDED
|
||||
@ -46,11 +46,10 @@ namespace Opm
|
||||
|
||||
|
||||
template <class Grid>
|
||||
std::vector<double> thresholdPressures(EclipseStateConstPtr eclipseState, const Grid& grid)
|
||||
std::vector<double> thresholdPressures(const ParseMode& parseMode ,EclipseStateConstPtr eclipseState, const Grid& grid)
|
||||
{
|
||||
SimulationConfigConstPtr simulationConfig = eclipseState->getSimulationConfig();
|
||||
const std::vector<double>& thresholdPressureTable = simulationConfig->getThresholdPressureTable();
|
||||
|
||||
const std::vector<std::pair<bool, double>>& thresholdPressureTable = simulationConfig->getThresholdPressureTable();
|
||||
std::vector<double> thpres_vals;
|
||||
|
||||
if (thresholdPressureTable.size() > 0) {
|
||||
@ -73,7 +72,13 @@ namespace Opm
|
||||
}
|
||||
const int eq1 = eqlnumData[gc[c1]] - 1;
|
||||
const int eq2 = eqlnumData[gc[c2]] - 1;
|
||||
thpres_vals[face] = thresholdPressureTable[eq1 + maxEqlnum*eq2];
|
||||
std::pair<bool, double> value = thresholdPressureTable[eq1 + maxEqlnum*eq2];
|
||||
if(value.first){
|
||||
thpres_vals[face] = value.second;
|
||||
}else{
|
||||
std::string msg = "Inferring threshold pressure from the initial state is not supported.";
|
||||
parseMode.handleError( ParseMode::UNSUPPORTED_INITIAL_THPRES , msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
return thpres_vals;
|
||||
|
Loading…
Reference in New Issue
Block a user