Commit Graph

856 Commits

Author SHA1 Message Date
Robert Kloefkorn
a73c725b9d CPRPreconditioner: make compile with DUNE 2.2. 2015-04-08 14:23:35 +02:00
Atgeirr Flø Rasmussen
78ea73fa0a Fix convergence table labels (water, oil swapped). 2015-04-08 13:33:42 +02:00
Robert Kloefkorn
1ccf74eb4e NewtonIterationBlackoilCPR: fix uninitialized parameter and make the parameters const. 2015-04-08 11:48:16 +02:00
Atgeirr Flø Rasmussen
62d3f37b1d Merge pull request #342 from dr-robertk/PR/some-improvemnts-on-solvers
More parameter for solvers.
2015-03-31 18:00:40 +02:00
Robert Kloefkorn
1b23de0b1c CPR: add verbosity as a parameter. 2015-03-31 12:54:26 +02:00
Robert Kloefkorn
632bc7a809 CPR: FastAMG seems not to be faster, so use regular AMG. 2015-03-31 12:42:58 +02:00
Robert Kloefkorn
adac4a7995 CPRPreconditioner: added tolerance and max iter as a parmeter.
Parameters are now a separate class to avoid long constructor parameter list.
2015-03-31 12:15:54 +02:00
Andreas Lauser
ba4fca5a77 Revert "also pass the deck to the output writer"
This reverts commit 88730e855f.
2015-03-31 12:11:45 +02:00
Robert Kloefkorn
90a7faf1a8 FullyIBOS: added parameter for minimal number of newton iterations, default stays at 0.
Also, don't throw an exception when the solver did not converge, just return -1
indicating that there was a problem.
2015-03-31 11:16:44 +02:00
Robert Kloefkorn
20316e0a8e NewtonBOCPR: allow to use either GMRes or BiCGStab. This will be revised once the new
linear solver interface is in place.
2015-03-31 11:04:31 +02:00
Atgeirr Flø Rasmussen
05bee313d3 Merge pull request #339 from andlaus/use_deck_units_for_summary_output
also pass the deck to the output writer
2015-03-27 12:30:20 +01:00
Andreas Lauser
88730e855f also pass the deck to the output writer 2015-03-26 17:33:13 +01:00
Atgeirr Flø Rasmussen
061e1bcbd7 Merge pull request #324 from andlaus/implement_temperature_dependent_density
Implement temperature dependent density
2015-03-26 15:10:28 +01:00
Atgeirr Flø Rasmussen
eb9b62697e Make vertcatCollapseJacs() handle constants properly.
With this, any or all of the input vector element may have
an empty jacobian vector. Any element with a non-empty
jacobian vector must still have the same block pattern.
2015-03-24 09:48:31 +01:00
Atgeirr Flø Rasmussen
085c279a0a Use vertcatCollapseJacs() for improved performance. 2015-03-20 11:19:42 +01:00
Atgeirr Flø Rasmussen
07258f0249 Add function vertcatCollapsJacs(). 2015-03-20 11:19:42 +01:00
Tor Harald Sandve
388ce7548e Averaging multiple layers of NTG values 2015-03-19 12:27:08 +01:00
Atgeirr Flø Rasmussen
ad3da1d946 Re-add copying overload of AutoDiffBlock::function(). 2015-03-19 11:46:48 +01:00
Tor Harald Sandve
65199735e2 Use average NTG values for merged cells due to MINPV algorithm
The volume weighted averaged NTG values are used to get more
reasonable x and y transmissibilities for the cells effected by the
MINPV grid processing algorithm.

This commit starts the process of supporting the MINPV-FILL keyword
where upscaled properties are used for the merged/filled cells.
2015-03-19 11:37:03 +01:00
Andreas Lauser
f0c3a6f892 add glue code needed for thermal gas PVT 2015-03-17 13:34:29 +01:00
Andreas Lauser
924818f445 add glue code needed for thermal oil PVT 2015-03-17 13:34:29 +01:00
Andreas Lauser
debb8a1a04 add glue code needed for thermal water PVT 2015-03-17 13:34:29 +01:00
Atgeirr Flø Rasmussen
0a76af1b14 Include <utility> for std::move(). 2015-03-17 09:46:15 +01:00
Atgeirr Flø Rasmussen
f0ba4a5797 Use swap() and move() to reduce copying in formEllipticSystem(). 2015-03-16 14:22:32 +01:00
Atgeirr Flø Rasmussen
a4a3505fae Remove unused method computeRelPermWells(). 2015-03-16 14:22:32 +01:00
Atgeirr Flø Rasmussen
04b255a03f Make more use of move semantics in AD code.
This makes some API changes to AutoDiffBlock.
 - Add overload for the constant() constructor taking rvalue ref.
 - Add overload for the variable() constructor taking rvalue ref.
 - Make the function() constructor *require* rvalue refs.
 - Add a swap() function.

