-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cell temperature in perforated cell to compute reservoir rates #5490
Conversation
217e642
to
1e288cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks reasonable. I only have a few details nitpicking. Otherwise, it looks it does what it is supposed to do.
{ | ||
const int np = this->number_of_phases_; | ||
const auto& pu = this->phaseUsage(); | ||
// Calculate reservoir rates from average pressure and temperature | ||
if ( !pu.has_energy || this->wellEcl().isProducer()) { | ||
if ( !(co2store || pu.has_energy) || this->wellEcl().isProducer()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a question here, the code change here mostly alters the situation that CO2STORE
is active, while the pu.has_enery=false
.
With the change in the PR, when CO2STORE is active, we always use the well bhp and temperature
in the function below.
The question is, do we always have an meaningful temperature calculated/set with CO2STORE
option ON and has_enery==false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If well temperature is not set, we use the temperature in the top cell as default.
opm/simulators/wells/WellState.cpp
Outdated
const std::vector<PerforationData<Scalar>>& well_perf_data, | ||
const SummaryState& summary_state) | ||
{ | ||
const auto& pu = this->phase_usage_; | ||
const Scalar temp = well.temperature(); | ||
|
||
Scalar temp = temperature_first_connection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small improvement here,
const Scalar temp = well.hasTemperature() ? well.temperature() : temperature_first_connection;
@@ -158,6 +158,10 @@ namespace { | |||
std::vector<double>(setup.grid.c_grid()->number_of_cells, | |||
100.0*Opm::unit::barsa); | |||
|
|||
const auto ctemp = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although the code above uses Opm::unit::barsa
, while for new code, I suggest something as follows,
const auto& unit_sytem = setup.es.getDeckUnitSystem();
const double temp = unit_sytem.to_si(Opm::UnitSystem::measure::temperature, 25); // 25C
|
||
if (well.isInjector()) { | ||
this->initSingleInjector(well, well_info, pressure_first_connection, | ||
this->initSingleInjector(well, well_info, pressure_first_connection, temperature_first_connection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temperature related should go to the bracket within if condition if (well.isInjector())
? mostly to avoid the extra broadcast.
1e288cd
to
27f14cd
Compare
27f14cd
to
f678c08
Compare
PR OPM/opm-simulators#5490 Reason: PR OPM/opm-common#4152 PR OPM/opm-simulators#5490 opm-common = 809945dcc65b087bf30046619d0114a4a0a28329 opm-grid = 05ef9cc1e8cc32888770cb0f7d73684cec275d42 opm-models = a0c0c37f15442507165435097718dc47a7710d1f opm-simulators = 809945dcc65b087bf30046619d0114a4a0a28329 ### Changed Tests ### * co2store * co2store_gw * co2store_gw_dirichlet * co2store_gaswat * co2store_diffusive * co2store_drsdtcon
Depends on OPM/opm-common#4152
See description there.