Commit Graph

2305 Commits

Author SHA1 Message Date
Atgeirr Flø Rasmussen
c10e28478f Fix bug in distance derivative function. 2014-12-29 12:28:29 +01:00
Atgeirr Flø Rasmussen
86655f1962 Work in progress. 2014-12-29 12:28:29 +01:00
Atgeirr Flø Rasmussen
1ddb0abc89 Initial versions of compute functions done.
Still has bugs.
2014-12-29 12:28:29 +01:00
Atgeirr Flø Rasmussen
89b4ecb193 Solver logic finished.
Methods isClose(), computeFromTri() and computeFromLine() are still dummies.
2014-12-29 12:28:29 +01:00
Atgeirr Flø Rasmussen
c0fbb8ea03 Work in progress on AnisotropicEikonal. 2014-12-29 12:28:29 +01:00
Atgeirr Flø Rasmussen
3997d1c462 Added simple test, work in progress. 2014-12-29 12:28:29 +01:00
Atgeirr Flø Rasmussen
1f79502f10 Add skeleton of AnisotropicEikonal class and test. 2014-12-29 12:28:29 +01:00
Atgeirr Flø Rasmussen
060a2fea0f Merge pull request #702 from jorgekva/linsolver_petsc
PETSc support in OPM
2014-12-19 11:25:58 +01:00
Jørgen Kvalsvik
31fbb2f58d Sets initial guess to zero.
Setting it to nonzero means starting to approximate from memory garbage values.
2014-12-10 18:15:33 +01:00
Jørgen Kvalsvik
ed18b283f1 Adds missing VecCreate. 2014-12-10 18:15:13 +01:00
Jørgen Kvalsvik
e2e6299ee6 Adds missing preconditoner destruction. 2014-12-10 18:09:13 +01:00
Jørgen Kvalsvik
33c7b48d06 Renamed variables to match Ax = b 2014-12-10 18:09:01 +01:00
Jørgen Kvalsvik
ef59c5afdb Vector construction is now value oriented.
No longer initialised and constructed in two places.
2014-12-10 18:07:45 +01:00
Jørgen Kvalsvik
2db194aca6 Removes unecessary whitespace. 2014-12-10 18:06:28 +01:00
Jørgen Kvalsvik
c6f42a63bd Fixes performance bug in matrix construction.
At the same time changes the construction to be value-oriented, not
constructing it in OEM_DATA, but rather in to_petsc_mat
2014-12-10 18:05:04 +01:00
Joakim Hove
2b9b09865c Revert signature of writeECLData() 2014-12-08 15:21:56 +01:00
chflo
29dd303eaa OPM-139: Minor changes after review 2014-12-08 12:04:07 +01:00
chflo
0f97f947e6 OPM-139: Cleaned out compiler warnings 2014-12-08 12:04:07 +01:00
chflo
950ec4a67e OPM-139: Changes due to signature change in ert library 2014-12-08 12:04:06 +01:00
chflo
d6d5d8db71 OPM-139: Extended EclipseWriter to write wellinfo to eclipse restart files 2014-12-08 12:04:06 +01:00
Robert K
488c9ca7ff remove unused restrictToActive method and rewrite the other one to cover both, restrict
and reorder.
2014-12-08 11:24:57 +01:00
Robert K
d504007030 EclipseWriter: fix docu of convertToEclipseOrder function. 2014-12-08 10:40:52 +01:00
Robert K
207f4bfd30 EclipseWriter: support reordering of compressed cells, e.g. space filling curves. 2014-12-05 15:44:39 +01:00
Atgeirr Flø Rasmussen
98cf664b3f Silence unused argument warning. 2014-12-02 09:17:11 +01:00
Atgeirr Flø Rasmussen
fdad6860cb Merge pull request #688 from andlaus/temperature_dependent_PVT
PVT properties: allow them to be temperature dependent
2014-12-02 08:48:57 +01:00
Andreas Lauser
e530ce03d8 PVT properties: allow them to be temperature dependent
Note that this patch does not introduce any real temperature
dependence but only changes the APIs for the viscosity and for the
density related methods. Note that I also don't like the fact that
this requires so many changes to so many files, but with the current
design of the property classes I cannot see a way to avoid this...
2014-12-01 20:06:31 +01:00
Atgeirr Flø Rasmussen
48439d6420 Use proper way to access pi() from boost::math. 2014-12-01 14:55:06 +01:00
Atgeirr Flø Rasmussen
8af3b17c68 Simplify formula with atan2(). 2014-12-01 14:38:08 +01:00
Atgeirr Flø Rasmussen
35a8bd4791 Fix more whitespace tab->space issues. 2014-12-01 14:21:16 +01:00
Atgeirr Flø Rasmussen
9e26afaaba Fix comment referencing renamed function. 2014-12-01 13:43:34 +01:00
Atgeirr Flø Rasmussen
6bc74bd746 Replace M_PI with boost usage. 2014-12-01 12:11:27 +01:00
Atgeirr Flø Rasmussen
3eb3000248 Rename vertexNeighbours() -> cellNeighboursAcrossVertices(). 2014-12-01 11:37:49 +01:00
Atgeirr Flø Rasmussen
e7bdb72ce3 Whitespace: tabs to spaces. 2014-12-01 11:28:28 +01:00
Atgeirr Flø Rasmussen
e807834a3c Use GridHelpers in implementation of vertexNeighbours(). 2014-12-01 11:27:39 +01:00
Atgeirr Flø Rasmussen
700d49ac91 Minor fixes for FaceCellsProxy::operator().
Fixes are:
 - Made the method const.
 - Corrected argument name cell_index -> face_index.