The remaining changes in this commit are follow-ups especially
to the third change (adding std::move in many places), and
some removal of unnecessary block pattern arguments from calls to
the constant() static method.
2015-03-16 14:22:32 +01:00
Atgeirr Flø Rasmussen
635f3db814 Use references in computeRelperm(). 2015-03-16 14:22:32 +01:00
Atgeirr Flø Rasmussen
5d5ab267d2 Use std::move() in variableState(). 2015-03-16 14:22:31 +01:00
Bård Skaflestad
531bc7fd73 Merge pull request #333 from atgeirr/reduce-recalculation
Reduce recalculation of phase pressures
2015-03-11 09:20:51 +01:00
Robert Kloefkorn
11ef164865 SimFullyImplBO: write simulation state at all report step and in the end when adaptive
TS is enabled.
2015-03-10 12:12:31 +01:00
Atgeirr Flø Rasmussen
f6b28b0f66 Add helper computeGasPress(), use to improve performance.
This avoids excessive calling of constantState().
2015-03-09 10:56:35 +01:00
Atgeirr Flø Rasmussen
ec9f5c1634 Move initial term computation to assemble(). 2015-03-09 10:56:35 +01:00
Atgeirr Flø Rasmussen
8f91296974 Eliminate extra computePressure() calls.
The function still gets called more than necessary,
but that is due to its use in variableState() and that
constantState() calls variableState().
2015-03-09 10:56:35 +01:00
Atgeirr Flø Rasmussen
818b653c15 Removed extra overload of relperm(). 2015-03-09 09:40:30 +01:00
Atgeirr Flø Rasmussen
a347e35304 Removing extra overloads of rsSat() and rvSat().
Also a few minor fixes to docs and indentation while in the area.
2015-03-09 09:40:30 +01:00
Atgeirr Flø Rasmussen
17117e7a0e Avoid storing return value in reference.
Normally this is OK for by-value returns, but here the right hand side
was changed to call ADB::value(), which returns by reference.
2015-03-05 16:07:04 +01:00
Atgeirr Flø Rasmussen
17b2a0e726 Merge pull request #327 from atgeirr/simplify-props
Simplify properties
2015-03-05 14:01:41 +01:00
Robert Kloefkorn
b20733eb29 nitpick adjustments. 2015-03-05 11:28:11 +01:00
Robert Kloefkorn
05260e9582 added number of linear and newton iterations to output. 2015-03-05 10:40:20 +01:00
Robert Kloefkorn
e5eec509d2 make terminal output a parameter to avoid output. 2015-03-05 10:40:20 +01:00
Robert Kloefkorn
06396b4b82 FullyImplicitBlackoilSolver: added tolerance for well convergence as parameter. 2015-03-05 10:40:15 +01:00
Atgeirr Flø Rasmussen
fbf06c06e7 Remove extra overloads of bWat(), bOil() and bGas().
Remaining method is the one taking AD objects. This modification
required changes to a few more places than anticipated:
  - RateConverter
  - FullyImplicitBlackoilSolver::computeWellConnectionPressures()
In these places, the call now is a little more complex and there
might be a very minor performance loss, until we optimize the
bX() functions to check for the no-derivatives case.
2015-03-03 14:33:19 +01:00
Robert Kloefkorn
96bda6a453 FullImplicitBlackOil and CPR: allow for dynamically changed tolerances from parameter
file. Default is as before.
2015-03-03 13:42:03 +01:00
Atgeirr Flø Rasmussen
1195ced57a Remove obsolete comment. 2015-03-03 13:19:42 +01:00
Atgeirr Flø Rasmussen
1d68f7e846 Remove extra overloads of muGas() and muWat().
This change has been made in both BlackoilPropsAdInterface
and BlackoilPropsAdFromDeck. Only remaining overloads are
those using AD objects and passing the PhasePresence for
each data point.
2015-03-03 13:14:31 +01:00
Atgeirr Flø Rasmussen
965be0471f Remove non-AD overload of muWat().
The AD version is made a little smarter, detecting the
case of input with no derivatives. Existing use of the
non-AD rewritten.
2015-03-03 12:56:30 +01:00
Bård Skaflestad
5a390f0d27 Merge pull request #323 from blattms/uggridhelpers-completion
Moves functions that do not depend on Eigen to Opm::UgGridHelpers. [3/3]
2015-03-02 18:50:06 +01:00
Markus Blatt
5e66f2844b Moves include of iterterator facades to cornerpoint 2015-03-02 16:22:22 +01:00
Markus Blatt
aaf82d2a65 [bugfix] read only from the sendState in BlackoilStateDataHandle.
During BlackoilStateDataHandle::gather we did read values from the
state where we should only receive values to. With this commit we
read from the state where we should send values.

