Commit Graph

310 Commits

Author SHA1 Message Date
Markus Blatt
07318edfa1 Added a parallel aware logger for switching wells.
It will collect all the switches. Afterwards they are collect on
the root process and logged there.

This commit includes a small test program.
2016-10-05 10:33:15 +02:00
Markus Blatt
66f0b71fc1 Log the message of exceptions in the catch clause of adaptive time stepper. 2016-10-04 10:33:56 +02:00
Tor Harald Sandve
e034bbc7ad Add initalizer for adaptiveTimeStepper that uses values from TUNING
Some of the tuning values from the TUNING keywords is used to tune the
timestepping.
2016-09-30 10:36:30 +02:00
Andreas Lauser
83a9f6ffce threshold pressure defaults: calculate the pressure difference like when computing the fluxes
this should not change the value of the result at all (because the
total delta which is added to the phase pressures stays identical),
but it should be less confusing when comparing this with the code that
calculates the gravity correction term in the flux calculation.
2016-09-28 16:57:34 +02:00
Andreas Lauser
000fde19dc threshold pressures: simplify code for the density calculation a bit 2016-09-28 16:57:34 +02:00
Andreas Lauser
4f4d7531af threshold pressure: be more cautious when acessing the defaults
maybe it worked as-is, or maybe decks which lead to illegal accesses
to the map are incorrect (i.e., they specify threshold pressures for
EQUIL-regions that do not touch), but let's play save here...
2016-09-28 16:56:54 +02:00
Andreas Lauser
662d6e28cd threshold pressures: properly consider the dissolved components for the density
even if a phase is saturated, the dissolved component must be
considered when calculating the fluid density.
2016-09-28 16:55:15 +02:00
Andreas Lauser
ae3248da8b threshold pressure: use phase pressure instead of reference pressure...
... to calculate phase densities for the threshold pressure
defaults. I don't know if the reference simulator does this, but this
makes it consistent with what's done in the flux calculation of flow.
2016-09-28 16:54:00 +02:00
Markus Blatt
815480d052 Only call writeTimeStep for real sub steps.
Previously, we also called it when the full time step was done.
As the simulator writes that information anyway and we cannot call
it a sub step, we omit the final write in the adaptive time stepper.
2016-09-26 11:51:17 +02:00
Tor Harald Sandve
4c4b5233c0 Guard against non-existing file 2016-09-21 13:46:31 +02:00
Tor Harald Sandve
1bde4f4a22 Small fixes hardcodedTimestepControl
-- avoid using eof()
-- add comments
-- no longer assumes two lines of comments.
-- revert change to default value for timestep.initial_step_length
-- make contructer explicit
-- pass reference
2016-09-21 09:39:36 +02:00
Tor Harald Sandve
380fe6e2fd Timestepper based on userInput
A new timestepper that reads timesteps from a file generated using
ecl_summary "DECK" TIME
and applies it to the simulator

Also a parameter timestep.initial_step_length (default 1 day) is added
to controll the frist timestep.
2016-09-21 09:39:36 +02:00
babrodtk
63da817852 Initial version for outputting cell data 2016-09-01 14:37:41 +02:00
Pål Grønås Drange
bd58792714 TransMult, Init, and SimConfig are references, applyModifierDeck takes reference, and EclipseState constructor too 2016-08-08 10:07:09 +02:00
Atgeirr Flø Rasmussen
d31081992b Merge pull request #1052 from andlaus/pass_timer_instead_of_dt
pass the timer object instead of the time step size to the simulators
2016-08-02 11:05:33 +02:00
Liu Ming
61889dafbd fix indentation. 2016-07-14 10:30:20 +08:00
Liu Ming
62134b4a0f drop useage of std::numeric_limits 2016-07-14 10:27:13 +08:00
Andreas Lauser
0dda8d49c5 pass the timer object instead of the time step size to the simulators 2016-07-05 12:23:55 +02:00
Kai Bao
02a3ba39b5 adding a initialStep() function to SimulatorTimer
to indicate if the current step is the inital step.
2016-07-04 11:12:53 +02:00
Liu Ming
b8ef9cb630 output well iterations if it is a valid number. 2016-06-30 09:03:30 +08:00
Liu Ming
30d9c34481 Add space. 2016-06-28 15:26:06 +08:00
Liu Ming
b1b464535a output well iterations and non-linear iterations. 2016-06-28 13:40:32 +08:00
Liu Ming
6097a14b0e get current date time. 2016-06-21 11:25:05 +08:00
Liu Ming
63f244a36d mark time stepping messages type as OpmLog::note 2016-06-21 08:44:32 +08:00
Jørgen Kvalsvik
71560b5fb2 BlackoilOutputWriter rewritten to use opm-output
Changes to BlackoilOutputWriter as mandated by the split and rewrite of
opm-output. Notable changes:

