Commit Graph

92 Commits

Author SHA1 Message Date
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
Bård Skaflestad
09a37d9e0b Merge remote-tracking branch 'upstream/master' 2013-05-24 00:44:01 +02:00
Bård Skaflestad
147dabc3ce Merge from upstream 2013-05-23 09:50:46 +02:00
Roland Kaufmann
9a10880a4c Use boost::bind instead of std::bind to compile with C++03 2013-05-22 21:25:29 +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
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
c7789d7e52 Move GridManager to grid subdir.
Also remove GridAdapter (moved to dune-cornerpoint), and
moved grid.c implementation file to grid subdir.
2013-03-18 10:16:46 +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
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
Bård Skaflestad
77fbdcf8d3 Merge branch 'ert' 2012-10-12 14:50:23 +02:00
Bård Skaflestad
0b86366e8e Merge remote-tracking branch 'origin/ert' into ert
Conflicts:
	Makefile.am
2012-10-12 11:04:20 +02: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
Bård Skaflestad
0134c4bada Merge remote-tracking branch 'upstream/master' 2012-10-02 20:30:13 +02:00
Bård Skaflestad
e169273b50 Merge remote-tracking branch 'upstream/master' 2012-10-02 19:30:31 +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
Bård Skaflestad
b314f4ed3a Merge remote-tracking branch 'upstream/master' 2012-09-19 15:32:43 +02:00
Atgeirr Flø Rasmussen
d74f0a9c52 Add output of surface volume. 2012-09-14 09:51:28 +02:00
Bård Skaflestad
0c092be788 Merge remote-tracking branch 'upstream/master' 2012-09-05 19:48:21 +02:00