some cleaning up and sanity checks.

This commit is contained in:
Kai Bao
2018-10-09 12:48:11 +02:00
parent 862b3450d3
commit 2bf33c30d8
7 changed files with 25 additions and 10 deletions

View File

@@ -185,8 +185,6 @@ namespace Opm
void handleGCONPROD( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext);
void handleGEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext);
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);

View File

@@ -20,9 +20,6 @@
#ifndef OPM_PARSER_SIMPLE_2D_TABLE_HPP
#define OPM_PARSER_SIMPLE_2D_TABLE_HPP
// TODO: it is a simple version to begin with, will check whether to introduce
// the Schemas and TableColumn
#include <vector>
namespace Opm {

View File

@@ -156,7 +156,7 @@ namespace Opm {
void initPlymaxTables(const Deck& deck);
void initPlyrockTables(const Deck& deck);
void initPlyshlogTables(const Deck& deck);
// TODO: maybe the following three tables should go to one function
void initPlymwinjTables(const Deck& deck);
void initSkprwatTables(const Deck& deck);
void initSkprpolyTables(const Deck& deck);

View File

@@ -779,10 +779,11 @@ namespace Opm {
}
for (auto* well : wells) {
// TODO: it needs to be an injector
if (well->isProducer(currentStep) ) {
throw std::logic_error("WPMITAB keyword can not be applied to production well " + well->name() );
}
WellPolymerProperties properties(well->getPolymerProperties(currentStep));
properties.m_plymwinjtable = record.getItem("TABLE_NUMBER").get<int>(0);
// TODO: some sanity check about the table number?
well->setPolymerProperties(currentStep, properties);
}
}
@@ -801,11 +802,12 @@ namespace Opm {
}
for (auto* well : wells) {
// TODO: it needs to be an injector
if (well->isProducer(currentStep) ) {
throw std::logic_error("WSKPTAB can not be applied to production well " + well->name() );
}
WellPolymerProperties properties(well->getPolymerProperties(currentStep));
properties.m_skprwattable = record.getItem("TABLE_NUMBER_WATER").get<int>(0);
properties.m_skprpolytable = record.getItem("TABLE_NUMBER_POLYMER").get<int>(0);
// TODO: some sanity check about the table number?
well->setPolymerProperties(currentStep, properties);
}
}

View File

@@ -32,6 +32,10 @@ namespace Opm{
const DeckRecord& record0 = table.getRecord(0);
m_table_number = record0.getItem<PLYMWINJ::TABLE_NUMBER>().get< int >(0);
if (m_table_number <= 0) {
const std::string msg = "PLYMWINJ table has non-positive table number " + std::to_string(m_table_number);
throw std::invalid_argument(msg);
}
m_x_points = table.getRecord(1).getItem<PLYMWINJ::THROUGHPUT>().getSIDoubleData();
const size_t num_cols = m_x_points.size();

View File

@@ -32,7 +32,17 @@ namespace Opm{
const DeckRecord& record0 = table.getRecord(0);
m_table_number = record0.getItem<SKPRPOLY::TABLE_NUMBER>().get< int >(0);
if (m_table_number <= 0) {
const std::string msg = "SKPRPOLY table has non-positive table number " + std::to_string(m_table_number);
throw std::invalid_argument(msg);
}
m_ref_polymer_concentration = record0.getItem<SKPRPOLY::POLYMERCONCENTRATION>().get< double >(0);
if (m_ref_polymer_concentration <= 0.) {
const std::string msg = "Non-positive reference polymer concentration is specified for SKPRPOLY table "i
+ std::to_string(m_table_number);
throw std::invalid_argument(msg);
}
m_x_points = table.getRecord(1).getItem<SKPRPOLY::THROUGHPUT>().getSIDoubleData();
const size_t num_cols = m_x_points.size();

View File

@@ -32,6 +32,10 @@ namespace Opm{
const DeckRecord& record0 = table.getRecord(0);
m_table_number = record0.getItem<SKPRWAT::TABLE_NUMBER>().get< int >(0);
if (m_table_number <= 0) {
const std::string msg = "SKPRWAT table has non-positive table number " + std::to_string(m_table_number);
throw std::invalid_argument(msg);
}
m_x_points = table.getRecord(1).getItem<SKPRWAT::THROUGHPUT>().getSIDoubleData();
const size_t num_cols = m_x_points.size();