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
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.
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
- 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.
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.
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.
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.
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)
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.
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...
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.