Kudos to Bard for noticing this.
2015-03-02 11:10:02 +01:00
Atgeirr Flø Rasmussen
94742bd560 Remove unused variable. 2015-03-02 10:33:44 +01:00
Atgeirr Flø Rasmussen
09f6e8aacb Merge pull request #319 from blattms/removes-uggridhelpers-cpgrid
Moves Opm::UgGridHelpers from opm-autodiff to dune-cornerpoint
2015-03-02 10:10:26 +01:00
Atgeirr Flø Rasmussen
22d0d7cd27 Remove extra call to extractPvtTableIndex(). 2015-02-27 12:26:12 +01:00
Atgeirr Flø Rasmussen
635fea1cad Remove pvtTableIdx_ from BlackoilPropsAdFromDeck.
It was not used by the properties, this commit also fixes the bug that
pvtTableIdx_ was initialized instead of cellPvtRegionIdx_.
2015-02-27 10:20:30 +01:00
Atgeirr Flø Rasmussen
ba86dc191c Fix handling of multiple pvt-regions in BlackoilPropsAdFromDeck. 2015-02-27 10:20:30 +01:00
Atgeirr Flø Rasmussen
f3cfe26edb Correct function comment. 2015-02-23 13:42:51 +01:00
Atgeirr Flø Rasmussen
d9ce8625cf Remove unused classes.
After this, the two affected tests fail due to bugs in PVT region
support in BlackoilPropsAdFromDeck.
2015-02-23 13:42:51 +01:00
Markus Blatt
d62264d567 Moves functions that do not depend on Eigen to Opm::UgGridHelpers.
As a result we only have one faceCentroid(int) function the returns const double* and
FieldVector<double,3> for UnstructuredGrid and CpGrid, respectively. The codes is
adapted to this.
2015-02-23 12:24:40 +01:00
Markus Blatt
97fcd69d77 Removes empty namespace regions. 2015-02-23 11:38:03 +01:00
Markus Blatt
9fa1bba8da Moves Opm::UgGridHelpers from opm-autodiff to dune-cornerpoint
For historic (or no apparent) reason the free function grid interface
was added to opm-autodiff. As it depends on whether or not dune-cornerpoint
is present this seems rather unnatural. Therefore this commit removes the
functionality unconditionally from opm-autodiff.

Note that there is a corresponding commit in dune-cornerpoint that adds it
there.
2015-02-23 11:02:13 +01:00
Atgeirr Flø Rasmussen
eb89236552 Merge pull request #317 from blattms/generic-equil
Modified sim_fibo_ad_cp to also allow running with EQUIL keyword.
2015-02-20 18:24:05 +01:00
Atgeirr Flø Rasmussen
0ce57cb6db Merge pull request #316 from blattms/parallel-verbose-on-0
Print status output only on rank 0 for parallel runs.
2015-02-20 18:11:38 +01:00
Markus Blatt
bc58cfb3b9 Corrects missing space around if and operators. 2015-02-20 16:06:19 +01:00
Markus Blatt
fd10c97e46 Fxied typo wether -> whether. 2015-02-20 16:03:08 +01:00
Markus Blatt
bcc3ab7d95 Rename variable verbosity_ to terminal_output_. 2015-02-20 16:02:06 +01:00
Markus Blatt
62507b9cf6 [bugfix] Do not check verbosity when increase omega due to oscillation.
If oscillating then the same measures have to be taken on all
processes. This was not the case before the commit. Instead only
process 0 would have adapted omegas and we have produced wrong
results.

Kudos to Atgeirr for detecting this while reading the code.
2015-02-20 15:56:34 +01:00
Markus Blatt
46e0e0b0f7 Makes one argument constructors explicit to prevent type conversion. 2015-02-20 15:31:38 +01:00
Markus Blatt
007acfe018 Modified sim_fibo_ad_cp to also allow running with EQUIL keyword.
With now generic implementation of the initStateEquil in opm-core
we added the necessary grid helper functionlality for CpGrid and activated
the processing if the EQUIL keyword is there.
2015-02-20 12:23:35 +01:00
Markus Blatt
d35d301a4b Print status output only on rank 0 for parallel runs. 2015-02-20 11:35:47 +01:00
Atgeirr Flø Rasmussen
1ba856ebfe Merge pull request #314 from totto82/avg_press
Use the average well block pressure when evaluating the properties
2015-02-20 08:36:49 +01:00
Atgeirr Flø Rasmussen
ab835ec443 Merge pull request #308 from atgeirr/resv-injectors
Implement RESV limit targets for INJECTOR wells.
2015-02-19 15:45:18 +01:00
Atgeirr Flø Rasmussen
fec50b491a Merge pull request #311 from totto82/fix_verticalscaling
Apply the swatinit scaling to new_props
2015-02-19 11:29:00 +01:00
Atgeirr Flø Rasmussen
1e5b691a49 Merge pull request #313 from blattms/redistgridhandle-without-grid
Remove the unsused grid members from BlackoilPropsDataHandle.
2015-02-19 10:03:43 +01:00
Tor Harald Sandve
70a6a2ebf8 Use the average well block pressure when evaluating the properties
The average well block pressure is used instead of the well cell
pressure when the well properties are evaluated.
Temperature, rs, rv, phase conditions are still well cells values.

