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

Make the TPFA linearizer default for 1/2/3 phase blackoil. #4017

Merged
merged 4 commits into from
Oct 3, 2022

Conversation

atgeirr
Copy link
Member

@atgeirr atgeirr commented Aug 19, 2022

All other use cases still use the traditional linearizer.

@atgeirr
Copy link
Member Author

atgeirr commented Aug 19, 2022

benchmark please

@atgeirr
Copy link
Member Author

atgeirr commented Aug 19, 2022

jenkins build this please

@blattms
Copy link
Member

blattms commented Aug 19, 2022 via email

@ytelses
Copy link

ytelses commented Aug 20, 2022

Benchmark result overview:

Test Configuration Relative
opm-git OPM Benchmark: flow_mpi_extra - Threads: 1 1.081
opm-git OPM Benchmark: flow_mpi_extra - Threads: 8 1.066
opm-git OPM Benchmark: flow_mpi_norne - Threads: 1 1.127
opm-git OPM Benchmark: flow_mpi_norne - Threads: 8 1.135
opm-git OPM Benchmark: flow_mpi_norne_4c_msw - Threads: 1 - FOPT (Total Oil Production At End Of Run) 1
opm-git OPM Benchmark: flow_mpi_norne_4c_msw - Threads: 8 - FOPT (Total Oil Production At End Of Run) 1
  • Speed-up = Total time master / Total time pull request. Above 1.0 is an improvement. *

View result details @ https://www.ytelses.com/opm/?page=result&id=1752

@bska
Copy link
Member

bska commented Aug 20, 2022

A 6% to 8% total time improvement on "extra" is encouraging indeed. We just need to figure out and solve whatever's happening with the regression test failures and then I support merging this into the master branch.

@atgeirr
Copy link
Member Author

atgeirr commented Aug 21, 2022

Is there a reason why only 3-phase?

No, other than requiring me to change more files, so this is more minimal.

@akva2
Copy link
Member

akva2 commented Aug 24, 2022

jenkins build this please

@atgeirr atgeirr force-pushed the make-fast-assembly-default branch from 655917b to 912a934 Compare August 25, 2022 08:34
@atgeirr
Copy link
Member Author

atgeirr commented Aug 25, 2022

jenkins build this please

@atgeirr
Copy link
Member Author

atgeirr commented Sep 1, 2022

The remaining failure is due to boundary conditions. I will add support for boundary conditions to this PR, and also move two-phase to the TpfaLinearizer.

@atgeirr atgeirr force-pushed the make-fast-assembly-default branch from 912a934 to cf902aa Compare September 2, 2022 13:39
@atgeirr atgeirr changed the title Make the TPFA linearizer default for 3 phase blackoil. Make the TPFA linearizer default for 1/2/3 phase blackoil. Sep 2, 2022
@atgeirr
Copy link
Member Author

atgeirr commented Sep 2, 2022

jenkins build this please

This affects the gas/water model, which should not have dissolution,
to be consistent with definitions of FluidState and ScalarFluidState
in the BlackOilIntensiveQuantities class.
@atgeirr atgeirr force-pushed the make-fast-assembly-default branch from 3af3e8a to b9e157e Compare September 30, 2022 09:01
@atgeirr
Copy link
Member Author

atgeirr commented Sep 30, 2022

jenkins build this please

@bska
Copy link
Member

bska commented Sep 30, 2022

