Add INVALID_WELLS to WECON & WEFAC
This commit is contained in:
@@ -165,7 +165,7 @@ namespace Opm
|
||||
void handleGCONINJE( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleGCONPROD( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleGEFAC( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWEFAC( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext);
|
||||
void handleTUNING( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleGRUPNET( const DeckKeyword& keyword, size_t currentStep);
|
||||
@@ -175,7 +175,7 @@ namespace Opm
|
||||
void handleDRSDT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleDRVDT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleVAPPARS( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWECON( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWECON( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext);
|
||||
void handleWHISTCTL(const ParseContext& parseContext, const DeckKeyword& keyword);
|
||||
void handleMESSAGES(const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleVFPPROD(const DeckKeyword& vfpprodKeyword, const UnitSystem& unit_system, size_t currentStep);
|
||||
|
||||
@@ -250,13 +250,13 @@ namespace Opm {
|
||||
handleVAPPARS(keyword, currentStep);
|
||||
|
||||
else if (keyword.name() == "WECON")
|
||||
handleWECON(keyword, currentStep);
|
||||
handleWECON(keyword, currentStep, parseContext);
|
||||
|
||||
else if (keyword.name() == "MESSAGES")
|
||||
handleMESSAGES(keyword, currentStep);
|
||||
|
||||
else if (keyword.name() == "WEFAC")
|
||||
handleWEFAC(keyword, currentStep);
|
||||
handleWEFAC(keyword, currentStep, parseContext);
|
||||
|
||||
else if (keyword.name() == "VFPINJ")
|
||||
handleVFPINJ(keyword, unit_system, currentStep);
|
||||
@@ -726,23 +726,31 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
void Schedule::handleWECON( const DeckKeyword& keyword, size_t currentStep) {
|
||||
void Schedule::handleWECON( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext) {
|
||||
for( const auto& record : keyword ) {
|
||||
const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0);
|
||||
WellEconProductionLimits econ_production_limits(record);
|
||||
const auto wells = getWells( wellNamePattern );
|
||||
|
||||
for( auto* well : getWells( wellNamePattern ) ) {
|
||||
if (wells.empty())
|
||||
InvalidWellPattern(wellNamePattern, parseContext, keyword);
|
||||
|
||||
for( auto* well : wells ) {
|
||||
well->setEconProductionLimits(currentStep, econ_production_limits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Schedule::handleWEFAC( const DeckKeyword& keyword, size_t currentStep) {
|
||||
void Schedule::handleWEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext) {
|
||||
for( const auto& record : keyword ) {
|
||||
const std::string& wellNamePattern = record.getItem("WELLNAME").getTrimmedString(0);
|
||||
const double& efficiencyFactor = record.getItem("EFFICIENCY_FACTOR").get< double >(0);
|
||||
const auto wells = getWells( wellNamePattern );
|
||||
|
||||
for( auto* well : getWells( wellNamePattern ) ) {
|
||||
if (wells.empty())
|
||||
InvalidWellPattern(wellNamePattern, parseContext, keyword);
|
||||
|
||||
for( auto* well : wells ) {
|
||||
well->setEfficiencyFactor(currentStep, efficiencyFactor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,6 +647,34 @@ BOOST_AUTO_TEST_CASE( test_invalid_wtemplate_config ) {
|
||||
)";
|
||||
testSamples.push_back(testSample);
|
||||
|
||||
// Invalid well name in WECON
|
||||
testSample = R"(
|
||||
COMPDAT
|
||||
'PROD' 10 10 3 3 'OPEN' 1* 1* 0.5 /
|
||||
/
|
||||
WCONPROD
|
||||
'PROD' 'OPEN' 'ORAT' 20000 4* 1000 /
|
||||
/
|
||||
WECON
|
||||
'SOMETHINGELSE' 15000 /
|
||||
/
|
||||
)";
|
||||
testSamples.push_back(testSample);
|
||||
|
||||
// Invalid well name in WEFAC
|
||||
testSample = R"(
|
||||
COMPDAT
|
||||
'PROD' 10 10 3 3 'OPEN' 1* 1* 0.5 /
|
||||
/
|
||||
WCONPROD
|
||||
'PROD' 'OPEN' 'ORAT' 20000 4* 1000 /
|
||||
/
|
||||
WEFAC
|
||||
'SOMETHINGELSE' 0.5 /
|
||||
/
|
||||
)";
|
||||
testSamples.push_back(testSample);
|
||||
|
||||
std::string deckinput;
|
||||
|
||||
for (std::string sample : testSamples) {
|
||||
|
||||
Reference in New Issue
Block a user