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

Compositional well #4334

Merged
merged 8 commits into from
Mar 6, 2025
Merged

Compositional well #4334

merged 8 commits into from
Mar 6, 2025

Conversation

GitPaean
Copy link
Member

@GitPaean GitPaean commented Nov 11, 2024

This PR is providing some necessary elements for the compositional simulation with wells. It mostly including the following elements,

  1. parsing the schedule keywords WINJGAS and WELLSTRE
  2. making PTFlash::solve() can handle arbitrary number of derivatives from the input AD variables.
  3. adding WAMF in the summary keywords

The PR can be reviewed and merged by itself without the downstream PR OPM/opm-simulators#6042 .

@GitPaean
Copy link
Member Author

jenkins build this please

@GitPaean
Copy link
Member Author

jenkins build this please

@GitPaean GitPaean force-pushed the compositional_well branch 4 times, most recently from 11898aa to c1cf35e Compare November 22, 2024 10:11
@GitPaean GitPaean force-pushed the compositional_well branch from 8a1f4cb to a19d35a Compare January 8, 2025 14:53
@GitPaean GitPaean force-pushed the compositional_well branch 3 times, most recently from bd0b26f to f02c801 Compare January 22, 2025 08:53
@GitPaean GitPaean force-pushed the compositional_well branch 2 times, most recently from 59b6cee to 039ae4d Compare February 3, 2025 10:42
@GitPaean GitPaean force-pushed the compositional_well branch 2 times, most recently from f8c5783 to 2308faf Compare February 7, 2025 13:46
@GitPaean GitPaean force-pushed the compositional_well branch 2 times, most recently from 6a87b65 to 17cd947 Compare February 28, 2025 10:32
@GitPaean
Copy link
Member Author

jenkins build this opm-simulators=6042 please

4 similar comments
@GitPaean
Copy link
Member Author

jenkins build this opm-simulators=6042 please

@GitPaean
Copy link
Member Author

jenkins build this opm-simulators=6042 please

@GitPaean
Copy link
Member Author

GitPaean commented Mar 2, 2025

jenkins build this opm-simulators=6042 please

@GitPaean
Copy link
Member Author

GitPaean commented Mar 2, 2025

jenkins build this opm-simulators=6042 please

@GitPaean
Copy link
Member Author

GitPaean commented Mar 5, 2025

jenkins build this please

GitPaean added 2 commits March 6, 2025 09:37

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@GitPaean GitPaean marked this pull request as ready for review March 6, 2025 12:28
@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

jenkins build this please

@GitPaean GitPaean requested review from bska and akva2 March 6, 2025 12:28
Copy link
Member

@akva2 akva2 left a comment

Choose a reason for hiding this comment

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

Just a first pass cosmetics

@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

The failure is due to the following message,

Error: Unrecoverable errors while loading input:
Problem with keyword WINJGAS
In /var/lib/jenkins/workspace/opm-common-PR-builder/deps/opm-tests/co2store/CO2STORE_GASWAT.DATA line 186
The well 'INJ1' is a producer, not an injector, can not be specified with WINJGAS.

@GitPaean GitPaean force-pushed the compositional_well branch 2 times, most recently from 034a284 to 9f2c185 Compare March 6, 2025 12:58
@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

The comments are addressed. and remove some requirement for WINJGAS keyword so the jenkins can pass.

@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

jenkins build this please

@akva2
Copy link
Member

akva2 commented Mar 6, 2025

uhm, are we sure it's not just a broken test case? it seems like a very good sanity check to me even if we have to reorder those files.

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.

When writing new keyword handlers, we generally prefer to use compiled item names instead of string literals. Other than that this looks good to me, with a couple of opportunities to use move() instead of copy.

@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

uhm, are we sure it's not just a broken test case? it seems like a very good safety check to me even if we have to reorder those files.

Basically, the schedule parsing in OPM is in sequential order. We have multiple occasions that some DATA file is parsed by other simulator while rejected by OPM.

The direct issue for this incident is that all the wells are created by default as producers when creating the wells based on WELSPECS,

        Well well(wellName,
                  group,
                  timeStep,
                  0,
                  headI, headJ,
                  ref_depth,
                  WellType(preferredPhase),
WellType::WellType(const Phase phase)
    : WellType { true, phase }
{}

Then we later update whether it is a producer or injector based on WCONP* keywords or WCONJ* keywords.

For the specific DATA file,

the order of the keywords are

WELSPECS
COMPDAT
WINJGAS
WCONINJE

Then it is a decision about whether we want to let this DATA pass.
I am okay to let is pass. If it happens that the well is a producer, then WINJGAS setup is just not used.

I am open with other suggestions also.

@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

When writing new keyword handlers, we generally prefer to use compiled item names instead of string literals. Other than that this looks good to me, with a couple of opportunities to use move() instead of copy.

Thanks for the reviewing comments, will come back to address them later to allow other more urgent issue.

@akva2
Copy link
Member

akva2 commented Mar 6, 2025

yes i understood the problem/point. my question is if we should force sane sequential order. what is the semantics of the input file format? as far as i know, the semantics are sequential where order matters. if this is not actually the case then we indeed have to forgo the sanity check.

@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

I think for the problematic DATA files, the way they specify the things, I mean specifying WINJGAS before making it a injector through WCONINJE.

WELSPECS
COMPDAT
WINJGAS
WCONINJE

we should make OPM can handle it. Otherwise, in the future we might face complaining from the user side and asking the users to modify the DATA file is not always easy.

What we can do (not in this PR), we can have a consistence checking for each report steps when all the relevant keywords are parsed.

For example if happens for one report step, the following situation specification happens,

WELSPECS
COMPDAT
WINJGAS
WCONINJE (with or without this one)
WCONPROD

During the consistence checking, it shows indeed WINJGAS is specified for a producer, we should throw and gives helpful instructions for the users.

GitPaean added a commit to GitPaean/opm-common that referenced this pull request Mar 6, 2025
@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

When writing new keyword handlers, we generally prefer to use compiled item names instead of string literals. Other than that this looks good to me, with a couple of opportunities to use move() instead of copy.

Thanks for the reviewing comments, will come back to address them later to allow other more urgent issue.

I believe I addressed the reviewing comments.

@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

jenkins build this please

@bska
Copy link
Member

bska commented Mar 6, 2025

When writing new keyword handlers, we generally prefer to use compiled item names instead of string literals

I believe I addressed the reviewing comments.

You did for WELLSTRE, but handleWINJGAS() still uses string literals to identify items.

@GitPaean GitPaean force-pushed the compositional_well branch from 356c395 to 204dd4a Compare March 6, 2025 16:18
@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

When writing new keyword handlers, we generally prefer to use compiled item names instead of string literals

I believe I addressed the reviewing comments.

You did for WELLSTRE, but handleWINJGAS() still uses string literals to identify items.

Oh, sorry for missing it. now it should be updated.

@GitPaean
Copy link
Member Author

GitPaean commented Mar 6, 2025

jenkins build this 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.

Thanks a lot for the updates. This looks good to me now and I'll merge into master.

@bska bska merged commit ebcd20e into OPM:master Mar 6, 2025
1 check passed
@GitPaean GitPaean deleted the compositional_well branch March 7, 2025 08:57
wmboon pushed a commit to wmboon/opm-common that referenced this pull request Mar 17, 2025
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.

3 participants