Commit Graph

24 Commits

Author SHA1 Message Date
Tor Harald Sandve
b661791a63 Remove usage of BlackoilState class
This allows (re)moving of the following files
opm/autodiff/RateConverter.hpp
opm/autodiff/Compat.cpp
opm/autodiff/Compat.hpp
opm/core/props/BlackoilPropertiesInterface.hpp
opm/core/simulator/BlackoilState.cpp
opm/core/simulator/BlackoilState.hpp
opm/core/simulator/BlackoilStateToFluidState.hpp
opm/core/utility/initHydroCarbonState.hpp
opm/polymer/PolymerBlackoilState.cpp
opm/polymer/PolymerBlackoilState.hpp
tests/test_blackoilstate.cpp
2018-11-27 09:38:38 +01:00
Andreas Lauser
b04c82a64e well model: fix valgrind complaints if either oil or gas are disabled 2018-10-31 13:18:10 +01:00
Tor Harald Sandve
4e9403b8f8 Correct the RESV calculation for unsaturated cases
Make sure that the reservoar volumes always stays positive. i.e. we can
not remove more dissolved gas from the rate than the total volume amout
of gas.
2018-03-23 15:23:47 +01:00
Kai Bao
a8f560b046 addressing the comments. 2018-02-21 14:45:22 +01:00
Kai Bao
89bb589755 update the reservoir volume in WellState 2018-02-21 12:20:43 +01:00
Atgeirr Flø Rasmussen
cf9b7c39b9 Adapt to moved opm-grid headers. 2018-02-10 08:33:33 +01:00
Andreas Lauser
3d0fca2f08 adapt to the gridManager() -> vanguard() change in ewoms 2018-02-08 16:27:42 +01:00
Tor Harald Sandve
054361d537 Make it possible to combine solvent and RESV
Compute the conversion factor for solvent using the RateConverter.hpp
2017-11-22 15:21:21 +01:00
Tor Harald Sandve
b9bc4b00cb Make the wellModel self-contained
The wellModel is now persistent over the time steps,
with an update method called every reportStep/episode.

This allows the following simplifications:

    1. move the wellState to the WellModel
    2. add a ref to the ebosSimulator to the wellModel
    3. clean up the parameters passed to the wellModel methods
    4. move RESV handling to the WellModel and the rateConverter
    5. move the econLimit update to the WellModel
2017-11-08 13:57:36 +01:00
Tor Harald Sandve
ebc2f46967 Use pore volume weighted averaged hydrocarbon state in rateConverted.
- pressure, rs and rv is averaged using hydrocarbon pore volume weights.
- pvtRegions is used as input in the conversion factor calculations.
- the pvt cell of the first well cell is used as the pvt index.
(Completing a well in two different PVT regions sounds like a very bad
idea anyway)
- FIP region support is added to the rate converter also for the ebos
interface.
2017-10-03 10:25:56 +02:00
Tor Harald Sandve
6146190844 Fixes comments from PR
Don't sum ghost cells in the RateConverter
Some cleaning and comments.
2017-08-18 08:46:44 +02:00
Tor Harald Sandve
ce84a59b29 Remove reservoirState from BlackoilModelEbos
1) Use the solution variable directly in RelativeChange(...)
2) Add a method in the RateConverter that takes the simulator instead of the state.
3) Pass the reservoir pressure directly to the well initialization.
4) Move convertInput(...) to SimulatorFullyImplicitBlackoilEbos.hpp.
This code is only used to convert the initial reservoir state.
5) Modify  updateState(...). The solution variable is updated directly and adaptPrimaryVariable(...)
from ewoms is used to switch primary variables. An epsilon is passed to adaptPrimaryVarible(...) after a switch
of primary variables to make it harder to immediately switch back.

