Commit Graph

3120 Commits

Author SHA1 Message Date
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
Andreas Lauser
5c4c44812d fix a few CLang warnings
most of them quite insignificant, but still annoying. The only
exception is the warning about the changed alignment for the 'work'
argument of spu_implicit_assemble(). AFAICT, the only reason why it
worked was that the pointer produced by malloc() was passed
directly. (malloc() seems to fulfill all alignment criteria.) To fix
this, I've changed that argument's type from char* to double*.
2013-07-30 16:27:20 +02:00
Júlio Hoffimann
43438b2bf8 Remove trailing whitespaces 2013-07-28 08:34:13 -03:00
Bård Skaflestad
147dabc3ce Merge from upstream 2013-05-23 09:50:46 +02:00
Roland Kaufmann
fe84822e52 Provide template functions in separate header
Template functions must be defined in the header since the library
cannot contain generic code. To keep only the interface in the main
header, all such function bodies are put in a separate _impl file.
2013-05-15 21:32:32 +02:00
Roland Kaufmann
d3db4922b4 Subtract time spend in callbacks from total
Since this is not time spent on the simulation itself, it is "unfair"
that this is accounted on the simulator.
2013-05-14 11:38:09 +02:00
Roland Kaufmann
37906058f5 Notify callbacks when a timestep has completed
Client code can do additional processing for the output of each
timestep.
2013-05-14 11:36:13 +02:00
Roland Kaufmann
f240e79880 Make implementation class "package" visible
Since a definition of the class is not in the header, no other
compilation units can safely access the internals of the Impl class
anyway, so it may as well be a regular struct so that the outer class
(SimulatorIncompTwophase) can access it.
2013-05-14 11:11:18 +02:00
Andreas Lauser
a2065b4101 make config.h the first header to be included in any compile unit
this is required for consistency amongst the compile units which are
linked into the same library and seems to be forgotten quite
frequently.
2013-04-10 12:56:14 +02:00
Atgeirr Flø Rasmussen
4fc8f52fb2 Moved ColumnExtract and initState.
ColumnExtract -> opm/core/grid/ and initState -> opm/core/simulator/.
2013-03-18 12:47:23 +01:00
Atgeirr Flø Rasmussen
44fa7ec920 Further reorganising of opm-core.
Deleted some unused code (or moved to opm-porsol), moved all code dealing with
time-of-flight to opm/core/tof, moved code for implicit transport solver to
opm/core/transport/implicit, spu_[im|ex]plicit.[ch] to opm/core/transport/minimal.
2013-03-18 12:38:04 +01:00
Atgeirr Flø Rasmussen
e319fd1e38 Renamed newwells.h -> wells.h.
Also moved implementation file to subdir.
2013-03-18 10:33:34 +01:00
Atgeirr Flø Rasmussen
e42cfc1303 Reinstate correct porevolume usage.
The porevolume at the start of the timestep should be provided to
the solver.
2013-03-15 15:10:16 +01:00
Atgeirr Flø Rasmussen
63c7380d04 Bugfix: check for null ptr before use. 2013-03-15 15:02:42 +01:00
Atgeirr Flø Rasmussen
3a063e22d9 Bugfix: order of arguments in function call. 2013-03-15 15:00:18 +01:00
Atgeirr Flø Rasmussen
25bacfd231 Make SimulatorIncompTwophase flexible w.r.t. transport solver.
It can now use the reordering or the full Newton-Raphson solvers.
2013-03-15 14:16:59 +01:00
Atgeirr Flø Rasmussen
b8ed52d89e Removed unused rock compressibilty objects from interface. 2013-03-15 11:45:53 +01:00
Atgeirr Flø Rasmussen
8a6e8fd8fa Remove unused well objects from TransportSolverTwophaseImplicit. 2013-03-15 11:38:37 +01:00
Atgeirr Flø Rasmussen
6579abb853 Fixed implicit transport solver interface.
There were significant lifetime issues, now handled by moving
objects inside the class. Work in progress.
2013-03-15 11:15:17 +01:00
Atgeirr Flø Rasmussen
fb09c4b7a1 Modify solve() interface, fix source term bug in implicit solver. 2013-03-15 08:21:55 +01:00
Atgeirr Flø Rasmussen
3b1346173e Minor adjustments. 2013-03-15 08:05:23 +01:00
Atgeirr Flø Rasmussen
1868285f23 Modified TransportSolverTwophaseInterface::solve(), general cleanup.
Move output arguments last in argument list.
2013-03-14 22:51:44 +01:00
Atgeirr Flø Rasmussen
2b4cb11ebc Rename ImplicitTwoPhaseTransportSolver -> TransportSolverTwophaseImplicit. 2013-03-14 22:39:08 +01:00
Atgeirr Flø Rasmussen
d4f5338358 Rename TwoPhaseTransportSolver -> TransportSolverTwophaseInterface.
To be more consistent with naming practices elsewhere in opm-core.
2013-03-14 22:24:36 +01:00
Atgeirr Flø Rasmussen
1106538d85 Merge remote-tracking branch 'hnil/hnil_class' into combined.
Conflicts:
	CMakeLists.txt
	examples/sim_wateroil.cpp
	opm/core/grid/cpgpreprocess/geometry.c
	opm/core/transport/reorder/ReorderSolverInterface.hpp
	opm/core/transport/reorder/TofDiscGalReorder.cpp
	opm/core/transport/reorder/TofDiscGalReorder.hpp
	opm/core/transport/reorder/TofReorder.cpp
	opm/core/transport/reorder/TofReorder.hpp
	opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.cpp
	opm/core/transport/reorder/TransportSolverTwophaseReorder.cpp
