mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-30 11:06:55 -06:00
Merge pull request #2695 from totto82/addBrineOutput
Add brine to output
This commit is contained in:
commit
f2395f6d94
@ -65,6 +65,14 @@ namespace Opm
|
|||||||
if (Base::has_energy) {
|
if (Base::has_energy) {
|
||||||
OPM_THROW(std::runtime_error, "energy is not supported by multisegment well yet");
|
OPM_THROW(std::runtime_error, "energy is not supported by multisegment well yet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Base::has_foam) {
|
||||||
|
OPM_THROW(std::runtime_error, "foam is not supported by multisegment well yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Base::has_brine) {
|
||||||
|
OPM_THROW(std::runtime_error, "brine is not supported by multisegment well yet");
|
||||||
|
}
|
||||||
// since we decide to use the WellSegments from the well parser. we can reuse a lot from it.
|
// since we decide to use the WellSegments from the well parser. we can reuse a lot from it.
|
||||||
// for other facilities needed but not available from parser, we need to process them here
|
// for other facilities needed but not available from parser, we need to process them here
|
||||||
|
|
||||||
|
@ -699,12 +699,16 @@ namespace Opm
|
|||||||
if (has_brine) {
|
if (has_brine) {
|
||||||
// TODO: the application of well efficiency factor has not been tested with an example yet
|
// TODO: the application of well efficiency factor has not been tested with an example yet
|
||||||
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
|
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
|
||||||
EvalWell cq_s_sm = cq_s[waterCompIdx] * well_efficiency_factor_;
|
EvalWell cq_s_sm = cq_s[waterCompIdx];
|
||||||
if (this->isInjector()) {
|
if (this->isInjector()) {
|
||||||
cq_s_sm *= wsalt();
|
cq_s_sm *= wsalt();
|
||||||
} else {
|
} else {
|
||||||
cq_s_sm *= extendEval(intQuants.fluidState().saltConcentration());
|
cq_s_sm *= extendEval(intQuants.fluidState().saltConcentration());
|
||||||
}
|
}
|
||||||
|
// Note. Efficiency factor is handled in the output layer
|
||||||
|
well_state.perfRateBrine()[first_perf_ + perf] = cq_s_sm.value();
|
||||||
|
|
||||||
|
cq_s_sm *= well_efficiency_factor_;
|
||||||
connectionRates_[perf][contiBrineEqIdx] = Base::restrictEval(cq_s_sm);
|
connectionRates_[perf][contiBrineEqIdx] = Base::restrictEval(cq_s_sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,6 +161,9 @@ namespace Opm
|
|||||||
perfRatePolymer_.clear();
|
perfRatePolymer_.clear();
|
||||||
perfRatePolymer_.resize(nperf, 0.0);
|
perfRatePolymer_.resize(nperf, 0.0);
|
||||||
|
|
||||||
|
perfRateBrine_.clear();
|
||||||
|
perfRateBrine_.resize(nperf, 0.0);
|
||||||
|
|
||||||
// intialize wells that have been there before
|
// intialize wells that have been there before
|
||||||
// order may change so the mapping is based on the well name
|
// order may change so the mapping is based on the well name
|
||||||
if (prevState && !prevState->wellMap().empty()) {
|
if (prevState && !prevState->wellMap().empty()) {
|
||||||
@ -571,6 +574,10 @@ namespace Opm
|
|||||||
well.rates.set( rt::polymer, polymerWellRate(w) );
|
well.rates.set( rt::polymer, polymerWellRate(w) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( pu.has_brine ) {
|
||||||
|
well.rates.set( rt::brine, brineWellRate(w) );
|
||||||
|
}
|
||||||
|
|
||||||
well.rates.set( rt::dissolved_gas, this->well_dissolved_gas_rates_[w] );
|
well.rates.set( rt::dissolved_gas, this->well_dissolved_gas_rates_[w] );
|
||||||
well.rates.set( rt::vaporized_oil, this->well_vaporized_oil_rates_[w] );
|
well.rates.set( rt::vaporized_oil, this->well_vaporized_oil_rates_[w] );
|
||||||
|
|
||||||
@ -586,11 +593,22 @@ namespace Opm
|
|||||||
const auto rates = this->perfPhaseRates().begin()
|
const auto rates = this->perfPhaseRates().begin()
|
||||||
+ (np * wt.second[ 1 ])
|
+ (np * wt.second[ 1 ])
|
||||||
+ (np * local_comp_index);
|
+ (np * local_comp_index);
|
||||||
++local_comp_index;
|
|
||||||
|
|
||||||
for( int i = 0; i < np; ++i ) {
|
for( int i = 0; i < np; ++i ) {
|
||||||
comp.rates.set( phs[ i ], *(rates + i) );
|
comp.rates.set( phs[ i ], *(rates + i) );
|
||||||
}
|
}
|
||||||
|
if ( pu.has_polymer ) {
|
||||||
|
comp.rates.set( rt::polymer, this->perfRatePolymer()[local_comp_index]);
|
||||||
|
}
|
||||||
|
if ( pu.has_brine ) {
|
||||||
|
comp.rates.set( rt::brine, this->perfRateBrine()[local_comp_index]);
|
||||||
|
}
|
||||||
|
if ( pu.has_solvent ) {
|
||||||
|
comp.rates.set( rt::solvent, this->perfRateSolvent()[local_comp_index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
++local_comp_index;
|
||||||
}
|
}
|
||||||
assert(local_comp_index == this->well_perf_data_[w].size());
|
assert(local_comp_index == this->well_perf_data_[w].size());
|
||||||
|
|
||||||
@ -832,6 +850,15 @@ namespace Opm
|
|||||||
return std::accumulate(&perfRatePolymer_[0] + first_perf_index_[w], &perfRatePolymer_[0] + first_perf_index_[w+1], 0.0);
|
return std::accumulate(&perfRatePolymer_[0] + first_perf_index_[w], &perfRatePolymer_[0] + first_perf_index_[w+1], 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// One rate pr well connection.
|
||||||
|
std::vector<double>& perfRateBrine() { return perfRateBrine_; }
|
||||||
|
const std::vector<double>& perfRateBrine() const { return perfRateBrine_; }
|
||||||
|
|
||||||
|
/// One rate pr well
|
||||||
|
double brineWellRate(const int w) const {
|
||||||
|
return std::accumulate(&perfRateBrine_[0] + first_perf_index_[w], &perfRateBrine_[0] + first_perf_index_[w+1], 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<double>& wellReservoirRates()
|
std::vector<double>& wellReservoirRates()
|
||||||
{
|
{
|
||||||
return well_reservoir_rates_;
|
return well_reservoir_rates_;
|
||||||
@ -1086,6 +1113,7 @@ namespace Opm
|
|||||||
|
|
||||||
// only for output
|
// only for output
|
||||||
std::vector<double> perfRatePolymer_;
|
std::vector<double> perfRatePolymer_;
|
||||||
|
std::vector<double> perfRateBrine_;
|
||||||
|
|
||||||
// it is the throughput of water flow through the perforations
|
// it is the throughput of water flow through the perforations
|
||||||
// it is used as a measure of formation damage around well-bore due to particle deposition
|
// it is used as a measure of formation damage around well-bore due to particle deposition
|
||||||
|
Loading…
Reference in New Issue
Block a user