[LGR] Write complete restart records for local-grid runs - #5246
arturcastiel wants to merge 4 commits into
Conversation
|
jenkins build this please |
|
jenkins build this please |
2 similar comments
|
jenkins build this please |
|
jenkins build this please |
ae27beb to
3230816
Compare
|
jenkins build this please |
|
This PR is doing too much work in my opinion and I'd really appreciate it if it were split into more parts. In particular, I'd like the tracer bits to be a separate, follow-on PR instead of included here. |
I will split into more pieces. |
3230816 to
1ef3359
Compare
|
jenkins build this please |
87e08c6 to
e3607a0
Compare
|
jenkins build this please |
The split is done. This PR is now the six-commit core on current master: The tracer-counting change is out of this PR entirely and will follow as After the rebase we re-ran the full validation set on this head: the |
bska
left a comment
There was a problem hiding this comment.
Thanks a lot for splitting up the original PR. There is still too much happening here, and some of the INTEHEAD values are too obtuse. Unless we need them for restarting our own simulations, I suggest we leave them out for now. If we do need them, then they should be properly documented. The weird 3D array ordering in the restart file should similarly not be added unless it's needed four our own simulation restart or postprocessors like ResInsight.
| // Solution-term count as recomputed by restarting runs: active | ||
| // phases plus two, plus one when a dissolution or vaporisation | ||
| // transfer is active. | ||
| const auto& phasePred = rspec.phases(); | ||
| const int numActivePhases = | ||
| static_cast<int>(phasePred.active(Phase::OIL)) | ||
| + static_cast<int>(phasePred.active(Phase::WATER)) | ||
| + static_cast<int>(phasePred.active(Phase::GAS)); | ||
| const int solutionTermCount = numActivePhases + 2 | ||
| + ((simConfig.hasDISGAS() || simConfig.hasVAPOIL()) ? 1 : 0); |
There was a problem hiding this comment.
We don't this solutionTermCount for our simulation restart so please remove it.
| // fluid-in-place arrays leading the section, or placed after the | ||
| // saturation-pressure terms, is rejected while being read back. | ||
| template <typename OutputVector, typename OutputVectorInt> | ||
| void writeLgrOrderedSolutionVectors(const RestartValue& value, |
There was a problem hiding this comment.
We're not doing this at this point. Please continue to use the existing order for everything.
| InteHEAD& lgrRestartHeaderItems(const bool modelHasLgr, | ||
| const int solutionTermCount); |
There was a problem hiding this comment.
Do we need the lgrRestartHeaderItems() for restarting our own simulations? If not, I'd really prefer that we not define them.
The local-grid overload of getWellTableDims() dimensioned NWMAXZ with the field-wide WELLDIMS item 1 value. NWMAXZ is a per-grid allocation size — the number of wells located in that grid, with a minimum of one — so the local-grid header now carries the local grid's own well count. Co-authored-by: AXON <axon@arturcastiel.github.io>
Write the model-total count of local grid refinements to INTEHEAD item 95 of every grid's header. The item identifies the file as a local-grid restart and was previously left at zero. Co-authored-by: AXON <axon@arturcastiel.github.io>
A local grid's actual-group and maximum-group header items are per-grid quantities: the number of distinct groups of the wells inside that grid, with a minimum of one. The local-grid path copied the field-wide values into all three group items, which coincides on single-group models only. The maximum-wells-per-group item keeps the field-wide capacity. This resolves the long-standing placeholder in the local-grid group accounting, which is removed. Co-authored-by: AXON <axon@arturcastiel.github.io>
Co-authored-by: AXON <axon@arturcastiel.github.io>
|
All three points taken — done:
The branch is now the four-commit core: per-grid |
e3607a0 to
e999392
Compare
|
jenkins build this please |
What this does
Corrects the per-grid header content that OPM flow writes for models with
local grid refinements (
CARFIN): a local grid'sINTEHEADwell- andgroup-allocation items are now per-grid quantities, and the header records
the model's refinement count. Previously these items carried field-wide
values or were left at zero.
As requested in review, the additional header items
(
lgrRestartHeaderItems), the solution-term count, and the local-gridsolution-section resequencing have been removed from this PR. They are not
needed for restarting our own simulations: flow currently rejects
refined-grid restarts at initialization (
FlowProblemBlackoil.hpp), therestart loader reads
INTEHEADexclusively through the named items ofVectorItems/intehead.hpp(none of the removed items had a named entry),and solution arrays are looked up by name, so section order is immaterial
to the loader. With the resequencing gone,
RestartIO.cppis no longertouched by this PR.
The changes
NWMAXZ(CreateInteHead): a local grid'sINTEHEADwell-allocation size is now
max(wells-in-that-grid, 1)instead of thefield-global
WELLDIMS(1)— the slot is a per-grid quantity. Follows thesibling per-grid fix precedent in the same overload.
CreateInteHead): a local grid'sactual-group and maximum-group header items now hold the number of
distinct groups of the wells inside that grid (minimum one), while the
maximum-wells-per-group item keeps the field-wide capacity; the two
conventions coincide on single-group models. This resolves the
long-standing placeholder in the local-grid group accounting.
INTEHEAD[NLGR]: the model-total count of local grid refinements,written to every grid's header. The item identifies the file as a
local-grid restart; it was previously left at zero.
test_HeadersLGRextended with per-gridNWMAXZandNLGRassertions across the existing LGR fixtures.
Scope guarantee
Every addition is gated on the model actually containing local grid
refinements — restart output for non-LGR models is unchanged.
Testing performed
Unit battery on this branch: the header and restart suites
(
test_HeadersLGR,test_InteHEAD,test_Restart,test_RestartLGR,test_RestartFileView) and the full opm-common test suite pass.