mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #601 from akva2/no_serialization_brine
Get rid of deck usage in BlackoilBrineModule
This commit is contained in:
commit
a3cd4e6961
@ -91,21 +91,21 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Initialize all internal data structures needed by the brine module
|
* \brief Initialize all internal data structures needed by the brine module
|
||||||
*/
|
*/
|
||||||
static void initFromDeck(const Opm::Deck& deck, const Opm::EclipseState& eclState)
|
static void initFromState(const Opm::EclipseState& eclState)
|
||||||
{
|
{
|
||||||
// some sanity checks: if brine are enabled, the BRINE keyword must be
|
// some sanity checks: if brine are enabled, the BRINE keyword must be
|
||||||
// present, if brine are disabled the keyword must not be present.
|
// present, if brine are disabled the keyword must not be present.
|
||||||
if (enableBrine && !deck.hasKeyword("BRINE")) {
|
if (enableBrine && !eclState.runspec().phases().active(Phase::BRINE)) {
|
||||||
throw std::runtime_error("Non-trivial brine treatment requested at compile time, but "
|
throw std::runtime_error("Non-trivial brine treatment requested at compile time, but "
|
||||||
"the deck does not contain the BRINE keyword");
|
"the deck does not contain the BRINE keyword");
|
||||||
}
|
}
|
||||||
else if (!enableBrine && deck.hasKeyword("BRINE")) {
|
else if (!enableBrine && eclState.runspec().phases().active(Phase::BRINE)) {
|
||||||
throw std::runtime_error("Brine treatment disabled at compile time, but the deck "
|
throw std::runtime_error("Brine treatment disabled at compile time, but the deck "
|
||||||
"contains the BRINE keyword");
|
"contains the BRINE keyword");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!deck.hasKeyword("BRINE"))
|
if (!eclState.runspec().phases().active(Phase::BRINE))
|
||||||
return; // brine treatment is supposed to be disabled
|
return; // brine treatment is supposed to be disabled
|
||||||
|
|
||||||
const auto& tableManager = eclState.getTableManager();
|
const auto& tableManager = eclState.getTableManager();
|
||||||
@ -316,29 +316,6 @@ public:
|
|||||||
return !bdensityTable_.empty();
|
return !bdensityTable_.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Serializer>
|
|
||||||
static std::size_t packSize(Serializer& serializer)
|
|
||||||
{
|
|
||||||
return serializer.packSize(bdensityTable_) +
|
|
||||||
serializer.packSize(referencePressure_);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Serializer>
|
|
||||||
static void pack(std::vector<char>& buffer, int& position,
|
|
||||||
Serializer& serializer)
|
|
||||||
{
|
|
||||||
serializer.pack(bdensityTable_, buffer, position);
|
|
||||||
serializer.pack(referencePressure_, buffer, position);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Serializer>
|
|
||||||
static void unpack(std::vector<char>& buffer, int& position,
|
|
||||||
Serializer& serializer)
|
|
||||||
{
|
|
||||||
serializer.unpack(bdensityTable_, buffer, position);
|
|
||||||
serializer.unpack(referencePressure_, buffer, position);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::vector<TabulatedFunction> bdensityTable_;
|
static std::vector<TabulatedFunction> bdensityTable_;
|
||||||
static std::vector<Scalar> referencePressure_;
|
static std::vector<Scalar> referencePressure_;
|
||||||
|
Loading…
Reference in New Issue
Block a user