Add output of connection dissolved gas and vapporized oil

This commit is contained in:
Tor Harald Sandve 2023-11-21 10:42:36 +01:00
parent 6ab809c69d
commit ee77d30fe5
5 changed files with 16 additions and 1 deletions

View File

@ -1691,6 +1691,8 @@ namespace Opm
if (this->isProducer()) {
ws.phase_mixing_rates[ws.dissolved_gas] += perfRates.dis_gas;
ws.phase_mixing_rates[ws.vaporized_oil] += perfRates.vap_oil;
perf_data.phase_mixing_rates[perf][ws.dissolved_gas] = perfRates.dis_gas;
perf_data.phase_mixing_rates[perf][ws.vaporized_oil] = perfRates.vap_oil;
}
// store the perf pressure and rates

View File

@ -33,6 +33,7 @@ PerfData::PerfData(std::size_t num_perf, double pressure_first_connection_, bool
, pressure(num_perf)
, rates(num_perf)
, phase_rates(num_perf * num_phases)
, phase_mixing_rates(num_perf)
, solvent_rates(num_perf)
, polymer_rates(num_perf)
, brine_rates(num_perf)
@ -59,6 +60,7 @@ PerfData PerfData::serializationTestObject()
result.pressure = {2.0, 3.0, 4.0};
result.rates = {5.0, 6.0};
result.phase_rates = {7.0};
result.phase_mixing_rates = { {1.0, 2.0, 3.0, 4.0}};
result.solvent_rates = {8.0, 9.0};
result.polymer_rates = {10.0, 11.0, 12.0};
result.brine_rates = {13.0};
@ -96,6 +98,7 @@ bool PerfData::try_assign(const PerfData& other) {
this->pressure = other.pressure;
this->rates = other.rates;
this->phase_rates = other.phase_rates;
this->phase_mixing_rates = other.phase_mixing_rates;
this->solvent_rates = other.solvent_rates;
this->polymer_rates = other.polymer_rates;
this->brine_rates = other.brine_rates;
@ -114,6 +117,7 @@ bool PerfData::operator==(const PerfData& rhs) const
this->pressure == rhs.pressure &&
this->rates == rhs.rates &&
this->phase_rates == rhs.phase_rates &&
this->phase_mixing_rates == rhs.phase_mixing_rates &&
this->solvent_rates == rhs.solvent_rates &&
this->polymer_rates == rhs.polymer_rates &&
this->brine_rates == rhs.brine_rates &&

View File

@ -25,6 +25,7 @@
#include <cstddef>
#include <vector>
#include <array>
namespace Opm {
@ -50,6 +51,7 @@ public:
serializer(pressure);
serializer(rates);
serializer(phase_rates);
serializer(phase_mixing_rates);
serializer(solvent_rates);
serializer(polymer_rates);
serializer(brine_rates);
@ -72,6 +74,7 @@ public:
std::vector<double> pressure;
std::vector<double> rates;
std::vector<double> phase_rates;
std::vector<std::array<double,4>> phase_mixing_rates;
std::vector<double> solvent_rates;
std::vector<double> polymer_rates;
std::vector<double> brine_rates;

View File

@ -518,6 +518,10 @@ namespace Opm
ws.phase_mixing_rates[ws.dissolved_gas_in_water] += perf_rates.dis_gas_in_water;
ws.phase_mixing_rates[ws.vaporized_oil] += perf_rates.vap_oil;
ws.phase_mixing_rates[ws.vaporized_water] += perf_rates.vap_wat;
perf_data.phase_mixing_rates[perf][ws.dissolved_gas] = perf_rates.dis_gas;
perf_data.phase_mixing_rates[perf][ws.dissolved_gas_in_water] = perf_rates.dis_gas_in_water;
perf_data.phase_mixing_rates[perf][ws.vaporized_oil] = perf_rates.vap_oil;
perf_data.phase_mixing_rates[perf][ws.vaporized_water] = perf_rates.vap_wat;
}
if constexpr (has_energy) {

View File

@ -585,6 +585,7 @@ void WellState::reportConnections(std::vector<data::Connection>& connections,
connections.resize(num_perf_well);
const auto& perf_rates = perf_data.rates;
const auto& perf_pressure = perf_data.pressure;
const auto& perf_mixing_rates = perf_data.phase_mixing_rates;
for (int i = 0; i < num_perf_well; ++i) {
const auto active_index = perf_data.cell_index[i];
auto& connection = connections[ i ];
@ -593,6 +594,8 @@ void WellState::reportConnections(std::vector<data::Connection>& connections,
connection.reservoir_rate = perf_rates[i];
connection.trans_factor = perf_data.connection_transmissibility_factor[i];
connection.d_factor = perf_data.connection_d_factor[i];
connection.rates.set(rt::dissolved_gas, perf_mixing_rates[i][ws.dissolved_gas]);
connection.rates.set(rt::vaporized_oil, perf_mixing_rates[i][ws.vaporized_oil]);
if (!ws.producer) {
const auto& filtrate_data = perf_data.filtrate_data;
auto& filtrate = connection.filtrate;
@ -647,7 +650,6 @@ void WellState::reportConnections(std::vector<data::Connection>& connections,
const auto& perf_solvent_rate = perf_data.solvent_rates;
comp.rates.set( rt::solvent, perf_solvent_rate[local_conn_index] );
}
++local_conn_index;
}
}