Perforation pressures are stored in the well state
2015-02-19 09:58:17 +01:00
Markus Blatt
5e72774b89 Remove the unsused grid members from BlackoilPropsDataHandle.
Previously BlackoilPropsDataHandle did hold a grid for sending
and receiving that were either not used or we could prevent their
usage. Therefore this commit removes them from the class and queries
all needed information from the property objects.
2015-02-19 09:35:18 +01:00
Atgeirr Flø Rasmussen
e96036bdb3 Move helper functions to namespace detail.
These were in the anonymous namespace, which was not wrong but lead to
false-positive unused function warnings on some compilers, probably due
to being used only from within templates. This allows us to keep the
warning activated by default.
2015-02-19 09:07:42 +01:00
Atgeirr Flø Rasmussen
b83bb7bf92 Remove unused function. 2015-02-19 09:03:22 +01:00
Tor Harald Sandve
44e9d2a34e Fix PR comments
1) swatinit() is changed to setSwatInitScaling() to make it obvious that
we are modifying the props.
2) the descriptions of saturation and pc now makes more sense
3) the method is removed from the sibling class and the interface and
the type of new_props is changed from BlackoilPropsAdInterface to
BlackoilPropsAdFromDeck
5) The same modification is added to sim_fibo_ad_cp
2015-02-19 08:34:55 +01:00
Tor Harald Sandve
013d1d3499 Apply the swatinit scaling to new_props
The capillary pressure function in new_props is scaled to match the
capillary pressure function in props.

This is a temporary workaround while the simulator uses two different
property object.
2015-02-19 08:18:39 +01:00
Atgeirr Flø Rasmussen
f0190dd2bb Remove const from bool return type.
Since it has no effect for value types, and generates a warning.
2015-02-17 13:45:14 +01:00
Atgeirr Flø Rasmussen
850845c61d Suppress re-declaration warning. 2015-02-17 13:44:52 +01:00
Atgeirr Flø Rasmussen
17ade0457f Suppress unused argument errors. 2015-02-17 13:44:33 +01:00
Atgeirr Flø Rasmussen
a4024a3f9e Remove unused functions. 2015-02-17 13:42:26 +01:00
Atgeirr Flø Rasmussen
355bfb0e70 Suppress signed/unsigned warning.
Also fix formatting.
2015-02-17 13:41:31 +01:00
Atgeirr Flø Rasmussen
7cdb65cff3 Suppress unused argument warnings. 2015-02-17 13:41:00 +01:00
Atgeirr Flø Rasmussen
bd2f659770 Adapt to API change in WellsManager. 2015-02-17 13:22:43 +01:00
Markus Blatt
3eb13e74dd Adds braces to if() return; 2015-02-16 11:42:42 +01:00
Atgeirr Flø Rasmussen
3ade13d235 Implement RESV limit targets for INJECTOR wells. 2015-02-16 11:08:57 +01:00
Markus Blatt
60cdc583ae Make right hand passed to the linear solver consistent.
Previously, we had to use two layers of overlap cells such the
innermost layer contains the rightvalues automatically (as it is
surrounded by internal edges). No we use communication to get
the correct values in the whole overlap region and one layer
suffices as it should.
2015-02-12 21:33:41 +01:00
Markus Blatt
01ea7bacba Adds data redistribution capabilities and makes sim_fibo_ad_cp parallel.
With this commit we add the possibility to start with a global representation
of a simulator that is read on each process and afterwards this presentation
is redistributed among the processors together with the properties and
state data needed to initialize the simulation.