The following code used by flow_ebos still uses the reservoirState
1) the initialization
2) restart
3) output of the initial state
4) the step methods in AdaptiveTimeStepping and NonlinearSolver.
The reservoirState is not used by this methods, so after the initial step, an empty reservoirState is passed around in the code.
2017-08-17 11:13:00 +02:00
Andreas Lauser
5fd83985a9 port the RateConverter to use the FluidSystem instead of the old fluid property API
this makes the RateConverter stuff independent of Eigen and it
simplifies some things because the the old PVT API is designed as a
"bulk-with-derivatives" API while the rate converter code used it in
"single shot" mode without derivatives.
2017-01-02 13:19:25 +01:00
Andreas Lauser
ef731672c9 remove the BlackoilPropsAdInterface abstraction layer
instead, directly use BlackoilPropsAdFromDeck.
2017-01-02 13:19:23 +01:00
Markus Blatt
8148c37d57 Improved documentation 2015-11-13 15:46:45 +01:00
Markus Blatt
980928bfa9 Fix boolean in specialization.
The default implementation is the parallel version. Therefore the boolean
in the specialization (sequential run) needs to be false.
2015-11-13 15:46:34 +01:00
Markus Blatt
f8715e31e7 Calculate parallel averages in RateConverter.
Previously, local averages were calculated and used in the
well equations. With this commit we add versions of defineState and
calcAverages that take into account the parallel domain decomposition
and calculate correct averages.

Function  calcAverages has a boolean template parameter
indicating whether this is a parallel run. Additionally we introduce
AverageIncrementCalculator with the same boolean template parameter.
In a parallel run we check whether the cell is owned by the process and
only in this case return an increment bigger than zero. In a sequential run
(no MPI or just one process -> empty boost::any parameter) no overhead is
introduced.
2015-11-13 15:46:34 +01:00
Bård Skaflestad
a94fe3ed4f Chase API update of opm-core's RegionMapping
In the process, generalise the notion of region properties.  We
introduce a new helper class

    Details::RegionAttributes<RegionId, Attributes>

that provides lookup from a RegionId, typically an int, to a
user-defined set of Attributes--in this case pressure and
temperature.

While here, mark 'SurfaceToReservoirVoidage::calcCoeff()' as 'const'
because it doesn't need to modify any internal state and refactor
the implementation to eliminate repeated calculations of

    ADB::constant(X)
2015-09-14 19:21:54 +02:00
Atgeirr Flø Rasmussen
a347e35304 Removing extra overloads of rsSat() and rvSat().
Also a few minor fixes to docs and indentation while in the area.
2015-03-09 09:40:30 +01:00
Atgeirr Flø Rasmussen
17117e7a0e Avoid storing return value in reference.
Normally this is OK for by-value returns, but here the right hand side
was changed to call ADB::value(), which returns by reference.
2015-03-05 16:07:04 +01:00
Atgeirr Flø Rasmussen
fbf06c06e7 Remove extra overloads of bWat(), bOil() and bGas().
Remaining method is the one taking AD objects. This modification
required changes to a few more places than anticipated:
  - RateConverter
  - FullyImplicitBlackoilSolver::computeWellConnectionPressures()
In these places, the call now is a little more complex and there
might be a very minor performance loss, until we optimize the
bX() functions to check for the no-derivatives case.
2015-03-03 14:33:19 +01:00
Andreas Lauser
1b22d3ab6b RateConverter: add missing call to averageTemperature()
thanks to [at] bska for noticing this!
2014-12-02 15:56:17 +01:00
Andreas Lauser
4e3a69cc90 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:02 +01:00
Bård Skaflestad
82fc769922 RESV: Add facility for surface-to-reservoir rate conversion
This commit adds a simple facility for converting component rates at
surface conditions to voidage rates at reservoir conditions.  It is
intentionally limited in scope and meant to be employed only in the
context of class FullyImplicitBlackoilSolver<> or something very
similar.  In particular, class SurfaceToReservoirVoidage<> assumes
that it will be used to compute conversion coefficients for
component rates to voidage rates, and that those coefficients will
typically be entered into the coefficient matrix of a linearised
residual.

Add a trivial test just to demonstrate the setup and calling
process.  This is not a feature or correctness test.
2014-08-08 11:40:50 +02:00