* BlackoilOutputWriter is no longer a child class of OutputWriter.
* Minor interface changes; writeTimeStep requires a Wells pointer
* restore requires a Wells* pointer
* VTK/Matlab support rewrites; no longer inherits OutputWriter
* WellStateFullyImplicitBlackoil::report added, to write its data to a
  opm-output understood format

Relies on utility/Compat.hpp for quick conversion to the opm-output
defined formats.
2016-06-07 10:15:07 +02:00
Jørgen Kvalsvik
18fda2d7f0 WellState::report() to make opm-output Well data 2016-06-06 12:40:44 +02:00
Liu Ming
248ea780b3 add missing braces. 2016-05-16 09:04:54 +08:00
Liu Ming
a4dc135045 use OpmLog only for error messages. 2016-05-10 14:13:33 +08:00
Liu Ming
40dbcc496a output timer messages for terminal and log file. 2016-05-09 13:31:04 +08:00
Liu Ming
cabfffe25d use ostream not std::cout directly. 2016-05-09 13:30:28 +08:00
babrodtk
a1504a2bff Runs first iterations of two-phase case plausibly 2016-04-26 07:49:12 +02:00
Atgeirr Flø Rasmussen
a031c25ced Re-enable output for 2-phase sims.
This was disabled when the facilities were moved to opm-output.
Now that the simulators are in the opm-simulators module and not
opm-core we can re-enable it.
2016-04-14 13:08:24 +02:00
Pål Grønås Drange
170a71eef8 Using API get3DProperties. 2016-04-14 11:37:27 +02:00
Atgeirr Flø Rasmussen
be67e0f7a5 Update include file locations. 2016-04-14 11:32:08 +02:00
Kjell W. Kongsvik
a15085ad7d Replace comment with "ifdef DISABLE_OUTPUT" 2016-03-29 14:57:58 +02:00
Kjell W. Kongsvik
3614defbd9 Commented out usage of OutputWriter in simulator 2016-03-29 14:56:25 +02:00
Joakim Hove
e843461b37 Merge pull request #962 from joakim-hove/remove-simulator-state
Replaced SimulatorState -> SimulationDatacontainer
2016-03-29 13:16:19 +02:00
Joakim Hove
b42700c6a8 Replaced SimulatorState -> SimulationDatacontainer
Have removed the SimulatorState base class, and instead replaced with
the SimulationDatacontainer class from opm-common. The SimulatorState
objects were typcially created with a default constructor, and then
explicitly initialized with a SimulatorState::init() method. For the
SimulationDataContainer RAII is employed; the init( ) has been removed -
and there is no default constructor.
2016-03-29 10:44:49 +02:00
Robert Kloefkorn
65d4127f4e SimulatorTimerInterface: include missing header for unique_ptr. 2016-03-29 10:42:03 +02:00
Robert Kloefkorn
f9f13143a2 SimulatorTimers: added method clone to allow for copying of the objects. 2016-03-29 10:34:16 +02:00
Andreas Lauser
bf283f8684 threshold pressures: consider the saturated case and fix a typo
the typo was caused the surface density of the oil phase to be used
instead of the one of gas. This caused the density to be off by a
factor of typically about 900.

using saturated FVFs does not change much, but it does not hurt
because it is also done that way in the simulator.

This makes the defaults for the threshold pressures reasonable again,
but for some reason they are not exactly the same as in the old
implementation. (although the differences are very tolerable.)