There still is no parallel well handling and no parallel output. But with the
equilibrium example of @dr-robertk and deactivated output we can already
perform parallel runs.
2015-02-12 21:33:41 +01:00
Markus Blatt
fc137afcd5 Adds a constructor to BlackoilPropsAdFromDeck that allows copy the grid independant part.
In the parallel simulator we will have to be able adress only poperties on
some part of the global grid. To create thos properties we need to be able
to copy the grid independant data of the properties object and resize the rest.
This commit adds a construct taking a properties object for reading and a
new number of cells to accomplish this.
2015-02-12 21:33:41 +01:00
Joakim Hove
c021b66c18 The stream::open() functions require c_str() 2015-02-12 17:25:40 +01:00
Markus Blatt
70fb0e7b79 Store the boost::any of ParallelIstlInformation by value.
During the constructor the underlying object only holds smart
pointers and an empty vector. The FullyImplicitBlackoilSolver
obtains  a reference to it from the NewtInterationInterface instances.
Therefore copying boost::any and storing it by value should be cheap
and safe.
2015-02-12 14:04:53 +01:00
Markus Blatt
d1239d0a35 Adds space between parameters and stops eliding zeros. 2015-02-12 10:41:45 +01:00
Markus Blatt
be7221aa9b Moved output parameters to the end of the list in extractParallelGridInformationToISTL 2015-02-12 10:41:44 +01:00
Markus Blatt
11848acf0c Added braces around else statement (coding guidelines) 2015-02-12 10:41:44 +01:00
Markus Blatt
a37421d2ad Rely on delete being null safe. 2015-02-12 10:41:44 +01:00
Markus Blatt
bf281a74b8 Make symbol extractParallelGridInformationToISTL available if CpGrid is there. 2015-02-12 10:41:44 +01:00
Markus Blatt
dd63c2489f Do not reimplement null_deleter from dune-common.
Instead we use Dune::stackobject_to_shared_ptr to create a
shared_ptr that does not delete the pointer.
2015-02-12 10:41:44 +01:00
Markus Blatt
39a6e19099 Fixes compilation issues when no MPI is available. 2015-02-12 10:41:44 +01:00
Markus Blatt
11cb82e815 Correctly compute the global number of cells and pore volume. 2015-02-12 10:41:44 +01:00
Markus Blatt
70d5d18560 Prevent copying of a matrix. 2015-02-12 10:41:44 +01:00
Markus Blatt
b73f1c86fc Fixed typos in documentatio of deleter. 2015-02-12 10:41:44 +01:00
Markus Blatt
a7f1614f63 Adds copyright declarations and more documentation. 2015-02-12 10:41:44 +01:00
Markus Blatt
ff9b8d790d Added a parallel version for computing the global reductions. 2015-02-12 10:41:44 +01:00
Markus Blatt
4527ce8ffd Add access to the underlying information about the parallelization.
We need it serveral places and all of them seem to have access to
NewtonIterationBlackoilInterface. This makes it natural to give access
to it and prevent users from having to forward it manually at several
places in the simulator driver.
2015-02-12 10:41:43 +01:00
Markus Blatt
221565f038 Enable the use of parallel dune-istl solvers.
As with opm-core we use boost::any to provide additional
information about a parallel run. It is used to set a
ParallelISTLInformation object and and fill it with the
information obtained from a parallel Cpgrid.

Note that the simulator currently compiles sucessfully. Still,
we have to test the runs and do debugging.
2015-02-12 10:41:43 +01:00
Joakim Hove
02b682ea52 Merge pull request #297 from qilicun/support_minpvf
support MINPVF.
2015-02-12 09:34:35 +01:00
Liu Ming
3ddb930d1f Adapt to api changes of opm-parser. 2015-02-12 16:16:07 +08:00
Robert K
0f20e187a6 typos and minor changes. 2015-02-11 13:26:57 +01:00
Robert K
61144a73af Vector --> Container since we also read/write strings. 2015-02-11 13:18:07 +01:00
Robert K
2520aab0a1 added warning when restore file couldn't be opened. 2015-02-11 13:18:07 +01:00
Robert K
c6400fd30a SimulatorFullyImplicitBlackoilOutput: warn when end of file was reached. 2015-02-11 13:18:07 +01:00
Robert K
a834e55f5a BlackoilOutputWriter: added support for backup and restore.
This first implementation is mainly to support faster debugging.
2015-02-11 13:18:07 +01:00
Robert K
0323624e3e convergenceReduction: remove warning. 2015-02-10 13:08:16 +01:00
Liu Ming
6cd0c47b94 support MINPVF. 2015-02-09 11:27:10 +08:00
Robert K
2068b7ea16 Revision of black oil output. Put everything into a class following the OutputWriter
interface.
2015-02-05 14:39:47 +01:00
Tor Harald Sandve
2f32afd36d Hardcode bhp limit for WCONHIST/RESV to 1 atm.
TODO: Allow WELTARG to change the bhp limit
2015-02-05 09:41:37 +01:00
Andreas Lauser
ff09e87787 add the glue code required for temperature dependent viscosity 2015-02-03 15:27:38 +01:00
Atgeirr Flø Rasmussen
3d8209abe4 Merge pull request #283 from blattms/restructure-newton-convergence-for-parallelization
Restructure newton convergence for parallelization
2015-01-30 15:38:25 +01:00
Markus Blatt
60c0f30388 Use const where appropriate and polish code formatting. 2015-01-30 15:26:55 +01:00
Markus Blatt
9d2d942396 Prevent copying of pore volume vector. 2015-01-30 15:26:33 +01:00
Markus Blatt
267bf39e4a Use idx to access to access the phases.
In cases where not all phases are active, there no phase positions for
inactive phases and the computation may crash.
2015-01-30 15:23:12 +01:00
Atgeirr Flø Rasmussen
e6a053a392 Merge pull request #291 from blattms/fixes-issue-290
Fixes raisal of assertion in Eigen because of empty vector and matrices. Fixes #290
2015-01-30 15:12:48 +01:00
Atgeirr Flø Rasmussen
a8b715893f Merge pull request #289 from totto82/vap_der
Include derivatives of vappars
2015-01-30 15:06:16 +01:00
Atgeirr Flø Rasmussen
69c1a660a8 Merge pull request #287 from qilicun/update_pv
Use original grid cell volume to compute pore volume.
2015-01-30 15:00:34 +01:00
Markus Blatt
7c8f992a2d Fixes raisal of assertion in Eigen because of empty vector and matrices.
Apparently Eigen cannot handle empty containers during reserve correctly.
Therfore we check for the size of the vector and if it is zero simply create
empty jacobians.

