reads tracer input from deck, solves tracer equation fully implicit as a post processing step in endTimeStep
tested on a simple modified SPE1CASE1 deck and compared with eclipse
TODO: restart and parallel
this allows to assemble the Jacobian matrices directly into the native
format expected by linear solver. So far, only backends using
Dune::BCRSMatrix are provided, but there are work-in-progress patches
for dune-fem, vienna-CL and PETSc backends.
IMO the simulator should not be in the business of managing low-level
parser objects in the first place, because that's what EclipseState is
supposed to do?!
anyway, since these objects are not needed to decide which simulator
to use, they are now always managed internally by the vanguard, i.e.,
setExternalDeck() does not take them anymore.
this is similar to the mechanism for well models: the API is defined
here, but can be overloaded by downstream modules. In contrast to the
well model where the default class follows a simplistic approach the
default class for aquifiers does nothing, i.e., the actual
implemenentation must be provided by downstream.
before this patch, the parameter was registered by the problem but not
used there. Since this is quite confusing, let's move registration to
where the parameter is actually used, i.e., the vanguard.
i.e., complain when detecting foo=bar positional parameters. this is
not a bullet-proof solution because it will not work if the deck file
name contains an equals character. Anyway, it's better than before
IMO.
all disc output, i.e. VTK, restart files, ECL and -- in the future --
logfiles, goes to that directory. before this, only the ECL output
could be directed to a different than the current working directory
and the parameter for this was called "EclOutputDir".
note that the Dune VTK writing infrastructure makes it harder than it
needs to be: suddenly Dune::VTKWriter::write() does not work in
parallel anymore, but Dune::VTKWriter::pwrite() must be called with
the right arguments.
previously, the exact behaviour was dependent on wheter the
--ecl-deck-file-name parameter was defined or not. now the positional
parameter is hopefully an exact alias for the value of --ecl-deck-file-name.
the purpose is to make it exceedingly clear that ebos is not developed
by the ECL group who started ECLIPSE which is an backcronym for
"ECL's Implicit Program for Simulation Engineering" and ECL stands for
"Exploration Consultants Limited" which is now a division of
Schlumberger Limited.
thanks to [at]atgeirr for pushing this.
there are about a trillion places within ebos where the availability
of the ECL I/O routines is hardcoded, so it does not make sense to
pretent that the EclWriter can be useful without them.
(in fact, ebos is deactivated at build system level if the ECL I/O
routines have not been detected.)
i.e., the ECL restart files are not necessarily updated after each
report step, but only each N-th (where N is the number specified by
the EclOutputInterval parameter). if this value is set to something
smaller than zero, the value which is computed by the EclipseState
object is used.
further, this cleans up the code of the parameter system and the
startup routines a bit and finally, it adds positional parameters
support to ebos as well as brief descriptions to ebos and the lens
problem.
this is required because temperature needs to be always specified. in
the case of isothermal simulations, the temperature is assumed to be
the initial one, i.e., freeing up the initial fluid states also makes
the temperature undefined.
I suspect that the reason why this did not lead to crashes is that for
isothermal `BlackOilFluidState` objects, the temperature is stored in
a static member variable.
thanks to at [at]bska for catching this issue.
with this, it is possible do define fluxes of conservation quantities
over the domain boundaries by specifying the thermodynamic state on
the boundary when using the black-oil model. The main motivation is
are thermal fluxes which are required to maintain geothermal
temperature gradients over time.
IMO the term "vanguard" expresses better what these classes are
supposed to do: level the ground for the cavalry. Normally this simply
means to create and distribute a grid object, but it can become quite
a bit more complicated, as exemplified by the vanguard classes of
ebos..
Ask the restartConfig if restart files are written. Solution variables are
always written since they may be needed by the summary files
Remove output of saturated data to align with legacy code.
The new eclwriter output and restart using the eclIO from opm-output
All tests in opm-simulator pass and
MPI restart works.
Standard initialization is done prior to restart in order
to compute correct initial thpressure values. This is not
necessary if thpressures are written to the restart file
TODO: Some trivial fields are written out in order mimic legacy code,
this should be cleaned up
TODO: Output of wells, FIP, NNC is still done in opm-simulators.
This should be moved later.
the eWoms file naming convention should probably be changed to the one
of the remaining OPM modules, but this is quite a bit of work and IMO
it is more important to be consistent within the module.
instead, let's bit the bullet and add the few lines required for
regula-falsi-Pegasus method whenever the old RegulaFalsi class was
used. note that this leads to slightly different results for the
SPE5CASE1 flow test. I suspect that the old solvers behave in
unexpected ways, though...
Note that because the inverted functions are usually piecewise linear,
inversion can be done in a much smarter way.
this only deals with the easy things, i.e. UgGridHelpers::numCells()
and UgGridHelpers::dimensions(). a more thorough cleanup is needed in
the future to make ebos work with grids other than Dune::CpGrid again.
now, all the beauty of that part of the code can be admired in
initStateEquil.hpp.
During this exercise, I stumbled over some serious code-quality issues
like a different order of the template arguments for the declaration
and the definition, mismatching argument names and no forward
definition of some functions. besides this, some functions were
already defined in the non-_impl.hpp file and EquilibrationHelpers.hpp
used that approach from the outset.
this just moves the hydrostatic equilibrium code from its historc
location at opm/core to ebos/equil and adds minimal changes to make it
compile. this allows to clean up that code without disturbing the
legacy simulators.
depending on the grid implementation, the grid view / grid part object
does not necessarily follow the change. For some reason, the grid part
still does not work in the parallel case (tested with dune-fem 2.4),
but that seems to be an issue on the dune-fem side.
Apply swatInit in the initialization
Stop using the equilGrid in the initialization code
Keep The initialFluidState until end of first time step to make it
possible for flow to output it.
This reverts commit c873e8c92da389bc1d6bc4ed2a5241faddfa7630.
since OPM/opm-simulators#1287 has been merged there are no "in tree"
upstreams which use that mechanism anymore.
this now works with the unmodified master version of flow from
opm-simulators. we take the liberty to emit a deprecation warning,
though. this complicates things quite a bit.
This gets rid of some special-purpose code in generic places (i.e. the
`SimulatorParameter` class) and no special hacks to the property and
parameter system are required anymore.
Adds a conservation equation for polymer.
Polymer concentration in the water phase is used as primary variable
The polymer influences the viscosity of the water, and leaves gas and oil
uneffected.
A shear multiplier is computed if PLYSHLOG and/or SHRATE is specified
based on either velocity or shrate.
The shear multiplier effects the water and polymer viscosity.
Tested and verified on the test cases in polymer_test_suite
this reduces the number of direct deck accesses in `EclProblem` in
favour of `EclipseState`-grid properties. as far as i can see,
directly using the deck object cannot fully be avoided because
`EclipseState` does not seem to provide internalized versions of all
these keywords yet.
the NTG value for active cells in the topmost layer was always
1.0. This resulted in some deviations in the transmissibilities of the
Norne deck which lead the init file comparison unit tests from
opm-simulators to fail.
- initialization only via Ecl Deck
- adds modification of relperms and cap-pressures for miscible runs
- adds TL mixing model for effective viscosity and density calculations
Tested on SPE1CASE2_SOLVENT_MISC_TL, SPE9_CP_CO2_MISC_TL, SPE5CASE1-3
and SPE3CASE1_SOLVENT_MISC
Conceptually this is IMO pretty questionable, since it adds a second
"gas phase" that does not mix with "ordinary" gas. I suppose the
reason why this extension was conceived by E100 is that if all you
have is hammer, everything looks like a nail...
Functionality-wise, this patch is still not fully complete because
miscibility of the solvent "phase" is not yet implemented. As far as I
can see, the API changes required by miscibility are quite limited,
though.
let's use zero instead of 10^-18. This can have a small impact on
performance, but the new version is definitely "more" correct, and
also Norne performance seems to improve slightly on my machine.
this was found using GCC-7's address sanitizer. I suspect that this
did not surface earlier (i.e., with valgrind), because newly allocated
memory gets initialized to zero by the operating system, so the value
of the pointer was zero and the delete operator did what was right by
coincidence. the new asan seems to initialize memory randomly, though.
if the initial solution is explicitly given by the deck using the
PRESSURE, SWAT, etc. keywords, the specified state can be
thermodynamically impossible. To avoid inconsistencies, we use a flash
calculation to find a state that is in thermodynamic equilibrium and
exhibits the same masses as the explicitly specified solution. Since
the flash solver needs to compute quantities for all fluid phases, but
two-phase blackoil simulations usually do not specify the properties
of one phase, the flash solver crashed. This patch works around that
issue by simply not using the flash solver in the twophase case, i.e.,
the explicit initial condition must be thermodynamically consistent in
order to produce the stable results for a different choice of primary
variables.
This only makes these transmissibilities available for parallel
computations. The reason is that in the sequential case, they do not
need to be computed during grid creation and they are are also
accessible via the problem object.
Face centers are computed using the cell corners. With this
implementation the face center seen from a cell may be different from the
face center seen from its neighbour.
Face normals with area lenghts are calculated using the face corners
directly not using a triangulation point in the center of the face.
This gives transmissibility almost equal to eclipse.
hopefully this makes standalone `ebos` arrive at the same initial
condition as `flow_ebos` if both, SWATINIT and threshold pressures are
enabled. we need to calculate the initial condition twice either
threshold pressures and SWATINIT are enabled. (`ebos` and `flow_ebos`
diverged after OPM/opm-core#1129.)
the proposed patch is a kludge IMO, but in the light that in my
opinion, SWATINIT and threshold pressures are both physically not
justified and given the fact that SWATINIT must not be considered for
the threshold pressues should be considered to be a bug of the
reference simulator, I think the patch is okay.
Judging from ParallelDebugOutput.hh this is what is should be.
Before this commit it was empty as it had space reserved but never
any entries pushed (they were inserted with operator[]).
This reverts commit dde79daf4ec2004148a58250c4c8af5390251689.
Judging from ParallelDebugOutput.hh this should not be a map from element
index to interior element index, but an a list of indices of all interior
elements. Therefore we need to reserve and later on push_back.
This reverts commit 09db2fd412abe4b8a2f52274bcc0041e4b20a94d.
Judging from ParallelDebugOutput.hh this should not be a map from element
index to interior element index, but an a list of indices of all interior
elements
Previously distributedCartesianIndex was resized and afterwards all
entries were added with push_back. Therefore the array was twice as
big as expected and contained wrong values in the front.
With this commit we insert the values using random access. Thus the
size is as expeceted and the index of the entries do not depend on the
order of the grid traversal.
While it may not produce memory errors it is semantically wrong to insert
entries with random acces into a vector that has reserved enough memory to
hold the values but still has size 0.
Due to the nature of CpGrid (manages one shared pointer to the equil grid
and one the distributed grid) this should be faster as it only adjusts one
shared pointer.