On the question why only "Model 2" is affected by this: the other
decks don't use threshold pressures (SPE-X) or do not default any
values (Norne).
2016-03-08 14:52:09 +01:00
Andreas Lauser
1f1dfbfc65 replace the blackoil PVT classes by the ones of opm-material
the opm-material classes are the ones which are now used by
opm-autodiff and this patch makes it much easier to keep the opm-core
and opm-autodiff results consistent. Also, the opm-material classes
seem to be a bit faster than the opm-core ones (see
https://github.com/OPM/opm-autodiff/pull/576)

I ran the usual array of tests with `flow`: SPE1, SPE3, SPE9 and Norne
all produce the same results at the identical runtime (modulo noise)
and also "Model 2" seems to work.
2016-03-05 19:11:44 +01:00
Atgeirr Flø Rasmussen
cb41a45687 Remove unused 'restart' parameter from SimulatorTimer::init(). 2016-02-29 11:03:08 +01:00
Atgeirr Flø Rasmussen
5bb705fda8 Merge pull request #953 from andlaus/const_gridproperties
fix the build
2016-02-19 11:46:32 +01:00
Jørgen Kvalsvik
369050cc9c Change Deck access methods/types to references
opm-parser#677 changes the return types for the Deck family of classes.
This patch fixes all broken code from that patch set.

https://github.com/OPM/opm-parser/pull/677
2016-02-18 08:50:26 +01:00
Andreas Lauser
e775df6d23 fix the build
it broke because EclipseState::get*GridProperty() now returns a
pointer to a constant object.
2016-02-15 15:06:05 +01:00
chflo
d43f109770 OPM-251: Support for restart 2016-01-04 16:11:21 +01:00
Tor Harald Sandve
153365f4d0 Adapt to changes in the NNC class 2015-12-08 13:03:15 +01:00
Tor Harald Sandve
298442c281 Cleanup after rebase
- cleanup of some rebase mess
- Added comments
- Use the maxDp for the NNCs
- remove misplaced break in the pinchprocessor
2015-12-08 09:50:07 +01:00
Tor Harald Sandve
5b1f249f96 Calculate thresholdPressures for the NNCs 2015-12-08 09:25:35 +01:00
Atgeirr Flø Rasmussen
7edd081175 Silence some warnings. 2015-12-01 13:36:08 +01:00
Andreas Lauser
7e05127c48 thresholdPressures(): move the code which calculates the maximum gravity corrected pressure difference between EQLNUM regions to its own function
requested by [at]atgeirr
2015-11-13 15:36:50 +01:00
Andreas Lauser
77893e415e thresholdPressures(): split several long lines
as requested by [at]atgeirr
2015-11-13 15:13:28 +01:00
Andreas Lauser
f13e7fd300 thresholdPressures(): constify all local variables which can be made constant
I have doubts if this will change anything in the binaries (and in my
personal opinion, these 'const's look quite ugly and are sometimes a
(small) annoyance when debugging), but I don't mind using the coding
style used by most of the rest of opm-core here.
2015-11-13 15:13:15 +01:00
Atgeirr Flø Rasmussen
0de2cff986 Follow class renaming. 2015-11-13 11:37:53 +01:00
Robert Kloefkorn
d3af817ff2 timeError --> relativeChange. 2015-11-10 09:53:40 -07:00
Robert Kloefkorn
005a0c2930 AdaptiveTimeStepping: pass object to compute time error to time step control. This
allows us to shift the computation of the error to the physical model.
2015-11-10 09:45:07 -07:00
Andreas Lauser
3ccc0b5aa0 THPRES: only update the threshold pressure between regions if the saturation of the upstream cell is larger than the residual saturation
before it was 0. Again, thanks to [at]totto82 for the suggestion.
2015-11-05 15:39:29 +01:00
Andreas Lauser
df9a927c5b THPRES: change the sign of the gravity correction
we're correcting the pressure at the cell center depths to get the
pressure at the face depth, not the other way around. This is
confusing...

thanks to [at]totto82 for discovering this.
2015-11-05 12:29:19 +01:00
Andreas Lauser
028cd32f11 fix a compressed vs logically Cartesian cell index bug
PVTNUM is for logically Cartesian indices, but was accessed by
compressed ones.
2015-11-05 12:29:19 +01:00
Andreas Lauser
6d86e9bd20 implement determining the threshold pressure from the initial condition
This needs to be done if a equilibration region transition is
mentioned by the THPRES keyword, but no value is given for this record
in the third item. (it seems that this is used quite frequently.)

Also, the approach taken by this patch also does not collide with the
restart machinery as far as I can see. This is because the initial
condition is applied by the simulator before the state at the restart
time is loaded. (I interpreted the code that way, but I could be
wrong, could anyone verify this?)

since it is pretty elaborate to calculate initial condition, this
patch is pretty messy. I also do not know if Eclipse does include
capillary pressure in this calculation or not (this patch does). Huge
kudos go to [at]totto82 for reviewing, testing and debugging this.
2015-11-05 12:29:19 +01:00
Andreas Lauser
2399629ebc use the error macros from opm-common 2015-10-08 11:42:15 +02:00
Andreas Lauser
13fd63e2b3 use the error macros from opm-common 2015-10-08 11:42:15 +02:00
Robert Kloefkorn
4f8906c5fc AdaptiveTimeStepping: also apply terminal output to solver_verbose. 2015-09-16 15:19:19 +02:00
Robert Kloefkorn
8c93936fd5 AdaptiveTimeStepping: pass variable terminal output to avoid multiple outputs in
parallel.
2015-09-16 14:33:35 +02:00
Tor Harald Sandve
6d28f19009 Change default values
- use time stepping algorithm pid instead of pid + iter
Adjusting the time-steps on the number of linear iterations does
currently not give any improvents on the time-stepping.
- Change the pid tolerance. The time-stepper will take longer time-steps
and thus reduce the simulation time significantly. The Norne and the SPE
results does not degrade
- Less aggressive reduction of time-steps after convergence problems
2015-09-08 10:56:58 +02:00
Tor Harald Sandve
dbce88aa2c Limit the timestep growth for all timestepping algorithm
The time step restriction is moved to AdaptiveTimeStepping_impl.hpp to
make it apply to all time-stepping algorithms.
2015-09-03 12:52:47 +02:00
Markus Blatt
4c0189f917 [bugfix] Allow querying the current time step even if we are done.
Previously there was an assertion whether the time stepping is still
running when querying the time step. After commit 5af794cfd588b this
triggered an assertion for Norne. As there is no reason to limit querying
the current time step in this way. This commit simply removes the assertion
in AdaptiveSimulatorTimer::currentStepLength.

This closes OPM/opm-autodiff#446
2015-09-01 19:34:30 +02:00
Joakim Hove
f3dd2451d2 Using map base ThresholdPressure implementation. 2015-08-25 16:22:37 +02:00
Tor Harald Sandve
0227165bd5 Rename last_timestep_ to suggested_next_timestep_ 2015-08-25 11:16:36 +02:00
Tor Harald Sandve
81b8b631a6 Use estimated time-step instead of average in next report step 2015-08-25 06:32:39 +02:00
Fredrik Gundersen
f2b75a6a41 Updated as needed by new opm-parser functinality 2015-08-24 15:37:49 +02:00
Fredrik Gundersen
484cb0216f Added suport for new Threshold Pressure behavior 2015-08-20 13:00:01 +02:00
Atgeirr Flø Rasmussen
42464cbcb7 Match init order to member order.
In a constructor initialisation list, the order should be the same
as the order in which the variables actually are initialised, which
is given by the order they are declared in the class and not by the
order in the initialisation list.
2015-08-19 11:33:29 +02:00
Kai Bao
a7f177e35e adding command line option full_timestep_initially_
when the option is true, for each report step, the size of the adaptive
time step always beginning with the size of the report step.
2015-08-17 15:56:31 +02:00
Atgeirr Flø Rasmussen
2dfbb4ed82 Correct comment. 2015-08-17 13:02:37 +02:00
Atgeirr Flø Rasmussen
e41b766780 Catch MatrixBlockError in the adaptive time stepper.
This can be thrown by the ILU0 preconditioner when using the
interleaved solver approach.
2015-08-17 12:59:31 +02:00
chflo
b3b0b427ab Reverse changes that should not have been merged into master 2015-08-10 14:17:59 +02:00
chflo
bfa1d476e3 OPM-218: Write restart files at same interval as eclipse 2015-08-05 13:38:52 +02:00
chflo
84934d0c1f OPM-218: Fix Flow vs Eclipse restart interval write differences: Override method from SimulatorTimerInterface 2015-07-27 13:26:28 +02:00
chflo
d0af851f8e OPM-218: Fix Flow vs Eclipse restart interval write differences: Added new method to SimulatorTimerInterface 2015-07-27 13:25:33 +02:00
Atgeirr Flø Rasmussen
9f721bbe9a Silence multiple warnings.
Also add more warnings to the disabling list of disable_warnings.h.
2015-05-28 14:05:09 +02:00
Atgeirr Flø Rasmussen
fcd637896c Suppress a warning in serial mode. 2015-05-27 11:41:52 +02:00
Markus Blatt
845de266ee Update copyright 2015-05-27 11:07:16 +02:00
Markus Blatt
384ef84556 Makes the time step control parallel.
The only stage where parallelism changes the adaptive time
stepping is when some inner products on the saturation and
pressure are computed.
This commit makes this part parallel by added an additonal boost::any
parameter to the time stepping and the controller. Per default this
is empty. In a parallel run it contains a ParallelIstlInformation object
encapsulating the information about the parallelisation. This then used
to compute the parallel inner product.
2015-05-27 11:07:16 +02:00
Atgeirr Flø Rasmussen
b6d5a3cad5 Adjust parameters after testing. 2015-04-22 13:03:19 +02:00
Atgeirr Flø Rasmussen
2dc02043e2 Modify default parameters to be suitable for the Norne case. 2015-04-21 11:41:45 +02:00
Tor Harald Sandve
9272f2d8bf Add dune/istl/istlexception.hh to header
Fix to make it compile with dune-istl 2.2
2015-04-10 14:03:27 +02:00
Robert Kloefkorn
7f6008a80e AdaptiveTimeStepping: also catch ISTLError casued in AMG when time step is to large. 2015-03-30 11:07:08 +02:00
Atgeirr Flø Rasmussen
4cc0f7ef6d Suppress unused argument warning. 2015-02-17 10:27:44 +01:00
chflo
761b9b4a41 opm-166: Changes after review 2015-02-16 11:59:16 +01:00
chflo
33078d00e3 OPM-166: Use SimulationConfig instead of Deck to get threshold pressure 2015-02-16 08:43:47 +01:00
Robert K
4a885989dd AdaptiveTimeStepping: remove initial_fraction (use restart factor instead) and use
average of previously used time steps to suggest next time step.
2015-02-10 13:10:39 +01:00
Robert K
26f113b649 AdaptiveSimulatorTimer: -improvement in time step adjustment near end of time interval
-max time step parameter

PIDTimeStepControl --> TimeStepControl:
- added simple iteration count time step control
- bug fix in PIDAndIterationCountTimeStepControl

AdaptiveTimeStepping: apply the above changes.
2015-02-06 13:59:50 +01:00
Robert K
e84325a0a7 make documentation equal for all three classes. 2015-01-28 15:46:11 +01:00
Robert K
f771becf25 SimulatorTimer...: added method advance which is the new interface for previously used
operator++.
2015-01-28 15:25:11 +01:00
Robert K
ae683efcfc AdaptiveTimeStepping: make output more easy to read. 2015-01-16 16:08:59 +01:00
Robert K
15c2e91730 AdaptiveTimeStepping: Switch suggested time step to max of the previous taken substeps. 2015-01-16 16:08:59 +01:00
Robert K
04e8533cee AdaptiveSimulatorTimer: initialization of first time step size follows the same rule as
for later steps.
PIDTimeStepControl: added maxgrowth factor which indicates the maximum allow groth of
                    the time step from one to the next value.
2015-01-16 16:08:59 +01:00
Robert K
aa66a4304f EclipseWriter: remove leftovers of WriterTimer.
AdaptiveSimulatorTimer: use back instead of rbegin.
2015-01-15 11:34:59 +01:00
Joakim Hove
a2ae3baea3 Protecting against use of unassigned deck values. 2015-01-14 11:41:41 +01:00
Robert K
757bc67b80 cleanup: reportStepIdx --> writeStepIdx.
startDate     --> startDateTime
         removal of debug output.
2015-01-09 16:22:03 +01:00
Robert K
25af9e0033 - adjust OutputWriter to SimulatorTimerInterface
- remove WriterTimer from EclipseWriter and use SimulatorTimerInterface
- adjust to the above in AdaptiveTimeStepping.
2015-01-09 16:22:03 +01:00
Robert K
be69c4c10e Introduce an interface for SimulatorTimer and AdaptiveSimulatorTimer.
currentDateTime and currentPosixTime are default implementations.
2015-01-09 16:21:20 +01:00
Robert K
aa9fe2a631 EclipseWriter: allow for writing of substeps in addition to report steps. 2015-01-09 16:21:03 +01:00
Andreas Lauser
349a24fab1 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
1c5e4e9ef3 Suppress unused argument warning. 2014-11-05 07:51:21 +01:00
Robert K
f16f4a2e98 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
Robert Kloefkorn
16624f6f4e address Atgeirs comments. 2014-10-20 12:32:11 +02:00
Robert Kloefkorn
40d851e89f also catch std::runtime_error, i.e. convergence of linear solver failed. 2014-10-14 15:18:36 +02:00
Robert Kloefkorn
1bda36b251 added initial fraction to initialize last_timestep. 2014-10-13 11:17:37 +02:00
Robert Kloefkorn
3b58ad9aa4 Two small adjustments that came up when running in debug mode. 2014-10-10 13:55:28 +02:00
Robert Kloefkorn
246acea765 use unit::convert::to instead of hard coded 86400 factor. 2014-10-07 09:48:57 +02:00
Robert K
0e133f2cca move implementation to .cpp files. 2014-10-06 14:26:23 +02:00
Robert K
294b899ee8 the adaptive time stepping utility classes. 2014-10-06 14:06:07 +02:00
Robert K
8a17e5e5d6 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
67b42fd4f4 remove white spaces. 2014-10-03 14:14:01 +02:00
Robert K
e99158faa9 reset to old state. 2014-10-03 14:10:56 +02:00
Robert K
bfbd488e3e renamed and split advance method. 2014-10-03 13:44:05 +02:00
Robert K
0a03aea874 class for handling adaptive time steps. 2014-10-03 13:33:13 +02:00
Robert K
02e346d8cc improvement of the time step adjustment. 2014-10-02 14:04:32 +02:00
Robert K
455b066b2a sub step simulator timer. 2014-10-01 13:56:27 +02:00
Robert K
9c86ddc6bb reset master. 2014-10-01 13:55:42 +02:00
Robert K
ade58e64b9 SubStepSimulationTimer for time step control. Needs documentation and cleanup. 2014-09-30 15:55:26 +02:00
Atgeirr Flø Rasmussen
8cd6be1244 Fix minor typo in comment. 2014-08-27 18:13:15 +02:00
Atgeirr Flø Rasmussen
a21f20f462 New free function thresholdPressures(). 2014-08-27 18:07:46 +02:00
Andreas Lauser
0fe2d04708 remove EclipseGridParser compatibility methods from all classes 2014-05-21 11:22:43 +02:00
Kai Bao
500053d6aa A new SimulatorTimer Class 2014-03-26 15:53:54 +01:00
Kai Bao
54316c19c8 Output correct information for temporary use.
Change the SimulatorTimer class a little bit to output the totaltime and
current time correctly.
2014-03-24 16:41:02 +01:00
Andreas Lauser
f2e9016bd0 SimulatorTimer: allow it to be limited to a sub-range of all report steps 2014-03-19 11:36:39 +01:00
Andreas Lauser
4db4494329 SimulatorTimer: rename currentTime() to simulationTimeElapsed()
because the name "currentTime()" can be mistaken for the point in
real-life time at which the simulation is run (e.g. March 11, 2014,
15:07:45.123), the _point_ in time which the simulator timer currently
represents (e.g. Jun 5, 1985, 02:33:12.345) instead of the simulator
time in seconds which elapsed since the START date
(e.g. 52633.345 s).

this rename may lead to some fallout in other modules. I'll
fix them after this PR has been merged...
2014-03-12 19:01:58 +01:00
Andreas Lauser
caf10e0e7f SimulatorTimer: rename currentTime() to simulationTimeElapsed()
because the name "currentTime()" can be mistaken for the point in
real-life time at which the simulation is run (e.g. March 11, 2014,
15:07:45.123), the _point_ in time which the simulator timer currently
represents (e.g. Jun 5, 1985, 02:33:12.345) instead of the simulator
time in seconds which elapsed since the START date
(e.g. 52633.345 s).

this rename may lead to some fallout in other modules. I'll
fix them after this PR has been merged...
2014-03-12 19:01:58 +01:00
Joakim Hove
890cc8a188 Changed open / close behaviour of well_controls: 1) well_controls has an explicit open_close flag. 2) Will NOT flip current value to change open|close status 2014-03-04 20:23:19 +01:00
Andreas Lauser
85a0032247 SimulatorTimer: make it possible to base it on opm-parser's TimeMap
Since SimulatorTimer is a fairly shallow shim if using the TimeMap, it
can also be removed relatively easily. Having said this, that would
trigger _many_ changes in _a lot_ of places and I'm not motivated at
all to fight that battle as long as the old parser needs to be
supported. I thus decided that the best way is to add a "wrapper mode"
to SimulationTimer...
2014-02-27 12:56:23 +01:00
Joakim Hove
25750c693e Implemented well_controls based on well_controls_get_xxx() functions. 2014-01-06 15:02:19 +01:00
Roland Kaufmann
f30ab55974 Provide routine to return the step length taken
The output routine needs to know which step that has been taken in the
past (to arrive at this result), not which step to take next going
forward.
2013-11-27 00:36:17 +01:00
Roland Kaufmann
73dfe849d6 Replace unclear constant with better documentation
The step number is zero before the first timestep has been taken, and
one after. The step number is one before the second timestep has been
taken, and two after. This was not clear from the text.
2013-11-27 00:23:00 +01:00
Roland Kaufmann
29afd2c378 Report after the timestep really is completed
If we report before we increment the timer, then we will report at
a time which is at the beginning and not at the end of the timestep.
2013-11-27 00:04:45 +01:00
Roland Kaufmann
2ba7b3329d Make starting timestep more explicitly known
One-based or zero-based? Better be documented (in a way that doesn't
promote hard-coding in the clients!)
2013-11-26 12:44:37 +01:00
Roland Kaufmann
e1823dc9a7 Disable output to console if parameter quiet = true
If the standard output is not desirable, it can be suppressed and
custom output can be written through the timestep_completed event
instead.
2013-09-26 12:37:02 +02:00
Andreas Lauser
8a6b30ac74 fix headers
make all non-implementation headers includable without
preconditions. Also, this removes the GravityColumnSolver.hpp file,
because it tried to include a non-existing file and it was thus unused.
2013-09-11 13:11:47 +02:00
Andreas Lauser
2cfe79f664 convert users of the ASSERT and the ASSERT2 macros to standard assert() 2013-09-05 13:04:37 +02:00
Andreas Lauser
1605b88d66 convert THROW to OPM_THROW 2013-09-05 13:04:37 +02:00
Andreas Lauser
f4a22486ef convert THROW to OPM_THROW 2013-09-05 13:04:37 +02:00
Andreas Lauser
5bb9053206 include iostream in the files which use std::cerr or std::cout
for some of these files this is needed to make to keep it compiling
after the next patch because the new ErrorMacros.hpp file will no
longer implicitly includes <iostream>. for the remaining files it is
just good style.