Closes #290
2015-01-29 17:14:09 +01:00
Tor Harald Sandve
b57ddf1b2d Include derivatives of vappars
The derivatives of the vappars are included in the Jacobian.
To avoid inf derivatives for vap<1, the oil saturation is restricted
from below by sqrt(epsilon).
2015-01-29 13:08:52 +01:00
Liu Ming
3ab3dc555a Use original grid cell volume to compute pore volume. 2015-01-29 16:25:17 +08:00
Markus Blatt
d27e522ba4 docu fix (???) -> tempV. 2015-01-28 19:17:25 +01:00
Markus Blatt
3fcb99c27a Fixes wrong indexing for residual_.material_balance_eq.
Curiously, this indexes differently from  other stuff. It
uses the phase index and not the index within the phases
that are present.
2015-01-28 19:11:13 +01:00
Markus Blatt
cb9048d928 Only compute the sum of B for one phase and not over all phases. 2015-01-28 19:10:24 +01:00
Markus Blatt
f5ed31d128 Fixes rotated function parameters during function call.
There was a mixup in the order of the function parameters, both in
the declaration and in the actual function call. This commit resolves this.
2015-01-28 19:08:48 +01:00
Markus Blatt
0b18e6a15f Improve documentation of convergenceReductions. 2015-01-28 16:54:28 +01:00
Markus Blatt
2209170c15 Use the already queried active phase index directly instead of looking it up each time. 2015-01-28 16:40:23 +01:00
Markus Blatt
622c8825a9 Correctly initialize the Eigen arrays.
Previously, we just called the default constructor. Of course this does not allocate
any memory and we experienced segmentation faults. With this patch we correctly
allocate the arrays by passing the number of row and columns to the constructor.
2015-01-28 16:38:10 +01:00
Markus Blatt
20b6fb0853 Fixes typo: residuum -> residual 2015-01-27 14:05:38 +01:00
Markus Blatt
f820e1d441 Moves calculation of the total pore volume into convergenceReduction.
It is a global reduction in the parallel case and should therefore be
computed together with the other ones.
2015-01-27 12:49:55 +01:00
Markus Blatt
5e94e2ab08 Renames residuals() to computeResidualNorms()
It took me quite some time to understand the computations done
e.g. during the detection of oscillations, where the stuff returned
by residuals() is used as a vector of doubles. It turns out that
residuals() actually returns the norm of the residuals. To clarify this
we rename residuals() to computeResidualNorms() and residuals to
residual_norms. Having my dare devil day today, I even try to document the
method. (This documented method might feel kind of lonely between the others,
now;). Hopefully this saves others some time.
2015-01-27 12:04:46 +01:00
Markus Blatt
ddc2b820a7 Factors out the reduction part into a separate function.
Theses reductions are global and will require a different
behaviour in the parallel case.
2015-01-27 10:31:30 +01:00
Markus Blatt
0b81cd8f6f Reduces code duplication and reorganizes code when checking convergence.
The computations made to check the convergence are the same for all existing
phases. Therefore this patch uses loops over the phase indices when cmputing
them,

In the convergence check there are several reductions (maxCoeff(), sum())
that will trigger communication in a parallel run. This patch seperates the
reductions from the other computations. The idea is to one reduction for the
reductions that need to done as global communication is expensive.
2015-01-27 10:31:30 +01:00
Bård Skaflestad
7dfcf7b0c0 Merge pull request #282 from atgeirr/fix-wellstate-init
Fix issues in WellStateFullyImplicitBlackoil::init().
2015-01-26 23:12:12 -06:00
Atgeirr Flø Rasmussen
ce3519dadb Fix issues in init().
- Failed to set all rates to zero initially.
 - Could set out-of-bounds index if number of controls changed.
2015-01-26 16:46:51 +01:00
Robert K
3416cba92a added white space after comma. 2015-01-26 12:43:25 +01:00
Robert K
894983fc7b FullyImplicitBlackoilSolver: add max_residual_allowed parameter to restart solver when
residual is to large.
2015-01-26 12:43:25 +01:00
Robert K
8f29cae4cb FullyImplicitBlackoilSolver: throw Opm::NumericalProblem when one of the residuals is
NaN.
2015-01-26 12:43:25 +01:00
Tor Harald Sandve
7bf7b52dd8 Only copy perfPhaseRates if number of perforations is equal.
The number of perforations may change due to completions beeing shut.
If the number of perforations changes the perfPhaseRates are set to
equal the wellRates/(number of perforations) instead of the values from
the previous time step.
2015-01-23 14:10:10 +01:00
Robert K
0af8dd0e1d remove template keyword. 2015-01-20 14:27:37 +01:00
Robert K
4b551421be FullyImplicitBlackoilSolver: fix dangerous usage of assert. 2015-01-20 12:55:46 +01:00
Robert K
463e4bc5e3 BlockOilSimulator: allow to run without wells (mainly for testing and debugging). 2015-01-20 11:38:46 +01:00
Markus Blatt
cb43fc5e94 Unifies the phase indices with the ones in opm-core.
The initial definition of the phase indices seems to be in
opm/core/props/BlackoilPhases.hpp. Nevertheless there were
several redefinitions of the same or similar enums (either
Aqua, Liquid, and Vapor, or Water, Oil, and Gas). Surprisingly
most often these definitions did not use the original values.
This is bound to break if there is a change upstream.