2014-12-01 11:22:33 +01:00
Atgeirr Flø Rasmussen
b26bfc51f6 Add orderCounterClockwise() and test. 2014-11-27 14:49:32 +01:00
Atgeirr Flø Rasmussen
578f467b59 Add free function vertexNeighbours() and test. 2014-11-27 14:49:32 +01:00
Atgeirr Flø Rasmussen
b352e7ca3a Suppress unused argument warning in release mode. 2014-11-24 10:54:51 +01:00
Atgeirr Flø Rasmussen
91baeea8d3 Rename variable to avoid shadowing. 2014-11-24 10:54:30 +01:00
Markus Blatt
e22795e920 [cleanup] Removes a superfluous if-check of the well state.
There were to identical if statements and the second one was followed
by an else branch. While in this case (if statement just throws) it is not
a bug, this commit cleans up one of the if statements.
2014-11-20 14:47:21 +01:00
Markus Blatt
06a83e76f5 Fixes missing return value in non-void function of WellsManager.
gcc warned about the following

/home/mblatt/src/dune/opm/opm-core/opm/core/wells/WellsManager.cpp: In function ‘std::array<long unsigned int, 3ul> WellsManagerDetail::directionIndices(Opm::CompletionDirection::DirectionEnum)’:
/home/mblatt/src/dune/opm/opm-core/opm/core/wells/WellsManager.cpp:191: warning: control reaches end of non-void function

To calm it I introduced a throw clause after the switch statements. Thus adding a new
enum value will raise a warning on smart compilers, hopefully.
2014-11-20 11:53:23 +01:00
Jørgen Kvalsvik
114b335ce6 Moved KSPCreate to the Data constructor
This is where it was always intended to be called, so this fixes a mistake in
earlier development.
2014-11-12 20:41:21 +01:00
Tor Harald Sandve
75749c3dab Do not include shut wells in the well name to index map
The name to index map is used to make sure the correct wellstate values
are associated with the corresponding well. Shut wells should be
excluded from this mapping as no date is for shut wells are found in the
wellstates, instead 0 is outputed for the shut wells.
2014-11-07 12:22:19 +01:00
osae
b3b15188d9 Made hysteresis variant of gwseg consistent ...
... with the base gwseg behaviour.  Added test.
2014-11-05 17:00:11 +01:00
osae
2b865a992e Consistency between scaled and unscaled gwseg.
Modified the endpoint scaled version of SatFuncGwseg and updated
the tests accordingly.
2014-11-05 16:10:05 +01:00
osae
92ee3cd86b Rename eclState to eclipseState. 2014-11-05 16:10:05 +01:00
osae
8f8450f018 Base initialisation of SWL etc on EclipseState ...
Thus allowing an unmodified Norne deck.
2014-11-05 16:10:05 +01:00
osae
ba6de11151 Bugfix: Actually use column index ... 2014-11-05 16:10:05 +01:00
osae
877b501659 Cleaning up and preparation for eclipseState. 2014-11-05 16:10:05 +01:00
Atgeirr Flø Rasmussen
e2fdf14ee3 Suppress unused argument warning. 2014-11-05 07:51:21 +01:00
Tor Harald Sandve
401b193854 BUGFIX. Do not increase well index for shut wells.
Shut wells are not added to the well list and the well index should
therefore not be increased when well control is set. This is similar to
whats is done for shut wells in createWellsFromSpecs.
2014-10-27 07:20:03 +01:00
Atgeirr Flø Rasmussen
b7a6680ef4 Merge pull request #672 from dr-robertk/PR/remove-unused-typedef-warning
remove unused typedef to avoid compiler warning and keep code clean.
2014-10-24 14:28:55 +02:00
Robert K
81d3281999 remove unused typedef to avoid compiler warning and keep code clean. 2014-10-24 12:51:57 +02:00
Robert K
12891f668b fix problem with solver reastart, variable was not reset.
Also, the time step does only grow moderately after a solver restart.
2014-10-24 12:32:00 +02:00
Tor Harald Sandve
2ff42c327b SHUT wells returns 0
Shut wells returns 0 for bhp and rates in the EclipseWriter
2014-10-24 07:01:36 +02:00
Tor Harald Sandve
c659c080cb Fix SHUT wells
Shut wells are not added to the well list and thus not considered in the
simulator.

The shut well test in test_wellsmanager is modified to assert this
behaviour.