While at it, the includes for most of these files have been ordered in
order of decreasing abstraction level.
2013-09-05 13:04:37 +02:00
Roland Kaufmann
b03e238d45 Provide protocol for exchanging state with client
The state that is passed to the simulator object is directly
accessible without any encapsulation towards the client. After
the notification callback was introduced, this allows the client
to observe the state in the middle of a simulation.

However, it may be that the simulator has some internal state
which is not reflected in the state object because there is a
cost associated by flushing it into the TwophaseState format.

The notification is called back on every timestep, not just the
ones that will do reporting. It may even be that reporting is
done dynamically and is not known at the time of setup. (It is
more like a condition variable).

Consequently, flushing the state in every timestep is a bad
idea. This patch sets up a new method sync() which it is expected
that the notification will call if it needs the state for
reporting purposes.

Currently it is a no-op. It just establishes a protocol that
other, compatible implementations can also use.
2013-08-30 15:14:22 +02:00
Roland Kaufmann
c1eadadb72 Replace old timestep completed event with new scheme 2013-08-26 13:08:49 +02:00
Andreas Lauser
2a26964c7d replace boost::scoped_ptr by std::unique_ptr
thanks to Bård Skaflestad, Atgeirr Rasmusen and Roland Kaufmann for
the hint.
2013-08-08 15:21:38 +02:00
Andreas Lauser
8afc71db57 use std::shared_ptr instead of boost::shared_ptr
our policy is that we only use boost if necessary, i.e., if the oldest
supported compiler does not support a given feature but boost
does. since we recently switched to GCC 4.4 or newer, std::shared_ptr
is available unconditionally.
2013-08-08 13:25:58 +02:00
Andreas Lauser
69bf6401b2 fix new 'unused variable' warnings on GCC
that one was due to the fact that the constructor arguments were no
longer used to initialize (unused) private member variables. These
warnings did not appear in CLang for some reason. Again, thanks to
Bård Skaflestad for the review.
2013-07-30 19:07:46 +02:00