This patch limits the definition to one place in opm-autodiff,
namely opm/autodiff/BlackoilPropsAdInterface.hpp. To avoid
downstream confusion we define both the Water and Aqua triplets.
In addition we define the maximum number of phases to use at compile
time.
2015-01-19 20:18:14 +01:00
Markus Blatt
dca6b436a7 Activates transmissibilities test for CpGrid without warnings.
Tests run fine for both grids.
2015-01-15 21:27:07 +01:00
Markus Blatt
57bf00cd27 [bugfix] Fixes cellCentroidCoordinate implementation.
Somehow this was never defined for CpGrid due to a copy&paste error.
2015-01-15 21:24:35 +01:00
Markus Blatt
a3acd22f24 Implement transmissibilities using the generic GridHelpers interface. 2015-01-15 21:24:35 +01:00
Atgeirr Flø Rasmussen
656e688692 Merge pull request #272 from blattms/add-facetag-access-2
Adds free function to access the face tag to UgGridHelpers.
2015-01-15 20:30:51 +01:00
Robert K
e577b3b2d9 SimulatorFullyImplicitBlackoil: only access output parameters when output is enabled. 2015-01-15 13:31:28 +01:00
Markus Blatt
4a0fbafbcc Adds free function to access the face tag to UgGridHelpers.
It uses the iterator over the cell faces to identify the face tag
in constant time.
2015-01-13 20:31:13 +01:00
Robert K
7fd9895a12 Merge remote-tracking branch 'upstream/master' into PR/EclipseWriter-revision-to-write-substeps 2015-01-12 12:35:22 +01:00
Tor Harald Sandve
088cac6801 BUGFIX: Avoid inclusion of disgas in the vapoil contribution
A temporary copy is added to avoid inclusion of dissolved gas when the
vaporized oil contribution is added in the accumulation term for the oil
phase.
2015-01-12 07:19:18 +01:00
Robert K
6b4a63787d cleanup of unused code. 2015-01-09 16:27:37 +01:00
Robert K
f11d1758c1 also write initial data when using adaptive time stepping. 2015-01-09 16:26:48 +01:00
Robert K
a9edc45a49 Added flag for matlab output. default behavior is the same as before.
Also, avoid possibly uninitialized variables.
2015-01-09 16:26:30 +01:00
Robert K
e7e63e1989 make writing of substeps work 2015-01-09 16:26:30 +01:00
Atgeirr Flø Rasmussen
7a3008db72 Merge pull request #265 from totto82/fix_stoppedwells2
Account for the renaming in the wellsManager
2015-01-09 13:16:37 +01:00
Tor Harald Sandve
eefac9584e Add on overload of computePressure() that accepts explicit saturations
The overload is used direcly in variableState() to clean the code as
well as in the orignal computePressures(state) implementation.
2015-01-07 12:46:12 +01:00
Tor Harald Sandve
23f1f443fc Fix the fall out in case of missing gas phase 2015-01-07 08:34:08 +01:00
Tor Harald Sandve
5572a14c20 Account for the renaming in the wellsManager
Shut is renamed to stopped in the wellsManager in order to better
reflect the name logic in the deck. This PR implements the nessesary
change in opm-autodiff
2014-12-19 07:18:36 +01:00
Tor Harald Sandve
0a0a3b2ba6 Use phase pressures for the fluid properties
There has been an inconsitancy in which pressure to use in the
evaluation of the fluid properties.
With this commit the phase pressure is used for all the evaluation of
the fluid properties.
2014-12-18 08:51:08 +01:00
Atgeirr Flø Rasmussen
e1af08c5d2 Add a generic (throwing) tpfa_loc_trans_compute_().
Without this, we may have link errors with CpGrid, since only
an UnstructuredGrid specialization was provided.
2014-12-17 10:47:16 +01:00
Atgeirr Flø Rasmussen
1348658507 Merge pull request #249 from totto82/locTrans
Compute half transmissibilities based on local coordinate system
2014-12-17 00:20:11 +01:00
Atgeirr Flø Rasmussen
28af900f0b Merge pull request #250 from dr-robertk/PR/performance-avoid-zero-matrix-entries
Further performance improvement by avoiding zeros in matrix-matrix product.
2014-12-16 14:12:14 +01:00
Tor Harald Sandve
25a4bb5fbe Add contribution from region multipliers
The multiplier contribution from the getRegionMultiplier is added to the
face multipliers. The getRegionMultiplier method is called with the cell
index on both side of the face in order to return the correct region
multiplier across faults.
2014-12-10 11:46:49 +01:00
Tor Harald Sandve
6ae7f460ff Implement code style comments 2014-12-10 07:34:56 +01:00
Tor Harald Sandve
02724b7f7a Implement comments for PR#249
1) Add the possibility for the user to chose between local and global
coordinate permeability in the transmissibility calculations.
2) Trow for CpGrid
3) Add default for switch
2014-12-10 07:29:05 +01:00
Tor Harald Sandve
b11534b137 Compute half transmissibilities based on local coordinate system
hTrans(cellFaceIdx) = K(cellNo,j) * sum( C(:,i) .* N(:,j), 2) /
sum(C.*C, 2),
Only for diagonal tensors, off-diagonal permeability values are ignored
without warning
2014-12-10 07:29:05 +01:00
Atgeirr Flø Rasmussen
2bfb928c14 Merge pull request #247 from andlaus/RateConverter_remove_averageTemperature
RateConverter: remove the unused averageTemperature() method
2014-12-08 11:01:09 +01:00
Robert K
5287c54c1d fix parameter order for SeqILUn. 2014-12-05 15:03:59 +01:00
Robert K
8fecf98f37 [cleanup] remove commented code. 2014-12-05 14:50:55 +01:00
Robert K
230447bea0 [cleanup] I revert the sort call to QuickSort again since it's faster on my machine. 2014-12-05 14:48:16 +01:00
Robert K
9a2a95c6eb This commits allows for flexible choice of either ILU(0) or ILU(n) where n is a
dynamical parameter given in the parameter file. The default is 0 (as before).
In addition the relaxation parameter has been added to the parameter with the
default preserving the state from before.
Also, the default parameter for use_amg and use_bicgstab in the constructor of
CPRPrecondition have been removed.
2014-12-05 14:03:58 +01:00
Atgeirr Flø Rasmussen
cda742ab0e Redo commit 6f55c862 after rebasing. 2014-12-05 13:10:33 +01:00
Atgeirr Flø Rasmussen
5b6765f9d8 Use fastSparseProduct() in place of Eigen's product. 2014-12-05 13:09:46 +01:00
Atgeirr Flø Rasmussen
c43b9f4a22 Use fastSparseProduct(), do not use hijacked Eigen header. 2014-12-05 13:09:46 +01:00
Atgeirr Flø Rasmussen
e8b3524ffa Add Robert Kloefkorn's fast sparse product implementation. 2014-12-05 13:08:30 +01:00
Robert K
6f55c862ce move Index query into if. 2014-12-04 17:55:29 +01:00
Robert K
cbfb4f0489 remove typename. 2014-12-04 14:01:06 +01:00
Robert K
855c278197 cleanup 2014-12-04 12:46:46 +01:00
Robert K
5583585063 Merge branch 'PR/performance-avoid-zero-matrix-entries' of ssh://github.com/dr-robertk/opm-autodiff into PR/performance-avoid-zero-matrix-entries
Conflicts:
	opm/autodiff/ConservativeSparseSparseProduct.h