BUG: This change provokes an assert in the EclipeWriter as number of
wells in wellstate is different from number of wells in the schedule.
2014-10-24 06:57:38 +02:00
Robert Kloefkorn
42bcb5f0c8 address Atgeirs comments. 2014-10-20 12:32:11 +02:00
Robert Kloefkorn
e552acc244 Merge remote-tracking branch 'upstream/master' into timestepcontrol 2014-10-17 11:28:04 +02:00
Joakim Hove
68b915530e Minor whitespace fixup 2014-10-17 08:05:13 +02:00
Robert Kloefkorn
f8e61c0267 also catch std::runtime_error, i.e. convergence of linear solver failed. 2014-10-14 15:18:36 +02:00
Jørgen Kvalsvik
d380d1759e Reduces CHKERRXX usage to where necessary.
The error checking macro makes it harder to read and harder to write, so
instead we now only check for functions  that can contain errors. Bounds and
range checks are handled by PETSc and not OPM.
2014-10-14 14:43:42 +02:00
Jørgen Kvalsvik
4a79f2e2ca Petsc constructor now uses intialiser list.
The previous implementation set plenty of values in the initialization list and
immediately overwrote these values with values looked up from the param group.
This patch makes it look up the parameteres from the param group argument,
making the constructor simpler.
2014-10-14 14:43:42 +02:00
Jørgen Kvalsvik
2917387845 Makes using wrong constructor a compile-time error
Petsc only supports initialisation through the ParameterGroup constructor.
Calling the default, non-arg constructor is a static error, and not
implementing it makes using it break compiles.
2014-10-14 14:43:42 +02:00
Jørgen Kvalsvik
5ed0f73ba2 Removes call_petsc.c and calls the lib from C++
call_petsc.c was really a thin C wrapper around the call to petsc itself and
turns out was mostly unnecessary C++ emulation. This removes the file entirely
and ports its functionality into LinearSolverPetsc.cpp.

All features from the file should now be more readable as well as properly
utilising modern C++ features.

The patch uses the CHKERRXX macro from petsc to handle errors reported by
petsc, and currently does not handle this and give the control back to OPM's
error/throw system.
2014-10-14 14:43:42 +02:00
Joakim Hove
72cde22f62 Bug in well_index increment in WellsManager 2014-10-14 12:43:57 +02:00
Joakim Hove
dd87b8fc52 Will not update WellControls if cmode == CMODE_UNDEFINED 2014-10-14 12:42:55 +02:00
Joakim Hove
37c563689c ControlMode is left undefined if it unset in deck. 2014-10-14 12:34:58 +02:00
Robert Kloefkorn
164b892c17 added initial fraction to initialize last_timestep. 2014-10-13 11:17:37 +02:00
Robert Kloefkorn
44f90f974e Two small adjustments that came up when running in debug mode. 2014-10-10 13:55:28 +02:00
Robert Kloefkorn
2fcb3c6638 Merge remote-tracking branch 'upstream/master' into timestepcontrol 2014-10-08 16:42:32 +02:00
Andreas Lauser
16658430cc WellsManager: do not require a control mode to be set if the well status is SHUT
For Norne it fell on its nose because of this...
2014-10-08 12:35:38 +02:00
Robert Kloefkorn
80431e273f ok, now we got it. euclidianNormSquared. 2014-10-07 14:14:31 +02:00
Robert Kloefkorn
ba316dd651 more convenient name. 2014-10-07 10:45:09 +02:00
Robert Kloefkorn
b111fbbb15 innerProduct --> euclideanNorm2. 2014-10-07 10:40:44 +02:00
Robert Kloefkorn
ef813c94cc inner_product --> innerProduct. Avoid confusion with std version. 2014-10-07 09:52:22 +02:00
Robert Kloefkorn
b250383ae0 use unit::convert::to instead of hard coded 86400 factor. 2014-10-07 09:48:57 +02:00
Robert K
355e68c63b move implementation to .cpp files. 2014-10-06 14:26:23 +02:00
Robert K
5af49ed90b the adaptive time stepping utility classes. 2014-10-06 14:06:07 +02:00
Robert K
879dddc9b6 move protected area to the bottom and remove unused lines as well as halfTimeStep method. 2014-10-03 15:53:18 +02:00
Robert K
e1d1063e0d remove white spaces. 2014-10-03 14:14:01 +02:00
Robert K
0ed28121a1 reset to old state. 2014-10-03 14:10:56 +02:00
Robert K
e69c37167c renamed and split advance method. 2014-10-03 13:44:05 +02:00
Robert K
c371d4fa22 class for handling adaptive time steps. 2014-10-03 13:33:13 +02:00
Robert K
f6c9bc9090 improvement of the time step adjustment. 2014-10-02 14:04:32 +02:00
Robert K
92d5f43d82 sub step simulator timer. 2014-10-01 13:56:27 +02:00
Robert K
9517359d3f reset master. 2014-10-01 13:55:42 +02:00
Robert K
d42d0a6cbe SubStepSimulationTimer for time step control. Needs documentation and cleanup. 2014-09-30 15:55:26 +02:00
Atgeirr Flø Rasmussen
c3551dfdad Merge pull request #657 from GitPaean/PVT_viscosity_try
Obtaining viscosity by doing a linear interpolation of the inverse of B*mu instead of mu directly.
2014-09-23 22:44:37 +02:00
Kai Bao
ef3e524c30 Changing nColumns to nRows. 2014-09-23 13:17:47 +02:00
Atgeirr Flø Rasmussen
c0627c2305 Merge pull request #654 from andlaus/fix_rate_conversion
Fix rate conversion
2014-09-22 14:36:52 +02:00
Kai Bao
175da5450f Changing the location of * in long formula. 2014-09-22 14:29:18 +02:00
Kai Bao
6a43935ea3 Deleting some commented lines. 2014-09-22 14:26:00 +02:00
Kai Bao
09404202da Changing the naming in PvtDead.
To be consistent with the naming int PvtLive.
2014-09-22 14:21:33 +02:00
Andreas Lauser
7ce561095c EclipseWriter: don't convert the unit inside the rate() function
because if that is done, the integration for the production total is
wrong because the time step length is days and not seconds.