Does this new enableDissolution predicate also handle the "humid gas" case (#4034)?

@atgeirr
Copy link
Member Author

atgeirr commented Sep 30, 2022

The DIFFUSE case failed, as expected. Will address by instantiating two simulator variants with diffusion on (using the traditional linearizer) and adding runtime dispatch as for the rest of the variants.

@atgeirr
Copy link
Member Author

atgeirr commented Sep 30, 2022

Does this new enableDissolution predicate also handle the "humid gas" case (#4034)?

I do not know. I looked at the flow_ebos_gaswater_saltprec_vapwat.cpp variant, which I presume sets this up, it looks like it uses the regular two-phase indexes, meaning that the "compositionSwitchIdx" should be invalid as it is a gas/water case. I do not know the details of this variant, so I cannot really tell. There were no new test failures though, so I guess it is fine.

@bska
Copy link
Member

bska commented Sep 30, 2022

Does this new enableDissolution predicate also handle the "humid gas" case (#4034)?

I do not know. [...] There were no new test failures though, so I guess it is fine.

There might not be any regression tests running with humid gas at the moment. @goncalvesmachadoc: Did your team build and/or activate regression tests for this feature? I know there is an in-progress PR (#4111) that creates unit tests for the equilibration facility, but I don't see any currently running regression tests.

This is only instantiated for two-phase gas/oil and for 3-phase blackoil.
Runtime safeguards have been added to avoid the mistake of running with
a simulator combination that silently ignores DIFFUSE.
@atgeirr
Copy link
Member Author

atgeirr commented Sep 30, 2022

jenkins build this please

@bska
Copy link
Member

bska commented Sep 30, 2022

jenkins build this serial please

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good for to me. I only had one remark concerning making the FlowMainEbosType public. At least superficially, that seems unrelated to this work.

@@ -236,6 +235,7 @@ class Main
return exitCode;
}

using FlowMainEbosType = FlowMainEbos<Properties::TTag::EclFlowProblem>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably blind, but I didn't see any of the new code using this type. Is there a reason it has to become public?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initFlowEbosBlackoil() method is public, and returns a unique_ptr to this type (see just below these lines), so I think it should be defined publicly, and defined here just before the function that refers to it.

At first, I assumed I must change this type (and to get the fast assembly supported from the python interface I suppose we must), but realized that was not really necessary, that it was only used within the method discussed. I decided to make the minor improvement still, although not really required here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any of the new code using this type.

The initFlowEbosBlackoil() method is public, and returns a unique_ptr<> to this type (see just below these lines),

Okay, so this was indeed an unrelated change.

I think it should be defined publicly, and defined here just before the function that refers to it.

That's fine. It just stood out to me as something curious about the PR.

@goncalvesmachadoc
Copy link
Contributor

Does this new enableDissolution predicate also handle the "humid gas" case (#4034)?

I do not know. [...] There were no new test failures though, so I guess it is fine.

There might not be any regression tests running with humid gas at the moment. @goncalvesmachadoc: Did your team build and/or activate regression tests for this feature? I know there is an in-progress PR (#4111) that creates unit tests for the equilibration facility, but I don't see any currently running regression tests.

There are only one test for two-phase (gas-water) humid gas case. We haven't added a wet-humid (three-phase) test case yet since we were facing some convergence issues. I finished the unit tests that covers the 3-phase case. Will go ahead and push a running 3-phase test case for DISGAS + VAPWAT + VAPOIL regression test.

@goncalvesmachadoc
Copy link
Contributor

Does this new enableDissolution predicate also handle the "humid gas" case (#4034)?

I do not know. I looked at the flow_ebos_gaswater_saltprec_vapwat.cpp variant, which I presume sets this up, it looks like it uses the regular two-phase indexes, meaning that the "compositionSwitchIdx" should be invalid as it is a gas/water case. I do not know the details of this variant, so I cannot really tell. There were no new test failures though, so I guess it is fine.

There is also flow_ebos_brine_precsalt_vapwat.cpp that we are using for modelling water evaporation + precipitation in condensate gas reservoirs (compositionSwitchIdx valid).

@atgeirr
Copy link
Member Author

atgeirr commented Oct 3, 2022

The effect of the enableDissolution flag is to enable Rs and Rv storage in the fluid state. I think this should correspond to the presence of a valid compositionSwitchIdx variable index, as done here.

The fix to make the fluid states consistent should be made anyway, and is not directly related to the main part of this PR (but the problem was discovered due to it). If simulators no longer give correct results with evaporation etc., we should discuss why and fix it, but I am inclined to think that in that case it is the simulator setups that are wrong, not the code changed here.

I think this PR should be merged now, and any necessary fixes for the humid gas etc. made afterwards in a separate PR.

@atgeirr
Copy link
Member Author

atgeirr commented Oct 3, 2022

Merging now. @goncalvesmachadoc please test if this breaks your humid gas case. If so, I will help you get it back to working order in time for the upcoming release.

@atgeirr atgeirr merged commit dacb774 into OPM:master Oct 3, 2022
@atgeirr atgeirr deleted the make-fast-assembly-default branch October 3, 2022 11:55
@goncalvesmachadoc
Copy link
Contributor

Merging now. @goncalvesmachadoc please test if this breaks your humid gas case. If so, I will help you get it back to working order in time for the upcoming release.

Hi Atgeirr, thanks for checking with us. This PR did not affect the humid-wet gas case (flow_brine_precsalt_vapwat module).

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.

6 participants