fixed: properly combine MULTFLT from GRID and EDIT
This commit is contained in:
parent
5a08a17978
commit
b7a888fcfa
@ -150,7 +150,7 @@ namespace Opm {
|
||||
void initFaults(const Deck& deck);
|
||||
void initPara(const Deck& deck);
|
||||
|
||||
void setMULTFLT(const Opm::DeckSection& section);
|
||||
void setMULTFLT(const Opm::DeckSection& section, bool edit = false);
|
||||
|
||||
void complainAboutAmbiguousKeyword(const Deck& deck,
|
||||
const std::string& keywordName);
|
||||
|
@ -357,16 +357,17 @@ namespace Opm {
|
||||
setMULTFLT(gridSection);
|
||||
|
||||
if (DeckSection::hasEDIT(deck)) {
|
||||
setMULTFLT(EDITSection ( deck ));
|
||||
setMULTFLT(EDITSection(deck), true);
|
||||
}
|
||||
|
||||
m_transMult.applyMULTFLT( m_faults );
|
||||
}
|
||||
|
||||
|
||||
void EclipseState::setMULTFLT(const DeckSection& section) {
|
||||
void EclipseState::setMULTFLT(const DeckSection& section, bool edit) {
|
||||
// Set error to false
|
||||
bool error = false;
|
||||
std::map<std::string,double> prev;
|
||||
for (size_t index=0; index < section.count("MULTFLT"); index++) {
|
||||
const auto& faultsKeyword = section.getKeyword("MULTFLT" , index);
|
||||
OpmLog::info(OpmInputError::format("\nApplying {keyword} in {file} line {line}", faultsKeyword.location()));
|
||||
@ -377,7 +378,18 @@ namespace Opm {
|
||||
double multFlt = faultRecord.getItem(1).get< double >(0);
|
||||
try
|
||||
{
|
||||
m_faults.setTransMult( faultName , multFlt );
|
||||
if (edit) {
|
||||
if (m_faults.hasFault(faultName)) {
|
||||
const auto it = prev.find(faultName);
|
||||
const auto& fault = m_faults.getFault(faultName);
|
||||
if (it == prev.end()) {
|
||||
prev[faultName] = fault.getTransMult();
|
||||
multFlt *= m_faults.getFault(faultName).getTransMult();
|
||||
} else
|
||||
multFlt *= it->second;
|
||||
}
|
||||
}
|
||||
m_faults.setTransMult(faultName, multFlt);
|
||||
logger(fmt::format("Setting fault transmissibility multiplier {} for fault {}", multFlt, faultName));
|
||||
}
|
||||
catch(const std::exception& std_error)
|
||||
|
@ -17,6 +17,9 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "opm/input/eclipse/Deck/Deck.hpp"
|
||||
#include "opm/input/eclipse/EclipseState/EclipseState.hpp"
|
||||
#include "opm/input/eclipse/Parser/Parser.hpp"
|
||||
#include <stdexcept>
|
||||
#include <ostream>
|
||||
|
||||
@ -136,3 +139,148 @@ BOOST_AUTO_TEST_CASE(AddFaultsToCollection) {
|
||||
BOOST_CHECK(faults.hasFault("FAULTX"));
|
||||
BOOST_CHECK_EQUAL( faultx.getName() , faults.getFault(1).getName());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GridOnly) {
|
||||
const std::string deck_string = R"(
|
||||
RUNSPEC
|
||||
DIMENS
|
||||
10 10 10 /
|
||||
GRID
|
||||
DX
|
||||
1000*0.25 /
|
||||
DY
|
||||
1000*0.25 /
|
||||
DZ
|
||||
1000*0.25 /
|
||||
TOPS
|
||||
100*0.25 /
|
||||
FAULTS
|
||||
'FLT1' 3 3 1 4 1 7 'X' /
|
||||
'FLT2' 1 8 4 4 1 7 'Y' /
|
||||
/
|
||||
MULTFLT
|
||||
'FLT1' 0.0001 /
|
||||
'FLT2' 0.0005 /
|
||||
/
|
||||
MULTFLT
|
||||
'FLT1' 0.001 /
|
||||
/
|
||||
)";
|
||||
|
||||
Opm::Parser parser;
|
||||
Opm::Deck deck = parser.parseString(deck_string);
|
||||
Opm::EclipseState state(deck);
|
||||
const auto& flt1 = state.getFaults().getFault("FLT1");
|
||||
BOOST_CHECK_EQUAL(flt1.getTransMult(), 0.001);
|
||||
const auto& flt2 = state.getFaults().getFault("FLT2");
|
||||
BOOST_CHECK_EQUAL(flt2.getTransMult(), 0.0005);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(EditOnly) {
|
||||
const std::string deck_string = R"(
|
||||
RUNSPEC
|
||||
DIMENS
|
||||
10 10 10 /
|
||||
GRID
|
||||
DX
|
||||
1000*0.25 /
|
||||
DY
|
||||
1000*0.25 /
|
||||
DZ
|
||||
1000*0.25 /
|
||||
TOPS
|
||||
100*0.25 /
|
||||
FAULTS
|
||||
'FLT1' 3 3 1 4 1 7 'X' /
|
||||
'FLT2' 1 8 4 4 1 7 'Y' /
|
||||
/
|
||||
EDIT
|
||||
MULTFLT
|
||||
'FLT1' 0.0001 /
|
||||
'FLT2' 0.0005 /
|
||||
/
|
||||
MULTFLT
|
||||
'FLT1' 0.001 /
|
||||
/
|
||||
)";
|
||||
|
||||
Opm::Parser parser;
|
||||
Opm::Deck deck = parser.parseString(deck_string);
|
||||
Opm::EclipseState state(deck);
|
||||
const auto& flt1 = state.getFaults().getFault("FLT1");
|
||||
BOOST_CHECK_EQUAL(flt1.getTransMult(), 0.001);
|
||||
const auto& flt2 = state.getFaults().getFault("FLT2");
|
||||
BOOST_CHECK_EQUAL(flt2.getTransMult(), 0.0005);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GridAndEdit) {
|
||||
const std::string deck_string = R"(
|
||||
RUNSPEC
|
||||
DIMENS
|
||||
10 10 10 /
|
||||
GRID
|
||||
DX
|
||||
1000*0.25 /
|
||||
DY
|
||||
1000*0.25 /
|
||||
DZ
|
||||
1000*0.25 /
|
||||
TOPS
|
||||
100*0.25 /
|
||||
FAULTS
|
||||
'FLT1' 3 3 1 4 1 7 'X' /
|
||||
'FLT2' 1 8 4 4 1 7 'Y' /
|
||||
/
|
||||
MULTFLT
|
||||
'FLT1' 0.0001 /
|
||||
/
|
||||
EDIT
|
||||
MULTFLT
|
||||
'FLT1' 20 /
|
||||
'FLT2' 0.0005 /
|
||||
/
|
||||
)";
|
||||
|
||||
Opm::Parser parser;
|
||||
Opm::Deck deck = parser.parseString(deck_string);
|
||||
Opm::EclipseState state(deck);
|
||||
const auto& flt1 = state.getFaults().getFault("FLT1");
|
||||
BOOST_CHECK_EQUAL(flt1.getTransMult(), 0.002);
|
||||
const auto& flt2 = state.getFaults().getFault("FLT2");
|
||||
BOOST_CHECK_EQUAL(flt2.getTransMult(), 0.0005);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GridAndEdit2) {
|
||||
const std::string deck_string = R"(
|
||||
RUNSPEC
|
||||
DIMENS
|
||||
10 10 10 /
|
||||
GRID
|
||||
DX
|
||||
1000*0.25 /
|
||||
DY
|
||||
1000*0.25 /
|
||||
DZ
|
||||
1000*0.25 /
|
||||
TOPS
|
||||
100*0.25 /
|
||||
FAULTS
|
||||
'FLT1' 3 3 1 4 1 7 'X' /
|
||||
/
|
||||
MULTFLT
|
||||
'FLT1' 5.0 /
|
||||
'FLT1' 0.0001 /
|
||||
/
|
||||
EDIT
|
||||
MULTFLT
|
||||
'FLT1' 0.0005 /
|
||||
'FLT1' 20 /
|
||||
/
|
||||
)";
|
||||
|
||||
Opm::Parser parser;
|
||||
Opm::Deck deck = parser.parseString(deck_string);
|
||||
Opm::EclipseState state(deck);
|
||||
const auto& flt1 = state.getFaults().getFault("FLT1");
|
||||
BOOST_CHECK_EQUAL(flt1.getTransMult(), 0.002);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user