Note that the conversion now uses Opm::unit::convert::to(<>,
1/conversionFactor) instead of simply multiplying with the conversion
factor. I still think this obfuscates things more than it helps, but
[at] bska will hopefully want it this way...
2014-09-22 14:16:41 +02:00
Andreas Lauser
6659070eac EclipseWriter: clarify a comment 2014-09-22 14:15:57 +02:00
Atgeirr Flø Rasmussen
383bd4d91e Remove old legacy unit constants.
They should have been removed a long time ago, but were overlooked.
2014-09-22 13:28:17 +02:00
Kai Bao
5d3017e6c6 Merge remote-tracking branch 'upstream/master' into PVT_viscosity_try 2014-09-22 13:01:13 +02:00
Kai Bao
ee73105c95 Using resize to allocate memory for 1/BMu. 2014-09-22 10:28:23 +02:00
Atgeirr Flø Rasmussen
9afe054c25 Remove include guards from warning suppression headers.
They are intended to temporarily change compiler state, and may be
included multiple times in a single compilation unit.
2014-09-20 10:36:10 +02:00
Atgeirr Flø Rasmussen
a47e6775bd Honor SILENCE_EXTERNAL_WARNINGS in suppression headers. 2014-09-20 10:36:10 +02:00
Atgeirr Flø Rasmussen
1dd215834b Refactor third-party warning suppression.
Use header files from opm/core/utility/platform_dependent instead of
build-system generated ones for suppressing warnings from dune or Eigen.
2014-09-20 10:36:10 +02:00
Atgeirr Flø Rasmussen
763c9de6ef Add disabling and reenabling header files.
The files check for compiler versions to avoid using incompatible
pragmas. Only enabled for gcc >= 4.6 and clang.
2014-09-20 10:36:10 +02:00
Andreas Lauser
c7dfd096aa SatFuncBase.hpp: convert DOS line endings to unix ones
i.e. \r\n -> \n
2014-09-19 14:40:52 +02:00
Andreas Lauser
bd0bfc172b adapt the the table related API changes of opm-parser 2014-09-19 14:40:35 +02:00
Kai Bao
2b18b8f27f Finshing changing Pvt_liveGas
Remains to be verfied.
2014-09-18 15:28:38 +02:00
Kai Bao
eadbffa99b Changing the PvtLiveOil to use 1/BV for viscosity.
Pssing the simple 2D test.
2014-09-18 12:46:45 +02:00
Atgeirr Flø Rasmussen
6d1cfc0fb2 Avoid release mode warnings.
Variables only used in asserts have been removed, their content used
directly in the assert() instead.
2014-09-18 11:31:03 +02:00
Kai Bao
0b69961d9e A little more comment about B and b. 2014-09-17 11:15:58 +02:00
Kai Bao
d393d147a4 Updating the calculation of mu and dmudp for PvtDead. 2014-09-14 17:33:43 +02:00
Kai Bao
d9acd0f3b8 Rewriting the d_mu_d_p for deadGas. 2014-09-14 16:24:37 +02:00
Kai Bao
d9eb3ea30f Chaning using the new interpolation for viscosity 2014-09-12 13:39:16 +02:00
Andreas Lauser
38eed1875a EclipseWriter: replace /= by unit::convert::to()
as insisted on by [at] bska
2014-09-10 11:41:26 +02:00
Andreas Lauser
5dd00f93c3 use the same units for pressure output as for pressure input from the deck
before, the output was always metric, regardless of whether the deck
used metric or field units...
2014-09-09 18:58:34 +02:00
Andreas Lauser
9a44720e32 rename getCF() to getConnectionTransmissibilityFactor() 2014-09-06 22:28:21 +02:00
Andreas Lauser
da25fb699d change the defaults for pvt_tab_size and sat_tab_size to -1
this causes the code to use linear instead of spline
interpolation. thanks to @atgeirr for pointing this out..
2014-09-03 14:42:43 +02:00
Andreas Lauser
8a8c71bc63 change the default of the "threephase_model" parameter from "simple" to "gwseg"
Using "simple", the Norne deck aborts with an exception.

