Commit Graph

12510 Commits

Author SHA1 Message Date
Arne Morten Kvarving
faa963056d Parameters::printParamUsage can now be an implementation detail 2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
77dc5ad895 Parameters::getFlattenedKeyList can now be an implementation detail 2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
410039206d add Parameters::Parameter struct
this holds a key-value pair for a parameter with some utility functions
for comparison and printing.

use this to move Parameters::getLists to the translation unit
2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
ae8dd62fe3 Parameters::Get split out parts of implementation
allows putting it in translation unit
2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
cfad87b41f ParameterSystem: remove ParamFinalizer
this adds no extra validation and complicates refactoring
2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
65158cd3fb Parameters::SetDefault split out parts of implementation
allows putting it in translation unit
2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
741e97da61 Parameters::IsSet split out parts of implementation
allows putting it in translation unit
2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
98b33d582f Parameters::Register split out parts of implementation
allows putting it in translation unit
2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
48bcf6ac04 Parameters::Hide split out main implementation
allows putting it in translation unit
2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
7584f588a7 parametersystem: parseKey/transformKey can now be implementation details 2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
427b619ca5 parametersystem: use a std::function instead of template parameter for callback
allows putting implementation in translation unit and this is hardly
performance critical
2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
bc83bb6e1c parametersystem: introduce translation unit 2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
05f01bf819 parametersystem.hh: rename to .hpp 2024-09-05 10:07:40 +02:00
Arne Morten Kvarving
2bdab9e518 parametersystem: pass add callback for adding keys to positional parameter handler
this way the backing store for the parameters can be an implementation
detail of the parameter system
2024-09-05 10:07:40 +02:00
Bård Skaflestad
329ad50e59 Don't Count Cells Unless Needed
If the user chooses a specific number of NLDD domains, there is no
need to compute the default number of domains based on a specific
target number of cells per domain.  Defer the, potentially costly,
calculation to when we know we need it.