2014-12-03 15:50:41 +01:00
Robert K
0495aaae8f if one of the matrices involved does not contain nonZeros, we can leave the product
routine.

Conflicts:
	opm/autodiff/ConservativeSparseSparseProduct.h
2014-12-03 15:49:26 +01:00
Robert K
21a9a7c446 avoid multiplication with empty matrices. 2014-12-03 15:48:43 +01:00
Andreas Lauser
1b22d3ab6b RateConverter: add missing call to averageTemperature()
thanks to [at] bska for noticing this!
2014-12-02 15:56:17 +01:00
Robert K
54feee5987 avoid the multiplication with zero matrix entries. 2014-12-02 14:57:00 +01:00
Robert K
054d4f4dcb include vector to make compile on proprietary systems. 2014-12-02 14:15:17 +01:00
Robert K
efe8ee79f9 added collapseJacs method. 2014-12-02 12:39:21 +01:00
Robert K
2ac6a211b2 use correct types of SparseMatrices. 2014-12-02 12:39:21 +01:00
Robert K
a266e98bac added some comment about sort. 2014-12-02 12:39:21 +01:00
Robert K
c51a794cac overloaded ConservativeSparseSparseProduct to speed up matrix-matrix multiplication. 2014-12-02 12:39:17 +01:00
Robert K
3f821f1d5f overloaded ConservativeSparseSparseProduct to speed up matrix-matrix multiplication. 2014-12-02 10:40:48 +01:00
Andreas Lauser
4e3a69cc90 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:02 +01:00
Robert K
9cffb51543 [bugfix] use SparseLU when UMFPack was not found. 2014-11-19 11:22:57 +01:00
Atgeirr Flø Rasmussen
933cfaf666 Improve performance of CPR preconditioner.
This restores the performance to approximately the level it had before
the change to support non-diagonal well jacobians, for SPE9. All changes
are to the eliminateVariable() method.
 - Explicitly compute and apply the inverse.
 - Change loop ordering to apply inverse only num_eq - 1 times, instead
   of (numeq - 1)^2.
 - Use UmfPackLU instead of SparseLU.
2014-11-13 16:56:11 +01:00