mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #5005 from totto82/fixWDFACCOR
dont scale d factor from wdfaccor with connection factor
This commit is contained in:
commit
8dca5a931e
@ -447,7 +447,7 @@ protected:
|
|||||||
double* connII,
|
double* connII,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
double computeConnectionDFactor(const int perf, const IntensiveQuantities& intQuants, const double trans_mult, const double total_tw, const SingleWellState& ws) const;
|
double computeConnectionDFactor(const int perf, const IntensiveQuantities& intQuants, const SingleWellState& ws) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1341,16 +1341,11 @@ namespace Opm
|
|||||||
if (this->well_index_[perf] == 0)
|
if (this->well_index_[perf] == 0)
|
||||||
return std::vector<Scalar>(this->num_components_, 0.0);
|
return std::vector<Scalar>(this->num_components_, 0.0);
|
||||||
|
|
||||||
double tot_tw = 0.0;
|
double d = computeConnectionDFactor(perf, intQuants, ws);
|
||||||
for (const auto& c : this->well_ecl_.getConnections()) {
|
|
||||||
tot_tw += c.CF();
|
|
||||||
}
|
|
||||||
|
|
||||||
double d = computeConnectionDFactor(perf, intQuants, trans_mult, tot_tw, ws);
|
|
||||||
const PhaseUsage& pu = this->phaseUsage();
|
const PhaseUsage& pu = this->phaseUsage();
|
||||||
double Q = std::abs(ws.perf_data.phase_rates[perf*pu.num_phases + pu.phase_pos[Gas]]);
|
double Q = std::abs(ws.perf_data.phase_rates[perf*pu.num_phases + pu.phase_pos[Gas]]);
|
||||||
const auto& connection = this->well_ecl_.getConnections()[ws.perf_data.ecl_index[perf]];
|
const auto& connection = this->well_ecl_.getConnections()[ws.perf_data.ecl_index[perf]];
|
||||||
double Kh = connection.Kh()* trans_mult;
|
double Kh = connection.Kh();
|
||||||
double scaling = 3.141592653589 * Kh;
|
double scaling = 3.141592653589 * Kh;
|
||||||
const unsigned gas_comp_idx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
const unsigned gas_comp_idx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
||||||
wi[gas_comp_idx] = 1.0/(1.0/(trans_mult * this->well_index_[perf]) + (Q/2 * d / scaling));
|
wi[gas_comp_idx] = 1.0/(1.0/(trans_mult * this->well_index_[perf]) + (Q/2 * d / scaling));
|
||||||
@ -1367,22 +1362,17 @@ namespace Opm
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto& perf_data = ws.perf_data;
|
auto& perf_data = ws.perf_data;
|
||||||
double tot_tw = 0.0;
|
|
||||||
for (const auto& c : this->well_ecl_.getConnections()) {
|
|
||||||
tot_tw += c.CF();
|
|
||||||
}
|
|
||||||
for (int perf = 0; perf < this->number_of_perforations_; ++perf) {
|
for (int perf = 0; perf < this->number_of_perforations_; ++perf) {
|
||||||
const int cell_idx = this->well_cells_[perf];
|
const int cell_idx = this->well_cells_[perf];
|
||||||
const auto& intQuants = simulator.model().intensiveQuantities(cell_idx, /*timeIdx=*/ 0);
|
const auto& intQuants = simulator.model().intensiveQuantities(cell_idx, /*timeIdx=*/ 0);
|
||||||
const double trans_mult = simulator.problem().template rockCompTransMultiplier<double>(intQuants, cell_idx);
|
perf_data.connection_d_factor[perf] = computeConnectionDFactor(perf, intQuants, ws);
|
||||||
perf_data.connection_d_factor[perf] = computeConnectionDFactor(perf, intQuants, trans_mult, tot_tw, ws);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename TypeTag>
|
template <typename TypeTag>
|
||||||
double
|
double
|
||||||
WellInterface<TypeTag>::
|
WellInterface<TypeTag>::
|
||||||
computeConnectionDFactor(const int perf, const IntensiveQuantities& intQuants, const double trans_mult, const double total_tw, const SingleWellState& ws) const {
|
computeConnectionDFactor(const int perf, const IntensiveQuantities& intQuants, const SingleWellState& ws) const {
|
||||||
const double connection_pressure = ws.perf_data.pressure[perf];
|
const double connection_pressure = ws.perf_data.pressure[perf];
|
||||||
// viscosity is evaluated at connection pressure
|
// viscosity is evaluated at connection pressure
|
||||||
const auto& rv = getValue(intQuants.fluidState().Rv());
|
const auto& rv = getValue(intQuants.fluidState().Rv());
|
||||||
@ -1393,24 +1383,8 @@ namespace Opm
|
|||||||
double rho = FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, this->pvtRegionIdx());
|
double rho = FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, this->pvtRegionIdx());
|
||||||
const double phi = getValue(intQuants.porosity());
|
const double phi = getValue(intQuants.porosity());
|
||||||
const auto& connection = this->well_ecl_.getConnections()[ws.perf_data.ecl_index[perf]];
|
const auto& connection = this->well_ecl_.getConnections()[ws.perf_data.ecl_index[perf]];
|
||||||
double Kh = connection.Kh()* trans_mult;
|
|
||||||
double Ke = connection.Ke()* trans_mult;
|
|
||||||
double h = Kh / Ke;
|
|
||||||
double rw = connection.rw();
|
|
||||||
const auto& wdfac = this->well_ecl_.getWDFAC();
|
const auto& wdfac = this->well_ecl_.getWDFAC();
|
||||||
if (wdfac.useConnectionDFactor()) {
|
return wdfac.getDFactor(connection, mu, rho, phi);
|
||||||
double d = connection.dFactor();
|
|
||||||
// If a negative d factor is set in COMPDAT individual connection d factors should be used directly.
|
|
||||||
if (d < 0)
|
|
||||||
return -d;
|
|
||||||
// If a positive d factor is set in COMPDAT the connection d factors is treated like a well d factor.
|
|
||||||
// and thus scaled with the well index
|
|
||||||
return d * total_tw / connection.CF();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
double d = wdfac.getDFactor(rho, mu, Ke, phi, rw, h);
|
|
||||||
return d * total_tw / connection.CF();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user