While here, also split/rejoin a couple of long lines.
2024-09-05 09:45:16 +02:00
Bård Skaflestad
be64ef3ef6 Add Water Phase Saturation Function Consistency Checks
This commit introduces a set of consistency checks for the water
phase saturation functions.  These plug into the framework
introduced in commit c3939c544 (PR #5438).  We implement the
following three checks

  - 0 <= SWL < 1
  - 0 < SWU <= 1
  - SWL <= SWCR < SWU

which collectively enable a non-negative oil saturation in the two
phase oil/water system.
2024-09-04 13:47:33 +02:00
Arne Morten Kvarving
f4801ec787
Merge pull request #5576 from akva2/fix_build_no_float_no_mpi
Fix build without float simulators
2024-09-04 13:45:42 +02:00
Bård Skaflestad
d69d929d37
Merge pull request #5571 from bska/gphase-sfunc-consistency-checks-impl
Add Gas Phase Saturation Function Consistency Checks
2024-09-04 13:02:25 +02:00
Arne Morten Kvarving
d36fefd428 fixed: build without MPI 2024-09-04 12:51:05 +02:00
Arne Morten Kvarving
c4871367e8 fixed: building without float simulators
pointy hat is all mine
2024-09-04 12:51:05 +02:00
Arne Morten Kvarving
f838cb6ecf timer: introduce translation unit 2024-09-04 12:06:52 +02:00
Arne Morten Kvarving
b3e08b4f2f timer.hh: rename to timer.hpp 2024-09-04 12:06:35 +02:00
Arne Morten Kvarving
13b575eae9 tasklets: introduce translation unit 2024-09-04 12:06:21 +02:00
Arne Morten Kvarving
d35d80427e tasklets.hh: rename to tasklets.hpp 2024-09-04 12:06:21 +02:00
Arne Morten Kvarving
27f9277c47 mpiutil: add translation unit 2024-09-04 12:06:21 +02:00
Arne Morten Kvarving
fcd0168691 mpiutil.hh: rename to mpiutil.hpp 2024-09-04 12:06:21 +02:00
Arne Morten Kvarving
e7a9c4cd21 threadmanager: remove unused typetag template parameter
and move implementation to a translation unit
2024-09-04 12:06:21 +02:00
Bård Skaflestad
9c246faefa Add Gas Phase Saturation Function Consistency Checks
This commit introduces a set of consistency checks for the gas phase
saturation functions.  These plug into the framework introduced in
commit c3939c544 (PR #5438).  We implement the following three checks

  - 0 <= SGL < 1
  - 0 <= SGU < 1
  - SGL <= SGCR < SGU

which collectively enable a non-negative oil saturation in the two
phase gas/oil system.
2024-09-04 11:34:39 +02:00
Arne Morten Kvarving
3ee5eddf48 threadmanager.hh: rename to threadmanager.hpp 2024-09-04 11:32:21 +02:00
Arne Morten Kvarving
55a0a6da54 blackoilsolventparams: introduce translation unit
move code for loading parameters from eclipse state into it
2024-09-04 11:17:40 +02:00
Arne Morten Kvarving
6ceeb3098e blackoilsolventparams.hh: rename to blackoilsolventparams.hpp 2024-09-04 11:17:40 +02:00
Arne Morten Kvarving
3aed1aa7f9 blackoilpolymerparams: introduce translation unit
move code for loading parameters from eclipse state into it
2024-09-04 11:17:40 +02:00
Arne Morten Kvarving
85cc5ffa5f blackoilpolymerparams.hh: rename to blackoilpolymerparams.hpp 2024-09-04 09:21:09 +02:00
Arne Morten Kvarving
5a567de3e2 blackoilmicpparams: introduce translation unit
move code for loading parameters from eclipse state into it
2024-09-04 09:17:26 +02:00
Arne Morten Kvarving
e1453e5a48 blackoilmicpparams.hh: rename to blackoilmicpparams.hpp 2024-09-04 09:16:34 +02:00
Arne Morten Kvarving
f6d3893093 blackoilfoamparams: introduce translation unit
move code for loading parameters from eclipse state into it
2024-09-04 09:13:02 +02:00
Arne Morten Kvarving
6bb6e3db43 blackoilfoamparams.hh: rename to blackoilfoamparams.hpp 2024-09-04 09:11:58 +02:00
Arne Morten Kvarving
a04d9fdd00 blackoilextboparams: introduce translation unit
move code for loading parameters from eclipse state into it
2024-09-04 09:08:12 +02:00
Arne Morten Kvarving
9fd99ab232 blackoilexboparams.hh: rename to blackoilextboparams.hpp 2024-09-04 09:06:59 +02:00
Arne Morten Kvarving
a51e13c244 blackoilbrineparams: introduce translation unit
move code for loading parameters from eclipse state into it
2024-09-04 09:02:17 +02:00
Arne Morten Kvarving
99d64ff7ec blackoilbrineparams.hh: rename to blackoilbrineparams.hpp 2024-09-04 09:00:02 +02:00
Bård Skaflestad
2e70fc407e Add Oil Phase Saturation Function Consistency Checks
This commit introduces a set of consistency checks for the oil phase
saturation functions.  These plug into the framework introduced in
commit c3939c544 (PR #5438).  We implement the following four checks
for the gas/oil two-phase system

  - 0 <= SOGCR < 1
  - SWL + SGU <= 1
  - SOGCR < 1 - SWL - SGL
  - SOGCR < 1 - SWL - SGCR

which all guarantee a non-negative (mobile) oil saturation in the
gas/oil system.  Similarly, we implement the following four checks
for the oil/water two-phase system

  - 0 <= SOWCR < 1
  - SGL + SWU <= 1
  - SOWCR < 1 - SWL - SGL
  - SOWCR < 1 - SWCR - SGL

which provide the same guarantees as outlined above, but for the
oil/water system.

We add a base class, PhaseCheckBase<Scalar>, which provides a common
representation of the violated/critical predicates and implement the
specific checks as derived types of this base class.
2024-09-03 12:35:44 +02:00
Arne Morten Kvarving
bc46647aa5 Import opm-models 2024-09-02 10:55:19 +02:00
Bård Skaflestad
f5aeffc8f5 Merge pull request #896 from akva2/floats
Add necessary changes to build float simulators
2024-08-30 15:28:34 +02:00
Bård Skaflestad
a73cb6ee93 Fix DRVDT Initialisation Conditional
It does not make sense to pass

    episodeIdx && maxDRv_.empty()

as an argument to drvdtActive().
2024-08-30 15:16:46 +02:00
Atgeirr Flø Rasmussen
58ce7cbc7c
Merge pull request #5556 from akva2/float_support5
Float support in simulators: Batch 5
2024-08-30 15:06:35 +02:00
Atgeirr Flø Rasmussen
9dd54fb11a Avoid capturing structured bindings.
This is an error before C++20, and clang refuses it.
2024-08-30 13:17:07 +02:00
Kai Bao
f47d00c9d7
Merge pull request #5236 from hnil/no_early_exit_zero_flux
Avoid deleting derivative i.e. getting "wrong" matrix in case of zero…
2024-08-29 14:46:09 +02:00
Kai Bao
818f8b9ee3 Merge pull request #877 from hnil/no_early_exit_zero_flux
Avoid deleting derivatives with zero pressure difference
2024-08-29 14:46:00 +02:00
Vegard Kippe
eb869f211f Avoid time step dependent jump in RS after restart 2024-08-28 16:28:51 +02:00
Vegard Kippe
0b6dd93903 Avoid negative time step size after restart (trouble for DRSDT init) 2024-08-28 15:04:15 +02:00
Vegard Kippe
0485bfb47f Set correct episode before initial call to invalidateAndUpdateIntensiveQuantities 2024-08-28 15:04:15 +02:00
Vegard Kippe
8f45cbe4c4 Properly initialize mixing controls after restart. 2024-08-28 15:04:15 +02:00
Vegard Kippe
cc08df226e Update after merging #5527 2024-08-28 15:04:15 +02:00
Bård Skaflestad
9dca8256f3 Split Request Writing Into Stages
This commit introduces helper functions for each individual part of
a convergence report record in the INFOITER file.  In particular, we
create helpers for

  - Time related columns (report step, time step, time &c)
  - CNV pore-volume histogram columns
  - Reservoir convergence metrics (CNV and MB values per phase)
  - Well convergence metrics

This makes the body of the main loop in writeConvergenceRequest()
slightly easier to read and means that we can apply some additional
logic to the CNV pore-volume histograms if the number of values does
not match the expected 3 per type.  In that case we output sentinel
values (e.g., NaN and -1) to signify that the corresponding pieces
of information are unavailable.
2024-08-27 10:50:06 +02:00
Bård Skaflestad
0b40277e01 Revise Convergence Report Collection Procedure
This commit switches the parallel implemenation of function
Opm::gatherConvergenceReport() into using the general serialisation
framework (classes Opm::Serializer<> and Opm::Mpi::Packer).  In
particular, we add serializeOp() functions to each of the types

  - ConvergenceReport
  - ConvergenceReport::ReservoirFailure
  - ConvergenceReport::ReservoirConvergenceMetric
  - ConvergenceReport::WellFailure

and defer the job of converting the objects between in-memory and
byte stream representations to Opm::Serializer<>.  The new special
purpose class CollectConvReports inherits from the latter and uses
its pack() and unpack() member functions, along with its internal
m_buffer data member, to distribute each rank's convergence report
object to all ranks.  We add this feature here, in a very narrowly
scoped use case, to enable testing and experimentation before we
consider adding this distribution mechanism as a general feature in
Opm::MpiSerializer.
2024-08-27 10:50:06 +02:00
Bård Skaflestad
68cc5d917e Output CNV Histogram to INFOITER File
This commit tracks the number of cells and their associate fraction
of the model's "eligible" pore volume (total pore volume in
numerical aquifers subtracted from the model's total pore volume) in
three distinct categories as a function of the non-linear iteration
number:

  - 0: MAX_p { CNV_p } <= strict CNV tolerance
  - 1: MAX_p { CNV_p } \in (strict, relaxed]
  - 2: MAX_p { CNV_p } > relaxed CNV tolerance

We then output these cell counts and pore volume fractions as new
items in the INFOITER file to enable more targeted analysis of the
non-linear convergence behaviour.

To this end, introduce a type alias CnvPvSplit in the
ConvergenceReport and aggregate these across the MPI ranks before we
collect them in the ConvergenceReport objects.

While here, also reduce the amount of repeated logic in
gatherConvergenceReport.cpp through a few local lambdas.
2024-08-27 10:50:06 +02:00
Bård Skaflestad
359e4903d5
Merge pull request #5561 from akva2/janitoring
amgcpr: use override
2024-08-27 09:18:04 +02:00
Arne Morten Kvarving
021d6c2b0c amgcpr: use override 2024-08-27 06:43:00 +02:00
Kjetil Olsen Lye
f97389d1b5
Merge pull request #5554 from multitalentloes/refactor_cuistl
refactor cuistl to gpuistl
2024-08-26 09:55:13 +02:00
Atgeirr Flø Rasmussen
2e15a04db5
Merge pull request #5557 from atgeirr/avoid-cprw-incompatibilities
Intercept CPRW if MICP or polymer injectivity is used.
2024-08-26 09:50:57 +02:00
Markus Blatt
7ebb6e7034
Merge pull request #5547 from lisajulia/feature/action-parsing-strictness
Add action-parsing-strictness command line parameter
2024-08-26 09:06:25 +02:00
Arne Morten Kvarving
4af89f1ced ISTLSolverBda: avoid using deprecated Dune::CollectiveCommunication 2024-08-23 15:10:25 +02:00
Tobias Meyer Andersen
d14fed904a fix typo 2024-08-23 14:42:37 +02:00
Atgeirr Flø Rasmussen
9ccb67ead6 Intercept CPRW if MICP or polymer injectivity is used.
These modeling options are currently incompatible with our CPRW implementation.
2024-08-23 13:08:08 +02:00
Tobias Meyer Andersen
d925d62bf2 refactor cusparsematrixoperations 2024-08-23 11:15:18 +02:00
Arne Morten Kvarving
b5bd290887 BlackoilModel: use appropriate Scalar type 2024-08-23 11:15:03 +02:00
Arne Morten Kvarving
fda7298374 FlowGenericVanguard: optionally instantiate for float 2024-08-23 11:15:03 +02:00
Arne Morten Kvarving
bca05f8f7b ISTLSolverBda: optionally instantiate for float 2024-08-23 11:15:03 +02:00
Arne Morten Kvarving
4d08afd480 BdaBridge: optionally instantiate for float 2024-08-23 11:15:03 +02:00
Arne Morten Kvarving
ecb2cafdd3 rocsparseSolverBackend: optionally instantiate for float 2024-08-23 11:15:03 +02:00
Arne Morten Kvarving
346ba93b66 rocsparsePreconditioner: optionally instantiate for float
rocsparseBILU0: optionally instantiate for float
rocsparseCPR: optionally instantiate for float
2024-08-23 11:15:03 +02:00
Arne Morten Kvarving
3ff678b58a rocsparseCPR: add support for float Scalars 2024-08-23 11:15:03 +02:00
Tobias Meyer Andersen
d2681b26ed refactor opm_cuda_safe_call 2024-08-23 11:12:13 +02:00
Arne Morten Kvarving
61abbc2de9 consistently use Scalar type 2024-08-23 11:04:20 +02:00
Arne Morten Kvarving
43fafc1ada BlackoilMICPModules: fix field prop copy if Scalar is float 2024-08-23 11:04:20 +02:00
Arne Morten Kvarving
6bcdad6ceb rocsparseBILU0: add support for float Scalars 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
644aeb582f rocsparseSolverBackend: add support for float Scalars 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
452a0a0baa rocalutionSolverBackend: optionally instantiate for float 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
c5ddec57d8 rocsparseMatrix: optionally instantiate for float 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
ecc62bbf19 HipKernels: optionally instantiate for float 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
cdad4500c1 amgclSolverBackend: disable for float scalar
for reasons deep down in amgcl, it does not compile. for now
just disable it
2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
7a3a79c11b openclSolverBackend: optionally instantiate for float 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
a0f8cc0aed Preconditioner: optionally instantiate for float
BILU0: optionally instantiate for float
BISAI: optionally instantiate for float
CPR: optionally instantiate for float
CPRCreation: optionally instantiate for float
Misc: optionally instantiate for float
2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
5bab71b8e3 OpenclMatrix: optionally instantiate for float 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
36c544e204 BlockedMatrix: optionally instantiate for float 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
da2a894090 CPR: disable with float Scalars 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
5825612a75 cusparseSolverBackend: optionally instantiate for float 2024-08-23 11:02:23 +02:00
Arne Morten Kvarving
35fb78ea9a cusparseSolverBackend: add float Scalar support 2024-08-23 11:02:23 +02:00
Bård Skaflestad
3dbeed2199
Merge pull request #5550 from akva2/float_support3
Float support in simulators: Batch 3
2024-08-23 10:29:14 +02:00
Tobias Meyer Andersen
85a9ad2b61 refactor cuistl folder names 2024-08-22 15:32:21 +02:00
Tobias Meyer Andersen
5919b417e3 refactor cuview 2024-08-22 15:27:23 +02:00
Tobias Meyer Andersen
fba1858f42 refactor cuvector 2024-08-22 15:20:20 +02:00
Tobias Meyer Andersen
3aa1767548 refactor cusparsematrix 2024-08-22 15:14:33 +02:00
Tobias Meyer Andersen
0c1ea3ee4d refactor cuseqilu0 2024-08-22 15:07:53 +02:00
Bård Skaflestad
93c368cbfa Revise Mixture Density Method for No-Flow Producers
This commit switches the approach introduced in commit eeb1b7e36 (PR
#3169) to using a mobility weighted average of cell level densities
for the connection level mixture densities in no-flow producing
wells.  We also use the recent stoppedOrZeroRateTarget() predicate
to identify those no-flow producing wells instead of inspecting the
connection flow rates.

The mobility weighted average gives a more monotone pressure buildup
for the stopped wells and this is usually what the engineer wants.
This revised approach furthermore needs fewer cell-level dynamic
properties so simplify the computeProperties() signature by
introducing a structure for the property callback functions and
update the callers accordingly.
2024-08-22 14:51:00 +02:00
Bård Skaflestad
586d8e2ddc Generate Property Object Directly
This commit switches computePropertiesForPressures() to return a
Properties object directly instead of populating an object
constructed in the caller.  There is just a single call site for
this function so there's no benefit to using an out parameter here.
While here, also collect the property callbacks into a structure to
simplify the function signature.  This also enables not filling in
the solvent properties unless solvent is active in the run.  Update
caller accordingly.
2024-08-22 14:51:00 +02:00
Bård Skaflestad
6f2ee80e41 Refactor Perforation Pressure Property Helper Function
In particular, split the sections of the main loop out to helper
functions

  - calculatePerforationOutflow() uses the global container factory
    to compute the outflow from each connection
  - initialiseConnectionMixture() computes the 'mix' array depending
    on the local flowing conditions of the connection.  We have
    renamed 'x' and 'mix' arrays to 'currentMixture' and
    'previousMixture' respectively to give more descriptive names in
    the process.

We've also split out the redistribution of the individual phases to
the new private helper functions reapportionGasOilMixture() and
reapportionGasWaterMixture() in order to reduce the cognitive load
of the main loop in computePropertiesForPressures().  While here,
employ pointer arithmetic to expose the underlying structure of the
assignment expressions.
2024-08-22 14:51:00 +02:00
Bård Skaflestad
fa199461b5 Varnish Parts of Well Implementation
In particular

  * Split some long lines
  * Reverse conditions to reduce nesting
  * Mark potentially unused arguments as [[maybe_unused]]
  * Try to remove redundant calculations
  * Mark some objets 'const' where possible
2024-08-22 14:51:00 +02:00
Tobias Meyer Andersen
1721a1071f refactor cuowneroverlapcopy 2024-08-22 14:46:38 +02:00