Merge pull request #1985 from joakim-hove/create-grid-info
Create grid info
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Aquancon.hpp>
|
||||
#include <opm/common/utility/OpmInputError.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
@@ -59,6 +61,7 @@ namespace Opm {
|
||||
std::unordered_map<std::size_t, Aquancon::AquancCell> work;
|
||||
for (std::size_t iaq = 0; iaq < deck.count("AQUANCON"); iaq++) {
|
||||
const auto& aquanconKeyword = deck.getKeyword("AQUANCON", iaq);
|
||||
OpmLog::info(OpmInputError::format("Initializing aquifer connections from {keyword} in {file} line {line}", aquanconKeyword.location()));
|
||||
for (const auto& aquanconRecord : aquanconKeyword) {
|
||||
const int aquiferID = aquanconRecord.getItem("AQUIFER_ID").get<int>(0);
|
||||
const int i1 = aquanconRecord.getItem("I1").get<int>(0) - 1;
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/AquiferCT.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/common/utility/OpmInputError.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -138,6 +140,7 @@ AquiferCT::AquiferCT(const TableManager& tables, const Deck& deck)
|
||||
return;
|
||||
|
||||
const auto& aquctKeyword = deck.getKeyword<AQUCT>();
|
||||
OpmLog::info(OpmInputError::format("Initializing Carter Tracey aquifers from {keyword} in {file} line {line}", aquctKeyword.location()));
|
||||
for (auto& record : aquctKeyword)
|
||||
this->m_aquct.emplace_back(record, tables);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Aquifetp.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/common/utility/OpmInputError.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -71,6 +73,7 @@ Aquifetp::Aquifetp(const Deck& deck)
|
||||
return;
|
||||
|
||||
const auto& aqufetpKeyword = deck.getKeyword<AQUFETP>();
|
||||
OpmLog::info(OpmInputError::format("Initializing Fetkovich aquifers from {keyword} in {file} line {line}", aqufetpKeyword.location()));
|
||||
for (auto& record : aqufetpKeyword)
|
||||
this->m_aqufetp.emplace_back(record);
|
||||
}
|
||||
|
||||
@@ -62,14 +62,14 @@ namespace Opm {
|
||||
m_gridDims( deck ),
|
||||
field_props( deck, m_runspec.phases(), m_inputGrid, m_tables),
|
||||
m_simulationConfig( m_eclipseConfig.getInitConfig().restartRequested(), deck, field_props),
|
||||
m_transMult( GridDims(deck), deck, field_props)
|
||||
m_transMult( GridDims(deck), deck, field_props),
|
||||
tracer_config( m_deckUnitSystem, deck)
|
||||
{
|
||||
m_inputGrid.resetACTNUM(this->field_props.actnum());
|
||||
if( this->runspec().phases().size() < 3 )
|
||||
OpmLog::info("Only " + std::to_string( this->runspec().phases().size() )
|
||||
+ " fluid phases are enabled" );
|
||||
OpmLog::info(fmt::format("Only {} fluid phases are enabled", this->runspec().phases().size() ));
|
||||
|
||||
this->aquifer_config = AquiferConfig(this->m_tables, this->m_inputGrid, deck);
|
||||
this->tracer_config = TracerConfig(this->m_deckUnitSystem, deck);
|
||||
|
||||
if (deck.hasKeyword( "TITLE" )) {
|
||||
const auto& titleKeyword = deck.getKeyword( "TITLE" );
|
||||
@@ -80,8 +80,8 @@ namespace Opm {
|
||||
m_title.pop_back();
|
||||
}
|
||||
|
||||
initTransMult();
|
||||
initFaults(deck);
|
||||
this->initTransMult();
|
||||
this->initFaults(deck);
|
||||
this->field_props.reset_actnum( this->m_inputGrid.getACTNUM() );
|
||||
}
|
||||
catch (const OpmInputError& opm_error) {
|
||||
@@ -231,6 +231,7 @@ namespace Opm {
|
||||
void EclipseState::setMULTFLT(const DeckSection& section) {
|
||||
for (size_t index=0; index < section.count("MULTFLT"); index++) {
|
||||
const auto& faultsKeyword = section.getKeyword("MULTFLT" , index);
|
||||
OpmLog::info(OpmInputError::format("Applying {keyword} in {file} line {line}", faultsKeyword.location()));
|
||||
for (auto iter = faultsKeyword.begin(); iter != faultsKeyword.end(); ++iter) {
|
||||
|
||||
const auto& faultRecord = *iter;
|
||||
@@ -238,6 +239,7 @@ namespace Opm {
|
||||
double multFlt = faultRecord.getItem(1).get< double >(0);
|
||||
|
||||
m_faults.setTransMult( faultName , multFlt );
|
||||
OpmLog::info(fmt::format("Setting fault transmissibility multiplier {} for fault {}", multFlt, faultName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum)
|
||||
m_multzMode(PinchMode::ModeEnum::TOP),
|
||||
m_pinchGapMode(PinchMode::ModeEnum::GAP)
|
||||
{
|
||||
|
||||
OpmLog::info("Creating grid");
|
||||
if (deck.hasKeyword("GDFILE")){
|
||||
|
||||
if (deck.hasKeyword("COORD")){
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <opm/common/utility/OpmInputError.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
@@ -47,6 +49,8 @@ namespace Opm {
|
||||
|
||||
for (auto keyword_iter = faultKeywords.begin(); keyword_iter != faultKeywords.end(); ++keyword_iter) {
|
||||
const auto& faultsKeyword = *keyword_iter;
|
||||
OpmLog::info(OpmInputError::format("Loading faults from {keyword} in {file} line {line}", faultsKeyword->location()));
|
||||
|
||||
for (auto iter = faultsKeyword->begin(); iter != faultsKeyword->end(); ++iter) {
|
||||
const auto& faultRecord = *iter;
|
||||
const std::string& faultName = faultRecord.getItem(0).get< std::string >(0);
|
||||
|
||||
@@ -19,6 +19,11 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <opm/common/OpmLog/LogUtil.hpp>
|
||||
#include <opm/common/utility/OpmInputError.hpp>
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckSection.hpp>
|
||||
@@ -29,6 +34,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/M.hpp>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
@@ -46,13 +52,12 @@ namespace Opm {
|
||||
m_multregtScanner( dims, &fp, deck.getKeywordList( "MULTREGT" ))
|
||||
{
|
||||
EDITSection edit_section(deck);
|
||||
if (edit_section.hasKeyword("MULTREGT")) {
|
||||
std::string msg =
|
||||
R"(This deck has the MULTREGT keyword located in the EDIT section. Note that:
|
||||
1) The MULTREGT keyword from EDIT section will be applied.
|
||||
2) It is recommended to place MULTREGT in the GRID section.)";
|
||||
|
||||
OpmLog::warning(msg);
|
||||
if (edit_section.hasKeyword<ParserKeywords::MULTREGT>()) {
|
||||
auto& keyword = edit_section.getKeyword<ParserKeywords::MULTREGT>();
|
||||
std::string msg_fmt = "The {keyword} located in the EDIT section\n"
|
||||
"In {file} line {line}\n"
|
||||
"The MULTREGT keyword will be applied, but it is recommended to place MULTREGT in the GRID section.";
|
||||
OpmLog::warning(OpmInputError::format(msg_fmt, keyword.location()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/common/utility/OpmInputError.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/T.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/TracerConfig.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
@@ -49,6 +50,7 @@ TracerConfig::TracerConfig(const UnitSystem& unit_system, const Deck& deck)
|
||||
using TR = ParserKeywords::TRACER;
|
||||
if (deck.hasKeyword<TR>()) {
|
||||
const auto& keyword = deck.getKeyword<TR>();
|
||||
OpmLog::info(OpmInputError::format("Initializing tracers from {keyword} in {file} line {line}", keyword.location()));
|
||||
for (const auto& record : keyword) {
|
||||
const auto& name = record.getItem<TR::NAME>().get<std::string>(0);
|
||||
Phase phase = phase_from_string(record.getItem<TR::FLUID>().get<std::string>(0));
|
||||
@@ -61,7 +63,9 @@ TracerConfig::TracerConfig(const UnitSystem& unit_system, const Deck& deck)
|
||||
|
||||
std::string tracer_field = "TBLKF" + name;
|
||||
if (deck.hasKeyword(tracer_field)) {
|
||||
auto concentration = deck.getKeyword(tracer_field).getRecord(0).getItem(0).getData<double>();
|
||||
const auto& tracer_keyword = deck.getKeyword(tracer_field);
|
||||
auto concentration = tracer_keyword.getRecord(0).getItem(0).getData<double>();
|
||||
OpmLog::info(OpmInputError::format("Loading tracer concentration from {keyword} in {file} line {line}", tracer_keyword.location()));
|
||||
for (auto& c : concentration)
|
||||
c *= inv_volume;
|
||||
|
||||
@@ -71,7 +75,9 @@ TracerConfig::TracerConfig(const UnitSystem& unit_system, const Deck& deck)
|
||||
|
||||
std::string tracer_table = "TVDPF" + name;
|
||||
if (deck.hasKeyword(tracer_table)) {
|
||||
const auto& deck_item = deck.getKeyword(tracer_table).getRecord(0).getItem(0);
|
||||
const auto& tracer_keyword = deck.getKeyword(tracer_table);
|
||||
const auto& deck_item = tracer_keyword.getRecord(0).getItem(0);
|
||||
OpmLog::info(OpmInputError::format("Loading tracer table from {keyword} in {file} line {line}", tracer_keyword.location()));
|
||||
this->tracers.emplace_back(name, phase, TracerVdTable(deck_item, inv_volume));
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user