2013-03-14 16:18:39 +01:00
Atgeirr Flø Rasmussen
6127afc1c6 Adapt include statements to moved headers. 2013-03-14 10:29:42 +01:00
Atgeirr Flø Rasmussen
2d871c1402 Moved writeECLData and writeVtkData to opm/core/io subdirs. 2013-03-08 08:06:18 +01:00
Atgeirr Flø Rasmussen
ddd41bfcd7 Moved opm/core/eclipse/* to opm/core/io/eclipse/*. 2013-03-07 22:59:06 +01:00
Atgeirr Flø Rasmussen
f893adbda6 Document function currentDateTime(). 2012-11-26 10:49:15 +01:00
Halvor Møll Nilsen
772aae6a62 Corrected include statements after renaming files. 2012-11-16 16:24:54 +01:00
Halvor Møll Nilsen
523ca56ef1 Changes needed to for makeing a simulator using ImplicitTransport. Several changes in names to highlight what is reorder simulator classes 2012-11-16 13:38:03 +01:00
Halvor Møll Nilsen
c090eb618b Added wrapper in code in separate file. Continued to change ../simulator/SimulatorIncompTwophase.cpp 2012-11-15 15:01:12 +01:00
Halvor Møll Nilsen
6c666f90a8 Changes to try to make naming and classes more consistent. This is a start to make devide models and tranport solvers so that VE models is more easely handled 2012-11-15 13:20:49 +01:00
Joakim Hove
09b3ef785c Added start_date_ property to the SimulatorTimer class 2012-11-07 14:53:26 +01:00
Atgeirr Flø Rasmussen
b9fc9896d3 Rename function argument and variable.
rock_comp -> rock_comp_props
2012-10-12 09:21:52 +02:00
Atgeirr Flø Rasmussen
280590a012 Bugfix: order of function arguments.
Order of arguments for computePhaseFlowRatesPerWell() was wrong.
This fix was done previously for SimulatorCompressibleTwophase,
but the incompressible sim was ignored.

Also added an ASSERT that may help catch some misuse.
2012-10-10 14:09:09 +02:00
Atgeirr Flø Rasmussen
2fbdf9bd0a Fix order of arguments in function call.
Rate and fractional flow were switched in call
to computePhaseFlowRatesPerWell().
2012-10-08 14:26:46 +02:00
Atgeirr Flø Rasmussen
7fd95d7333 Fix mass balance reporting.
Multiple issues:
  - now reporting surface volumes, not reservoir volumes,
  - fixed reporting for the case of multiple transport steps.
2012-10-02 15:47:47 +02:00
Atgeirr Flø Rasmussen
e9b2fc0ac9 Fix volume reporting with multiple transport substeps. 2012-10-02 15:47:21 +02:00
Atgeirr Flø Rasmussen
69f8d98f8f Increase output precision for ascii dumps. 2012-10-02 14:39:12 +02:00
Atgeirr Flø Rasmussen
bcc03ef41d Change interface for (blackoil) computeInjectedProduced().
Also use new computeInjectedProduced() and computeTransportSource()
functions in SimulatorCompressibleTwophase.
2012-10-02 11:12:23 +02:00
Atgeirr Flø Rasmussen
d74f0a9c52 Add output of surface volume. 2012-09-14 09:51:28 +02:00
Xavier Raynaud
38bcaeb362 Changed solvegravity interface. Fixed bug. 2012-09-05 10:10:02 +02:00
Xavier Raynaud
845c100dcd Fixed order of arguments in function call. 2012-09-04 11:39:17 +02:00
Xavier Raynaud
76e517516f Added missing initialization of gravity in constructor. 2012-09-03 14:55:19 +02:00
Atgeirr Flø Rasmussen
ac1ec3e9ac Merge remote-tracking branch 'upstream/master'
Conflicts:
	opm/core/simulator/SimulatorIncompTwophase.cpp
2012-08-24 13:31:05 +02:00
Halvor Møll Nilsen
0ed597fee9 Corrected typing pointed out by atgeirr in respose to pullrequest 2012-08-24 12:52:41 +02:00
Halvor Møll Nilsen
7f3cbc476a Merge remote-tracking branch 'upstream/master'
Conflicts:
	opm/core/simulator/SimulatorIncompTwophase.cpp
2012-08-24 12:26:27 +02:00
Atgeirr Flø Rasmussen
def904c6d6 Use the start-of-timestep pore volume in transport solver.
This is to improve consistency with other solvers, and relates
to the expression that is converted into a finite difference when
discretising:
  (phi s) - (phi s)^0 = phi^0(s - s^0) + (phi - phi^0)s
                        ^^^^^
The above marks the spot where we now use phi^0 instead of phi.
2012-08-23 14:58:32 +02:00
Atgeirr Flø Rasmussen
cf3511663c Fixed solveGravity(): now properly modifies surfacevolume.
Also:
  - solveGravity() interface changed to take surface volume as a parameter,
  - gravity vector is now given in initGravity() instead of
    solveGravity(), for consistency with the incompressible solver.
2012-08-23 14:45:23 +02:00
Atgeirr Flø Rasmussen
4cdb2a43a3 Fixed renormalization conditions. 2012-08-23 14:05:28 +02:00
Atgeirr Flø Rasmussen
70d33843e4 Chase changes to some interfaces after merging. 2012-08-22 11:16:51 +02:00
Atgeirr Flø Rasmussen
1fc5c8988f Merge branch 'rock_comp_tpfa' 2012-08-22 11:13:16 +02:00
Atgeirr Flø Rasmussen
87e4b017ed New class SimulatorCompressibleTwophase. 2012-08-22 10:37:52 +02:00
Atgeirr Flø Rasmussen
7c313282c0 Minor comment fix. 2012-08-22 09:05:54 +02:00
Atgeirr Flø Rasmussen
f2f49c7132 Fix pressure renormalization conditions. Some formatting fixes.
Checking for both rock compressibility and pressure conditions
is necessary before we renormalize pressure.
2012-08-21 14:52:43 +02:00
Atgeirr Flø Rasmussen
2acaa970e1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	examples/sim_2p_incomp_reorder.cpp
	opm/core/simulator/SimulatorIncompTwophase.cpp
2012-08-21 12:47:52 +02:00
Atgeirr Flø Rasmussen
8e80848486 Added well constraint checking to SimulatorIncompTwophase.
- Changed Wells constructor arg for SimulatorIncompTwophase to WellsManager.
 - Insert checking code for well constrains (mostly copied from spu_2p.cpp).
Unrelated to the above changes.
 - Added pressure normalization for incompressible case (from spu_2p.cpp)
2012-08-21 10:51:14 +02:00
Atgeirr Flø Rasmussen
d09e60820f Merge remote-tracking branch 'xavier/rock_comp_tpfa' into rock_comp_tpfa 2012-08-20 16:09:20 +02:00
Atgeirr Flø Rasmussen
a86239d10c Renamed SimulatorTwophase -> SimulatorIncompTwophase. 2012-08-20 15:45:05 +02:00
Atgeirr Flø Rasmussen
67c13e794a Moved SimulatorTimer class to opm/core/simulator directory. 2012-06-14 14:02:22 +02:00