Note: SPE1 and SPE9 still seem to work fine with this but there might
be small differences so that the reference solutions of the Jenkins
server might need to be updated...
2014-09-03 13:37:52 +02:00
Atgeirr Flø Rasmussen
dfb7483e1e Merge pull request #648 from bska/fix-peaceman
effectiveRadius: Fix Numerator Formula
2014-09-02 15:46:36 +02:00
Bård Skaflestad
9591aec757 effectiveRadius: Fix numerator formula
We must take the square root of the permeability ratios, not use them
as is.  This was lost in the refactorisation commit 96cf137.

Pointy hat: @bska.
2014-09-02 15:12:50 +02:00
Tor Harald Sandve
a7ecde25ce Include goc and woc in the span for the phase pressure calculation 2014-09-02 14:49:09 +02:00
Tor Harald Sandve
e44b045260 Remove fix for GOC and WOC above/below reservoir 2014-09-02 14:49:09 +02:00
Bård Skaflestad
7f874c0d64 effectiveExtent: Fix out-of-bounds indexing
Commit 96cf137 introduced support for Peaceman index calculation
that honoured general completion directions (X,Y,Z).  This was
accomplished through a permutation index that reordered the
permeability and geometric extent components according to a local
coordinate system along the completion.

In a complete breakdown of logic, however, the d-component extent
vector was indexed as though it were a d-by-d matrix.  This commit
restores sanity to the processing.

