Skip to content
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

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

totto82
Copy link
Member

@totto82 totto82 commented Jul 29, 2024

Depends on OPM/opm-common#4152
See description there.

Copy link
Member

@GitPaean GitPaean left a 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()) {
Copy link
Member

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?

Copy link
Member Author

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.

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;
Copy link
Member

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 =
Copy link
Member

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,
Copy link
Member

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.

jenkins4opm pushed a commit to jenkins4opm/opm-tests that referenced this pull request Aug 1, 2024
        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
@totto82 totto82 merged commit 5d19739 into OPM:master Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants