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.
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.
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.
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
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.
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.
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.
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.
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
GCC 4.8 provides 'nullptr' in C++11 mode. That capability is
detected at configuration time and stored in <config.h> and we need
it when targeting Dune 2.2.1 to avoid diagnostics of the form
[...]/dune/common/nullptr.hh:27:1:
error: expected ‘;’ after class definition
} nullptr = {}; // and whose name is nullptr
^
[...]/dune/common/nullptr.hh:27:1:
error: qualifiers can only be specified for objects and functions
[...]/dune/common/nullptr.hh:27:3:
error: expected unqualified-id before ‘nullptr’
} nullptr = {}; // and whose name is nullptr
missing: the simulator using dune-cornerpoint. Once again, this is
because there is no good way to convert an intersection to a unique
global index (yet).
The porv is computed if needed and the Eclipsestate will return false on
this test before it is called.
This commit applies the change to the sim_fibo_ad_cp.cpp
Currently, there are two abstract interface for the grids. One that
usually returns pods and arrays of them that also can be used by C
and is used also in opm-core, and one that returns Eigen datastructures
needed within opm-autodiff.
This commit adds a postfix ToEigen to those functions (faceCells, and
cellCentroidsZ) one could imagine to also return pods and arrays of them.
This should at least resolve the confusion about the two faceCells functions.
The next step will be issue #192Fixes#176
Also add some other features that have been added to sim_fibo_ad
but not to sim_fibo_ad_cp:
- (Un)Strict parsing parameter.
- EQUIL init (currently throws, since initEquil not yet made generic).
Total time will be written to walltime.txt, and single step times to
step_timing.txt (changed suffix from param to txt). This did not work
properly before this fix (step_timing file was overwritten each step).
This commit changes the API of class SimulatorFullyImplicitBlackoil<>
in order to support wells controlled by (total) reservoir voidage
volume rates. Specifically, we switch to holding a mutable Wells
object (backed by a std::shared_ptr<>) in class Impl rather than a
reference to a WellsManager. This allows dynamically updating rate
distributions and targets of individual well controls. That, in
turn, is a prerequisite to supporting ECL-style "RESV" control
modes--be it in prediction or history matching capacity.
While in the process of API changes, also prepare for the second
stage of "WCONHIST/RESV" support: Accept a ScheduleConstPtr that
holds the input deck's notion of the history matching vs. prediction
controls. We need to distinguish the two in order to support the
exact semantics of "WCONHIST/RESV".
Update SimFIBO<> clients accordingly.
The refactorisation of class FullyImplicitBlackoilSolver<Grid> to
defer transmissibility and pore-volume calculation to the client in
order to support multipliers (net-to-gross &c) accidentally ended up
removing all effects of gravity. This commit restores those effects.
this is required to implement pore volume and permeability multipliers
as discussed with [at]bska and [at]joakim-hove.
Note that this implies that the DerivedGeology class can't be
instantiated anymore if there is no EclipseState object. Thus all code
paths and tests that don't load a deck are removed by this patch. If
this is undesireable, there are two options: First, don't require
EclipseState for DerivedGeology which would imply to make the about 10
required multiplier functions part of the
BlackoilPropertiesAdInterface, or second, one can copy-and-paste the
DerivedGeology class as it was before this patch, derive from a newly
introduced DerivedGeologyInterface and pass DerivedGeologyInterface
objects to the simulator. IMHO, the second solution would be a bit
better but it would involve substantial overhead to implement and to
maintain it.
Anyway, in the mean time simulators cannot be instantiated without
decks.
this basically means using Opm::EclipseState instead of the raw deck
for these keywords.
with this, property modifiers like ADD, MULT, COPY and friends are
supported for at least the PERM* keywords. If additional keywords are
required these can be added relatively easily as well.
no ctest regressions have been observed with this patch on my machine.
this basically means using Opm::EclipseState instead of the raw deck
for these keywords.
with this, property modifiers like ADD, MULT, COPY and friends are
supported for at least the PERM* keywords. If additional keywords are
required these can be added relatively easily as well.
no ctest regressions have been observed with this patch on my machine.
this basically means using Opm::EclipseState instead of the raw deck
for these keywords.
with this, property modifiers like ADD, MULT, COPY and friends are
supported for at least the PERM* keywords. If additional keywords are
required these can be added relatively easily as well.
no ctest regressions have been observed with this patch on my machine.
i.e. reading the grid properties from EclipseState instead of from the
raw deck. This requires that all deck files exhibit a GRID and a
SCHEDULE section or else EclipseState will throw in the constructor.
The following is changed in this commit:
- The constructor for NewtonIterationBlackoilSimple now takes
a parameter object instead of a linear solver.
- The fully implicit black-oil simulators can now use the CPR
preconditioning strategy (by passing use_cpr=true) or the
simple strategy (the default).
Note that as of this commit, the CPR preconditioning still has
not been implemented properly, and behaves just like the simple
strategy.
Function GridManager::createGrdecl() generally allocates memory
(using std::malloc()) for the MAPAXES keyword data output of the
'grdecl' structure. Release those resources before leaving the
scope to prevent memory leak introduced in commit fdca540.
This commit switches to using the convenience method
GridManager::createGrdecl()
to construct a "struct grdecl" that can be passed directly into
CpGrid::processEclipseFormat(). The practical benefit is that we
get to leverage the opm-parser that's in active development rather
than the calcifying "EclipseGridParser" that will only become less
relevant in the future. We also don't parse the data twice.
Note: This is mostly compile tested. In the few actual tests I ran,
I got into trouble with internal assertions in processEclipseFormat.
That problem is not yet analysed.
Conflicts:
examples/sim_fibo_ad.cpp
opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp
This brings the "CpGrid support" branch up to date with respect to
recent changes in opm-autodiff master.
this makes the simulator quite a bit more maintainable: setting
USE_NEW_PARSER to 0 did not even compile after the the constructor for
the wells manager which took the old deck was removed last
week. Since, according to Atgeirr, SPE-1 is now producing exactly the
same results as before, it also does no longer make too much sense to
keep that code on life support...
i.e., the simulator does not deal with any output operations
anymore. This makes sense because report steps are handled by
Opm::TimeMap and the constructor for the simulator already needs more
arguments than appropriate even without this...
Manually resolved conficts in the following files
examples/sim_fibo_ad.cpp
opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp
opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp
In additions examples/sim_fibo_ad_cp.cpp was adapted to compile again.
i.e. it now uses Opm::EclipseState. This change required to re-add the
the epoch concept in some sense, but the loop variables now call it
"episode" which sounds less ethernal IMO.
Since the SimulationTimer, EclipseWriter and WellsManager stuff has
not (yet?) been merged, the old parser is required to be around. Use
my parser-integrate-hacks_for_norne branches to test your stuff on the
Norne deck...
this required to abandon the "Epoch" stuff which the new parser does
not have (as well as the ECLIPSE file format knows nothing about
epochs). Handling well controls properly thus has to wait until Joakim
and Kristian finish refurbishing the WellsManager, so as a stop-gap
measure, only the first "epoch" is run.
This includes:
- Using the class FullyImplicitBlackoilResidual instead of
in-class definition for the residual object.
- Changing residual field name mass_balance to material_balance_eq.
- Letting the simulator and solver classes accept a
FullyImplicitSystemSolverInterface instead of a LinearSolverInterface.
- In sim_fibo_ad and test_implicit_ad, instantiate class
FullyImplicitSystemSolverSimple, replicating existing behaviour.
The most severe change probably is the removal of the AutoDiff
debugging helper functions which were useful from within a debugger
but unfortunately had to rely on a presumed linker bug in order not to
be removed in the final binary.
Also, some private attributes were unused. These have been removed and
the constructors of their respective classes have been adapted. Once
their intended functionality is actually implemented, they should be
brought back on an as-needed basis.
Thanks to @bska for the review!
The three-argument WellsManager constructor needs access to the real
permeability field lest a null-pointer dereference result when the
problem actually contains any wells.
There is some code in place now to create wells for the no-deck case,
but since it does not work correctly yet, the simulator intercepts this
and throws.
Fall back to Eigen's BiCGSTAB solver if UMFPACK is not available. The
BiCGSTAB is built into Eigen and consequently always available when
Eigen is found.
Code is now functionally complete apart from lacking miscibility,
not writing to all promised output variables and not writing the
promised output to disk. Initial testing has been unsuccessful,
so there are bugs in the code.
Specifically,
- #include <config.h> where appropriate (all .cpp files)
- Adjust include statements to account for sub-directory locations
of .hpp files.
- Changed interface.
- Read tracerheads (tracer start locations) from file in compute_tof_from_files.
- Initialize tracerheads from wells in compute_tof.
Interface change: solver now requires a linear solver (for the multi-cell blocks only).
Implementation uses new private method assembleSingleCell(), that is a modified copy
of solveSingleCell(). Should refactor.
Also:
- Add use_tensorial_basis parameter allowing run-time choice of basis.
- Remove degree argument from solveTof() method, degree is instead obtained
from parameters in constructors. Modified compute_tof* programs to match.
The limiter is experimental and unfinished, untested work in progress.
Limiter is therefore inactive by default.
Also fixed a minor bug: use_cvi_ was not initialized.
Another polymer-specific overload of computeFractionalFlow()
has been added in support of this (this overload deals with
compressible properties.
Also added pressure normalization for situations with arbitrary
absolute pressure.
A polymer-specific overload of computeFractionalFlow()
has been added in support of this.
Also added a minor feature: pressure normalization for
situations with arbitrary absolute pressure.
They do this by using the class PolymerInflowFromDeck
instead of PolymerInflowBasic if there is a WPOLYMER
keyword somewhere in the deck epochs. If there is no
WPOLYMER, the parameters 'poly_start_days' etc. will
be used to construct an instance of PolymerInflowBasic
instead.
Before, it was a single number for the whole domain. It could vary
with time, though.
Simulator behaviour should be identical before and after this commit.
This touches the classes TransportModel*Polymer, Simulator*Polymer,
and the computeInjectedProduced() functions. The PolymerInflow class
and its usage has been replaced with PolymerInflowInterface, and
a subclass PolymerInflowBasic has been created which provides the
old behaviour (using parameters poly_start_days, poly_end_days and
poly_amount).
Conflicts:
Makefile.am
opm/core/fluid/BlackoilPropertiesFromDeck.hpp
opm/core/fluid/SaturationPropsFromDeck.cpp
opm/core/fluid/SaturationPropsFromDeck.hpp
opm/core/fluid/blackoil/BlackoilPvtProperties.cpp
opm/core/fluid/blackoil/BlackoilPvtProperties.hpp
opm/core/fluid/blackoil/SinglePvtDead.cpp
This merge combines three more-or-less orthogonal features
for saturation tables: the option to use StoneII or Simple
three-phase behaviour, the option to fit a spline or not,
and finally setting the number of samples used (if spline
fitting).
Interfaces have changed, the most top-level one being
that BlackoilPropertiesFromDeck::init() now also takes
a ParameterGroup argument.
Recall that the class that used to be called SinglePvtDead has
been renamed to SinglePvtDeadSpline. If 'props_use_spline' is true,
that class is used (this is the default), which makes a monotone
spline that is uniformly, densely sampled. The new class simply
uses linear interpolation in the input tables.
This is a change from taking a vector containing the mapping to
deck-consistent logical cartesian indices. The mapping is contained
in the UnstructuredGrid::global_cell member, and may be null. The
change therefore saves the overhead of constructing a vector as a
copy of the data in the grid or (if null) as an identity mapping.
Now we may have a grid generated from deck input using the
keywords DXV, DYV, DZV, which will have a null pointer for
the global_cell mapping. We check if this pointer is null,
and create an identity mapping in this case. The mapping is
needed by the *PropertiesFromDeck classes (and helpers).
Note that due to a design constraint in the transport solver, namely
that inflowing fluid must consist of only water (possibly with polymer),
and no oil, the program fails unless the comment on lines 186-- is
heeded.
- Use correct function (from polymerUtilities.hpp).
- Use correct input src term (equal to transport src).
- Call at the correct point (after advective transport).
- Made initStateFromDeck() into a template taking arbitrary properties.
Implementation detail:
- initWaterOilContact() was also templatized on props.
- initHydrostaticPressure() is now overloaded on prop interface types.
This is to make it compatible with blackoil properties.
An alternative would be to give [Incomp|Blackoil]PropertiesInterface a
common base class (RockInterface?) with the common rock-related methods.