Pointy hat: @bska.
2014-09-01 13:30:32 +02:00
Atgeirr Flø Rasmussen
c55a887904 Use double braces for std::array init to avoid warning.
Warning triggered at least using clang.
2014-09-01 10:09:27 +02:00
Bård Skaflestad
96cf137e4c WellsManager: Support NTG and horizontal completions
This commit extends the feature set of the WellsManager to support
horizontal ("X" and "Y") completions and include the net-to-gross
ratio in the Peaceman index ("Completion Transmissibility Factor,
CTF") of a well completion.  The NTG factor is included if present
in the input deck represented by the "eclipseState".

There are two separate, though related, parts to this commit.  The
first part splits the calculation of Peaceman's "effective radius"
out to a separate utility function, effectiveRadius(), and
generalises WellsManagerDetail::computeWellIndex() to account for
arbitrary directions and NTG factors.  The second part uses
GridPropertyAccess::Compressed<> to extract the NTG vector from the
input if present while providing a fall-back value of 1.0 if no such
vector is available.

Note: We may wish to make the extraction policy configurable at some
point in the future.
2014-08-31 21:24:37 +02:00
Bård Skaflestad
8adeb5f56c Annotate namespace closing brace with namespace name 2014-08-29 12:31:35 +02:00
Bård Skaflestad
c3375da14f Adjust white-space for readability
This is mostly just splitting long lines and aligning parameters where
appropriate.  No functional changes.
2014-08-29 12:22:26 +02:00
Bård Skaflestad
b35362f1e9 createWellsFromSpecs: Assert three space dimensions
Method WellsManager::createWellsFromSpecs() is only supported in
three space dimensions.  Assert that we don't use anything else.
2014-08-29 12:18:59 +02:00
Bård Skaflestad
fda49df8a8 createWellsFromSpecs: Use ref-to-const cart2active
This commit tightens the function header of method

    WellsManager::createWellsFromSpecs()

to accept a reference-to-const 'cartesian_to_compressed' map.  It
used to be a complete, copy-constructed object, so this is a slight
performance enhancement as we no longer need to copy a (somewhat)
large object on every call to the method.
2014-08-29 12:13:38 +02:00
Bård Skaflestad
97a8ee630e getCubeDim: Support arbitrary number of dimensions
This commit generalises the implementation of utility function
'getCubeDim' to support arbitrary number of space dimensions.  In
actual practice there's no change in features as we only really use
a compile-time constant (= 3) to specify the number of space
dimensions.
2014-08-29 11:39:24 +02:00
Bård Skaflestad
7933d87605 Merge pull request #638 from totto82/fix_GOC_below
Currectly handling GOC below and WOC above the reservoir
2014-08-29 09:27:56 +02:00
Bård Skaflestad
1a3f7b230f Merge pull request #639 from atgeirr/threshold-pressure
Threshold pressure function
2014-08-29 09:13:27 +02:00
Bård Skaflestad
9784df8024 Merge pull request #641 from atgeirr/fix-warnings
Fix warnings
2014-08-28 16:11:12 +02:00
Atgeirr Flø Rasmussen
e1be710526 Suppress unused argument warning.
The eclState argument was added in PR#634, and may be needed later.
Until then, this silences the warning generated.
2014-08-28 14:14:22 +02:00
Atgeirr Flø Rasmussen
5059f66bad Squash warnings by removing or commenting out unused parameters. 2014-08-28 14:14:22 +02:00
Bård Skaflestad
59205f2e65 Add missing 'not' in documentation. 2014-08-28 10:20:07 +02:00
Bård Skaflestad
7f875a6c34 Use correct name in name-space closing comment
Pointed out by [at] atgeirr.
2014-08-28 10:14:55 +02:00
Bård Skaflestad
f22bd0c208 Fix class reference in documentation
CompressedAccess<> was the former name of class template Compressed<>.
2014-08-27 22:55:15 +02:00
Bård Skaflestad
58f55f3c90 Reimplement assign* in terms of Compressed<>
This is a demonstration of using the

    GridPropertyAccess::Compressed<>

class template.  We save (some) memory by not creating the zero
fall-back vector in assignPermeability(), preferring instead to use
the fall-back/default mechanism of ArrayPolicy::ExtractFromDeck<>.

While here, adjust vector<PermComponent>::reserve() capacity to
reflect actual requirements.
2014-08-27 21:19:41 +02:00
Bård Skaflestad
37dfc4a3b5 Add facility for accessing active subset of global data array
This commit introduces a fairly general mechanism for accessing the
active subset of a global grid (property) array.  Essentially, this
takes on the role of translating the active cell index through the
"global_cell" mapping when accessing, e.g., the net-to-gross data
value.

The primary component is class template

    Opm::GridPropertyAccess::Compressed<DataArray,Tag>

which implements a read-only

    value_type operator[](const int c)

that encapsulates and performs the compressed-to-global cell index
translation.  Template parameter "DataArray" is intended as a policy
parameter that for instance wraps access to a "GridProperty<T>" from
module opm-parser (with a fall-back default value if the data is not
specified on input).  The "Tag" parameter is a provision for type
safety--e.g., to prevent passing a region ID into a function that
requires a porosity value.
2014-08-27 21:19:41 +02:00
Bård Skaflestad
7f07964e0c assignPermeability: Remark on storage order
Clients expect column-major (Fortran) ordering of the contiguous
"permeability_" array so that's what we create despite "tensor"
being row-major.

Suggested by: [at] atgeirr
2014-08-27 21:19:40 +02:00
Bård Skaflestad
008702817d Merge pull request #637 from atgeirr/add-minpv
Add MINPV processing to GridManager
2014-08-27 19:34:34 +02:00
Atgeirr Flø Rasmussen
e1ea795cdc Fix minor typo in comment. 2014-08-27 18:13:15 +02:00
Atgeirr Flø Rasmussen
5604745642 New free function thresholdPressures(). 2014-08-27 18:07:46 +02:00
Atgeirr Flø Rasmussen
5e940faa8b Use syntax for std::array which works with GCC 4.4. 2014-08-27 16:00:57 +02:00
Tor Harald Sandve
37e526a046 Fix sign error in the specified oil pressures at at WOC and GOC
The oil pressure at the contact for the special cases:

contact	location	po(contact)
GOC 	above 	-inf
GOC 	below 	+inf
WOC 	above 	-inf
WOC 	below 	+inf
2014-08-27 14:35:01 +02:00
Atgeirr Flø Rasmussen
ce4168df27 Refactor set/getCellCorn() with private method.
Also const-ify everything that can be const.
2014-08-27 13:17:28 +02:00
Atgeirr Flø Rasmussen
0f02dba2d4 Correct doc error (zcorn is also output argument). 2014-08-27 11:15:00 +02:00
Atgeirr Flø Rasmussen
7ca1922c77 Remove unneeded const_cast. 2014-08-27 11:13:37 +02:00
Tor Harald Sandve
704e7dbb58 Currectly handling GOC below and WOC above the reservoir The phase pressure of water and gas is set to inf when WOC and GOC is above and below the reservoir. This make sure the minimum saturation values are picked for these cases. 2014-08-27 10:10:55 +02:00
Bård Skaflestad
bcec9fd0f6 Simplify diagonal component thresholding
This commit switches the assignment

    diagonal = max(diagonal, minval)

to using a reference in the "diagonal" expression.  This guarantees
that the indexing is done once which eases maintainability.  While
here, replace the hard-coded dimension stride ('3') with the current
run-time dimension.  This is mostly for symmetry because the overall
code is only really supported in three space dimension.
2014-08-26 23:50:05 +02:00
Bård Skaflestad
2ae64c1df2 Remove obsolete comment
This comment was needed when the code was first developed, but
subsequent development has rendered it obsolete.  Remove it to avoid
confusion.
2014-08-26 23:50:05 +02:00
Bård Skaflestad
194b6eda7a Fix semantics of permeability assignment
Calling code relies on permeability tensors being stored in column
major order (row index cycling the most rapidly).  Honour that
requirement.  The previous assignment implied row major ordering
(column index cycling the most rapidly).  This, however, is a
pedantic rather than visible change because the surrounding code
enforces symmetric tensors whence both orderings produce the same
results when the array is viewed contiguously.
2014-08-26 23:50:04 +02:00
Atgeirr Flø Rasmussen
6297fb7991 Merge pull request #630 from totto82/fix_init_spe9
The water/gas press. are calculated only if woc/goc is within the reservoar
2014-08-26 22:27:11 +02:00
Atgeirr Flø Rasmussen
4279170284 Change loop order. 2014-08-26 22:10:31 +02:00
Atgeirr Flø Rasmussen
37604618ec Documented MinpvProcessor. 2014-08-25 15:39:33 +02:00
Atgeirr Flø Rasmussen
4ad160d2de Add new constructor, that can handle MINPV processing. 2014-08-25 15:20:41 +02:00
Atgeirr Flø Rasmussen
f74a0bb3e6 New class MinpvProcessor, and test. 2014-08-25 15:20:01 +02:00
Bård Skaflestad
492b64faac CornerpointChopper::writeGrdecl(): Increase vector precision
This commit increases the precision of the (floating-point) vector
output (e.g., permeabilities) from method writeGrdecl().  This
reduces the impact of rounding errors when the sub-set sample is
output to disk for subsequent processing (e.g., property upscaling).
2014-08-25 14:01:03 +02:00
Bård Skaflestad
71596fe8a3 CornerpointChopper::writeGrdecl(): Write fewer items per line
This is in preparation of increasing the vector output precision to
reduce the impact of rounding errors in subsequent upscaling.  The
change impacts floating-point vectors only.

Background: The ECL simulator stipulates an upper bound on the
number of characters in a record (i.e., one line) and while we don't
have such limits, there's no reason to emit lines that can't be
input by other tools.
2014-08-25 14:01:03 +02:00
Bård Skaflestad
d3d38d2d6f Merge pull request #634 from osae/satFunc-eclState
Provide eclipse state to saturation property init.
2014-08-25 13:55:44 +02:00
osae
96823e04a3 Provide eclipse state to saturation property init. 2014-08-22 15:36:07 +02:00
Atgeirr Flø Rasmussen
cfd07600bc Create pointer-to-const objects.
Older gcc (4.4) does not allow conversion of shared_ptr<Foo> to
shared_ptr<const Foo>. Pointed out by @bska.
2014-08-21 15:24:39 +02:00
Atgeirr Flø Rasmussen
5690d20705 Add PINCH support to grid construction. 2014-08-21 14:32:13 +02:00
Atgeirr Flø Rasmussen
f72f823aab Make all construction from deck use EclipseGrid.
The deck constructor is still present, but it will construct an
EclipseGrid object instead of doing its own equivalent processing.
2014-08-21 14:21:21 +02:00
Tor Harald Sandve
b331c68fbc Fixes issues pointed out in the PR comments 2014-08-18 08:57:23 +02:00
Tor Harald Sandve
12b245df3d The water/gas pressures are only calculated if woc and goc lies within
the reservoar
The water/gas pressure is set to -inf when woc and goc is above or below
the reservoar.
2014-08-15 08:56:35 +02:00
Atgeirr Flø Rasmussen
a6c173abad Merge pull request #625 from andlaus/fix_wells_in_summary_output
EclipseWriter: attempt to fix the well summary output for activeWells != totalWells
2014-08-14 14:02:54 +02:00
Andreas Lauser
6e1bf4b3ab EclipseWriter: attempt to fix the well summary output for activeWells != totalWells
The summary files now always features all wells which ever appear in
the deck in every timestep (even if they are not specified for the
time step). This _should_ fix the crashes when writing Eclipse output
in the Norne deck, but I have no idea if the resulting summary file is
correct. More testing would be thus highly appreciated...
2014-08-14 13:35:44 +02:00
Tor Harald Sandve
28d7380d40 BUGFIX
Wrong placement of parentes
2014-08-11 12:45:52 +02:00
Tor Harald Sandve
5051658a07 Implements initialization for constant capillary pressure functions 2014-08-11 11:23:15 +02:00
Tor Harald Sandve
4f862e759e Computes saturations based on depths
For constant capillar pressure function the saturation is
    determined by cell depths:

    Sg_max, Sw_min
    ----- goc ----
    Sg_min, Sw_min
    ----- woc ----
    Sg_min, Sw_max
2014-08-11 11:22:47 +02:00
Bård Skaflestad
6b36dab2ee swatInitScaling(): Abide by OPM coding conventions
This commit attaches the reference-signifying ampersand to the type
as is preferred in the OPM code base.

Suggested by: [at] atgeirr
2014-08-07 18:50:07 +02:00
Bård Skaflestad
c047a6c9dc swatInitScaling(): Remove EOL whitespace
This commit removes several instances of EOL whitespace in function
'swatInitScaling()'.  Aesthetic only.  No functional changes.

Suggested by: [at] atgeirr
2014-08-07 18:50:07 +02:00
Bård Skaflestad
f8492aeb64 swatInitScaling(): Name magic constant
The constant 1.0e-8 was used as a threshold to distinguish "low"
from "high" capillary pressure values.  Introduce acutual constant
"pc_low_threshold" to clarify that role.

Suggested by: [at] atgeirr
2014-08-07 18:50:07 +02:00
Bård Skaflestad
e8901775cd swatInitScaling(): Rename array size parameter
This commit renames the 'np' parameter used to allocate small arrays
for saturations and capillary pressures to 'max_np' to better
reflect its purpose.

Suggested by: [at] atgeirr
2014-08-07 18:50:06 +02:00
Bård Skaflestad
4da2c5862d Initialise saturation points for Pc scaling
This gives predictable failure modes although the actual behaviour
is (probably) unchanged.
2014-08-07 18:50:06 +02:00
Bård Skaflestad
6f75afc62b Consistently refer to BlackoilPhases::Aqua
This avoids confusion.
2014-08-07 18:50:06 +02:00
Bård Skaflestad
62f654b52c Don't use variable-length arrays
We only support up to 'BlackoilPhases::MaxNumPhases' different
phases (and components), so there's no need to pretend otherwise.
2014-08-07 18:50:06 +02:00
Atgeirr Flø Rasmussen
f32198a040 Properly handle defaulted well reference depths. 2014-08-07 12:57:05 +02:00
Andreas Lauser
493650d2b1 EclipseWriter: Don't use the deck directly anymore
instead, use Opm::EclipseState. This requires to pass the PhaseUsage
object to the EclipseWriter, as this one cannot be recovered from
EclipseState (yet?).
2014-07-18 11:20:28 +02:00
Andreas Lauser
597735b7d0 output the cells which the simulator classes consider active
copying the EclipseGrid object is required as the final set of active
cells requires knowledge of the grid used by the simulator which is
not available in opm-parser. In turn, this requires to call
EclipseGrid::resetACTNUM() which is non-const.
2014-07-17 21:47:11 +02:00
Andreas Lauser
dc5fc64e98 EclipseWriter: pass an EclipseState to it and use it where possible 2014-07-16 14:34:24 +02:00
Andreas Lauser
65a1bd6722 EclipseWriter: Use opm-parser's Opm::EclipseGrid class to write the EGRID file
this simplifies things quite a bit and allows us to get rid of the
Opm::EclipseWriterDetails::Grid class...
2014-07-16 12:35:31 +02:00
Andreas Lauser
bbd05ec67f EclipseWriter: some minor white space changes 2014-07-16 10:41:25 +02:00
Andreas Lauser
c6d3994722 EclipseWriter: make it not crash if no wells are present 2014-07-16 10:41:25 +02:00
Andreas Lauser
89cbfac621 EclipseWriter: Store the Cartesian sizes internally
because it this array can be deleted after calling the
constructor. TODO (?): Do the same for the compressed-to-Cartesian
cell index map.
2014-07-16 10:41:25 +02:00
Andreas Lauser
1a1920e5a4 EclipseWriter: remove some unused functions and refactor the code for Cartesian sizes 2014-07-16 10:41:25 +02:00
Andreas Lauser
8579a971da EclipseWriter: get rid of the EclipseHandle monster
instead, the wrapper classes now call ERT directly, so it's easy to
see what a given class does. interestingly the amount of additional
code required is neglectible (or even negative).
2014-07-16 10:41:25 +02:00
Andreas Lauser
044244c4b0 EclipseWriter: rename some variables and functions to make the naming scheme consistent 2014-07-16 10:41:25 +02:00
Andreas Lauser
750af9bf73 EclipseWriter: avoid "using namespace Foo" in compile-unit scope 2014-07-16 10:41:25 +02:00
Andreas Lauser
26dbfb78c2 EclipseWriter: Remove the non-ERT codepaths
ERT has been a requirement for opm-parser for a while now and
opm-parser is a prerequisite of opm-core, so ERT is always
available. Thus remove the stub code to avoid bitrot...
2014-07-16 10:41:25 +02:00
Andreas Lauser
e142094443 remove the "Eclipse" prefix from all classes in namespace "EclipseWriterDetails"
this have become become superfluous by the namespace...
2014-07-14 13:58:53 +02:00
Andreas Lauser
d71c2a0fa6 EclipseWriter: introduce namespace EclipseWriterDetails
it is for -- well -- the implementation details of EclipseWriter...
2014-07-14 13:58:53 +02:00
Andreas Lauser
15ff31f307 EclipseWriter: stop making UnstructuredGrid think it is special
instead, the same interface as for Dune::CpGrid is now
used. (i.e. pass all relevant information as separate arguments.)
2014-07-14 13:58:50 +02:00
Andreas Lauser
6ac1196859 EclipseWriter: use opm-parser's EclipseGrid class
this unifies the grid creation code paths with the one used by the
simulators and simplfies things.
2014-07-14 13:58:35 +02:00
Liu Ming
53c539de6a use block{} guarantee for if and for statements. 2014-07-08 11:00:19 +08:00
Liu Ming
d8962ff1ce Add HAVE_PETSC macro. 2014-07-08 10:58:39 +08:00
Atgeirr Flø Rasmussen
6947423b97 Merge pull request #613 from andlaus/PvtLiveOil_fix_argument_ordering
PvtLiveOil: fix ordering of arguments
2014-07-07 14:23:54 +02:00
Atgeirr Flø Rasmussen
ace1e3306a Merge pull request #607 from osae/swatinit
Scaling of capillary pressure / initialisation from kw SWATINIT.
2014-07-07 14:10:02 +02:00
Andreas Lauser
db3a616a2f PvtLiveOil: fix ordering of arguments
the strange thing is that this worked as-is. The only explaination
which I have for this is that these code paths are unused...
2014-07-07 11:58:54 +02:00
Bård Skaflestad
24524e0137 Reimplement clone_wells() in terms of well_controls_clone() 2014-07-03 16:09:56 +02:00