Commit Graph
99 Commits
Author SHA1 Message Date
Tor Harald Sandve cb5238f5dc BUGFIX
Updated solvent model after #825
Store rsSat and rvSat in simulator container for outut.
2016-09-19 11:10:14 +02:00
Tor Harald Sandve 2b09aca23a BUGFIX. Currently handle ACTNUM in minPvFillProps_()
Make sure that inactive cells are not included in the averaging
2016-08-09 15:51:38 +02:00
Tor Harald Sandve b468d2baa1 BUGFIX. Use the modified NTG values in multiplyHalfIntersections_(..) 2016-08-08 13:22:02 +02:00
Tor Harald Sandve 9bfb3f909e Allow for 2 phase initialization using EQUIL 2016-06-28 15:50:50 +08:00
Tor Harald Sandve d1d3b86299 Allow for 2 phase initialization using EQUIL 2016-06-08 09:22:52 +02:00
Tor Harald Sandve d035881a0a Adds has_disgas and has_vapoil flags to hydrocarbonstate initialization
Gas saturation must be used as primalvariable if DISGAS and VAPOIL is
not used.
2016-06-07 08:23:47 +02:00
Tor Harald Sandve cc2a7d8767 Cleanup in updateState in the solvent model 2016-05-19 12:38:44 +02:00
Tor Harald Sandve 0730ffcb69 BUGFIX. Wrong uses of parenthesis in Cramer's rule 2016-05-19 11:28:36 +02:00
Tor Harald Sandve bd0ad6aa5b Adapt to changes related to hydroCarbonState 2016-05-19 11:25:27 +02:00
Tor Harald Sandve 03d6dde203 Convergence improvment in the TL model
-- division on zero is avoided
-- if no solvent is present, pure values are used for the density and
visocity
2016-05-19 10:49:22 +02:00
Tor Harald Sandve 8be3ca7557 Support for liveoil in combination with solvent
- a solvent specific updateState is used to assure that the correct oil
saturation is used to detect phase transision
- presence of gas is compensated for in the oil phase
2016-05-19 10:49:22 +02:00
Tor Harald Sandve cd91444bc9 Compute the hydroCarbonState after initializing from restart files 2016-05-13 14:09:51 +02:00
Tor Harald Sandve 5757ef8ad0 Adjust to upstream changes
Change from std::vector<int> to std::vector<HydroCarbonState> for the
hydroCarbonState
2016-05-13 12:40:50 +02:00
Tor Harald Sandve 01c782dbf3 Remove primalvariable_ and use hydroCarbonState instead
the hydrocarbonstate is stored in the reservoir state and
used instead of the primalvariable_
The initial hydrocarbonstate is computed using
initHydroCarbonState(...);
2016-05-13 09:04:48 +02:00
Tor Harald Sandve e8fcf9259c Use stored hydrocarbonstate to get primal variables
If hydrocarbonstate is not provided by the state fall back to
the old behaviour of computing the hydrocarbonstate from the saturations
2016-05-12 10:38:49 +02:00
Tor Harald Sandve 09ab530674 Add the option of computing the full sparity pattern based on all phases
- For some cases (for instance involving solvent flow) the reasoning for
only adding the pressure derivatives seems to fail. As getting the
sparsity pattern is non-trivial, in terms of work, the full sparsity
pattern is only added when specified by the parameter
"require_full_sparsity_pattern"
- For solvent runs "require_full_sparsity_pattern" defaults to true for
all other runs the default is to only extract the sparsity pattern from
the pressure derivatives.
2016-05-11 15:13:52 +02:00
Tor Harald Sandve 18434e54ad Query the compute_well_potential parameter only once
-- and fix some comments
2016-04-20 08:32:57 +02:00
Tor Harald Sandve e9b097cbf4 Only compute well potential if needed
A boolen user parameter is added to controll the computation of well
potential.

This is a temporary fix to assure that no extra computation time is used
on well potential calculation if it is not needed. The long term fix
will require a more thorough revising of the well group implementation.
2016-04-19 16:24:28 +02:00
Tor Harald Sandve 84972ac21e Fix bhp/thp logic in well potential calculation
Pick the most restrictive bhp (not the one that gives the largest
potential flow)
2016-04-19 15:58:05 +02:00
Tor Harald Sandve 4867e14f88 Fixes after rebase
-- remove some leftovers from merge process
-- start using stdWells()
2016-04-19 09:41:25 +02:00
Tor Harald Sandve b216302895 Adapt to usage of stdWells() 2016-04-19 09:21:16 +02:00
Tor Harald Sandve cc48e8a17e Add support for THP in well potential calculations 2016-04-19 09:21:15 +02:00
Tor Harald Sandve 18246263e9 Move computation of well potentials from simulator class ot model class
- the computation of well potentials in the model class calculates the
well potentials using computeWellFlux()
- in this way the well potential calculations also handle well where
some perforations are closed by the simulator due to cross-flow.
- the well potentials pr perforation and phase is stored in the well
state.
2016-04-19 09:21:15 +02:00
Tor Harald Sandve e5254f3779 Adapt to changes interface of extractWellPerfProperties
The BlockoilmultisegmentModel is updated to account for changes in the
extractWellPerfProperties() interface.
2016-04-05 09:13:29 +02:00
Tor Harald Sandve 764d8a1c3f Remove leftovers from a merge process going wrong 2016-04-05 09:03:22 +02:00
Tor Harald Sandve 89e540cb2c Pass solutionState as first parameter
output parameters go last...
2016-04-05 08:57:07 +02:00
Tor Harald Sandve 925d0becf3 Fix to make flow_solvent run decks without solvent 2016-04-05 08:57:07 +02:00
Tor Harald Sandve 541475b2db Implement computePropertiesForWellConnectionPressures for solvent model
The solvent specify part of computeWellConnectionPressures is factored
out to computePropertiesForWellConnectionPressures in order to reuse
the computeWellConnectionPressures from the base model.
2016-04-05 08:57:07 +02:00
Tor Harald Sandve 9cd0383d36 Factor out computation of properties for well connection pressures
Computation of properties used in computeConnectionPressureDelta
is factored out to computePropertiesForWellConnectionPressures
The motivation is to be able to use a modified version of
computePropertiesForWellConnectionPressures in the solvent model
2016-04-05 08:57:07 +02:00
Tor Harald Sandve 7b81facfb0 Make use of extractWellPerfProperties to avoid code duplication
The following changes are done in order to remove the duplicated code in
assemble().
- extractWellPerfProperties takes SolutionState as input (only used in
the solvent model)
- the computation of effective parameters is moved to computeAccum()
With these changes the solvent model can use assemble() from the base
model.
2016-04-05 08:53:09 +02:00
Tor Harald Sandve 21ad35b691 Fixes to test_solventprops_ad
- fix mismatch between grid size and the test cell size
- avoid using new
2016-04-05 08:48:54 +02:00
Tor Harald Sandve a2bff9149a Remove unused argument from computeWellPotentials() 2016-04-04 15:03:59 +02:00
Tor Harald Sandve e4b52a457f Only calculate well potentials for cases with well groups 2016-04-04 09:03:13 +02:00
Tor Harald Sandve bd81bda57b Remove well_perforation_pressure_diffs fr WellStateFullyImplicitBlackoil
- Calculate the well perforatino pressure difference based on bhp and
perforation pressures instead of storing it in
WellStateFullyImplicitBlackoil
2016-04-04 08:35:59 +02:00
Tor Harald Sandve 4824019b92 Adapt to rename of parserMode to parserContext 2016-04-01 16:08:30 +02:00
Tor Harald Sandve 36a73591b0 Fix doc. for pressureMixingParameter 2016-04-01 15:59:17 +02:00
Tor Harald Sandve a02a07289e Implement pressure effects in the Todd-Longstaff mixing parameter
The Todd-Longstaff model is extended to incorporate pressure effects
The solvent viscosity is then caculated as

mu_eff = mu_s^(1-\alpha * \omega) * mu_mix^(\alpha * \omega)

where \omega accounts for the porous media effects and \alpha =
\alpha(pressure) accounts for the miscibility of the solvent and oil
when contacted.
The \alpha values can be given using the TLPMIXPA keyword

If no entries are given to TLPMIXPA the table specified using PMISC will
be used as default.
IF TLPMIXPA does not appear in the grid \alpha = 1 and the pressure
effect is neglected.
This is tested in test_solventprops_ad.cpp
2016-04-01 15:55:56 +02:00
Tor Harald Sandve 30bd24f2fe Compute well potentials
The well potentials are caculated based on the well rates and pressure
drawdown at every time step. They are used to calculate default guide
rates used in group controlled wells.

well_perforation_pressure_diffs is stored in
WellStateFullyImplicitBlackoil as it is needed in the well potential
calculations.
2016-04-01 14:58:46 +02:00
Tor Harald Sandve d91831b971 Avoid comparsion of floating point numbers 2016-03-18 14:30:47 +01:00
Tor Harald Sandve 94aa360fe6 Bugfix. Fix setting initial rates in updateWellControls
- The initial rates are only set to target values for single phase
producers (orat, wrat, grat).
- For injectors compi is used to determine the initial target rates.
2016-03-18 13:16:23 +01:00
Tor Harald Sandve 753909b8b9 Fix convergence issues for negative relperm endpoints.
The relative permeabilty endpoints are scaled by the miscibility
function. The endpoints is not supposed to be negative therefore all
negative values are replaced by zero.
2016-03-16 11:04:56 +01:00
Tor Harald Sandve 41aa55ec82 Allow for shut wells in solvent run 2016-03-16 11:00:00 +01:00
Tor Harald Sandve 35b34f1b3a Add pow() for constant base raised to variable exponent in AutoDiffBlock
- associated tests are added
- this PR also contains some clean up
2016-03-08 10:35:29 +01:00
Tor Harald Sandve b2e02f6d2b Add power method for general f^g in the AutoDiffBlock
A power method where both f and g are ADB variables is added
using the general derivative rule
(f^g)' = f^g * ln(f) * g' + g * f^(g-1) * f'

Tests are added to test_block.cpp
2016-03-07 14:23:45 +01:00
Tor Harald Sandve 20819b8a03 Skip the relperm diagnostics for the solvent model. 2016-03-07 09:19:42 +01:00
Tor Harald Sandve 948d985f56 Add support for PMISC
Pressure effects are added to relative permeability, capillary pressure,
viscosity and density miscibility
2016-03-04 11:34:31 +01:00
Tor Harald Sandve fd219dd544 Add whitespaces and comments to beautify the code 2016-02-17 10:43:01 +01:00
Tor Harald Sandve b02589316f Add support for MISC regions
- element wise power operator impemented in AutoDiffBlock
- TL parameters are given pr cell
2016-02-15 14:44:14 +01:00
Tor Harald Sandve 9328bd5af5 Support pvt and saturation regions in SolventPropsAdFromDeck 2016-02-15 10:07:47 +01:00
Tor Harald Sandve 0a30d912e8 Some more cleanup adressing PR comments. 2016-02-12 11:02:03 +01:00
Tor Harald Sandve dee96db6b2 Cleaning and adding comments 2016-02-12 10:42:26 +01:00
Tor Harald Sandve c85f10046c Density and viscosity as inputs instead of computed in computeMassFlux
Density and viscosity are given as input instead of calculated inside
computeMassFlux. This allow for modifying the properties prior to
calling computeMassFlux which avoids code duplication in the solvent
implementation.
2016-02-12 10:42:26 +01:00
Tor Harald Sandve 0745be3eba Various bugfixes in computing effective ToddLongstaff parameters
The most significant bug was in the computation of effective saturation
fraction for the gas phase. The current implementation differs from the
manual.
2016-02-12 10:42:26 +01:00
Tor Harald Sandve cf29eb9aa4 Adapt to changes in the TableContainer 2016-02-12 10:42:26 +01:00
Tor Harald Sandve a38964c641 Some cleaning 2016-02-12 10:42:26 +01:00
Tor Harald Sandve 13117153a9 Use effective properties in the computation of well segment densities 2016-02-12 10:42:26 +01:00
Tor Harald Sandve beafccc038 Refactor the ToddLongstaffModel in separate function 2016-02-12 10:42:26 +01:00
Tor Harald Sandve b8e20917cc Add Todd and Longstaff model
Add method to calculateEffectiveProperties (viscosity and density)
using the Todd and Longstaff model.

The effective properties are stored in mu_eff_ and b_eff_ in the
BlackoilSolventModel and accessed using fluidReciprocFVF and
fluidViscosity
2016-02-12 10:42:26 +01:00
Tor Harald Sandve 17554b4921 Add support for TLMIXPAR
Add support for Todd-Longstaff mixing paramters
2016-02-12 10:42:26 +01:00
Tor Harald Sandve 38c8cd981e BUGFIX. Fix surfaceDensity calculations 2016-02-12 10:42:26 +01:00
Tor Harald Sandve 1e64409f28 Scaling of relative permeability endpoints by the miscibility function 2016-02-12 10:42:26 +01:00
Tor Harald Sandve bcb0abd9c9 Fix well input and prepare for critical saturations 2016-02-12 10:42:26 +01:00
Tor Harald Sandve e448548d5a Some refactoring to avoid code duplication
computeMassFlux in BlackoilSolventModel_impl.hpp is refactored to avoid
code duplication
2016-02-12 10:42:26 +01:00
Tor Harald Sandve 238e7c19f3 Add support for miscibilty in the relperms 2016-02-12 10:42:26 +01:00
Tor Harald Sandve bbee43ef7a Refactor computeMassFlux in the SolventModel
The computeMassFlux in the solventModel is refactored to allow for
modification of relperms for all phases.
2016-02-12 10:42:26 +01:00
Tor Harald Sandve 3d2b7f23c0 Read MSFN and SOF2 and create accociated function
- makeAD() is added to avoid copying
2016-02-12 10:42:26 +01:00
Tor Harald Sandve dbdc42f599 Fix typo in BlackoilPropsAdFromDeck 2015-12-14 12:27:57 +01:00
Tor Harald Sandve afbf5ff366 Add code to use the pinchProcessor
MinpvfillProps is only called if OPMFIL is true, while
the pinchProcessor is only called if OPMFIL is false.

Currently opmfil is hardcoded to true i.e.
The pinchProcessor is never called and the minpvfillProps is always
called.
2015-12-14 11:14:46 +01:00
Tor Harald Sandve 4b66b0874e Add methods for critial gas and gas in oil saturations
Methods that returns the scaled critical gas (SGCR) saturation and the
scaled critical gas in oil saturation (SOGCR) is added to
BlackoilPropsAdFromDeck and BlackoilPropsAdInterface

A test is added in test_boprops_ad and fluid.data is modified to make
the test non trivial.
2015-12-11 12:53:54 +01:00
Tor Harald Sanve 650fef5bc2 Add power operator to AutoDiffBlock 2015-12-10 10:30:28 +01:00
Tor Harald Sanve 6883db77cf Adapt to changes in the NNC class 2015-12-08 13:05:44 +01:00
Tor Harald Sandve 153365f4d0 Adapt to changes in the NNC class 2015-12-08 13:03:15 +01:00
Tor Harald Sandve e3393c5ee9 Handle combination of threshold_pressure and nnc
The nncs threshold pressures are calculated and appended to the face
threshold pressures
2015-12-08 11:03:05 +01:00
Tor Harald Sandve 99ddc46318 Store the nncs in geoprops 2015-12-08 10:38:58 +01:00
Tor Harald Sandve 298442c281 Cleanup after rebase
- cleanup of some rebase mess
- Added comments
- Use the maxDp for the NNCs
- remove misplaced break in the pinchprocessor
2015-12-08 09:50:07 +01:00
Tor Harald Sandve 5b1f249f96 Calculate thresholdPressures for the NNCs 2015-12-08 09:25:35 +01:00
Tor Harald Sandve 67eadc30e5 Adapt to changes in EclipseGrids
getCellCenter() in EclipseGrid no longer returns
tuble<double,double,double> but array<double,3>
This simplifies its usage.

Variable name is changed from cellCentroid to cellCenter to emphasize a
difference between the value in the unstructured grid and in EclispeGrid
2015-11-25 15:15:22 +01:00
Tor Harald Sandve 2a13275943 Use cell depth calculated directly from the corners of the cell 2015-11-24 10:20:12 +01:00
Tor Harald Sandve aeb8807d89 Use cell centroid from EclipseGrid
The cell center in EclipseGrid is computed based on averaging the
corners of the cells as in Eclipse and not computing the centroid of the
cell as in the unstructured grid in opm.
2015-11-24 10:20:12 +01:00
Tor Harald Sandve a47c9add9b Change interface of surfaceDensity()
Add phaseIdx as input and return array of n density values for the
phase. And adapt the usage accordingly.
2015-11-10 14:54:49 +01:00
Tor Harald Sandve a46b64adcd Support for non constant surface densities
The surface density function returns one value pr cell to allow for non
constant surface densities.
2015-11-10 12:49:19 +01:00
Tor Harald Sandve f02a02320d Small fixes for readabilty 2015-10-19 08:34:16 +02:00
Tor Harald Sandve 16140c54fc Update comment
Cases with wells with no flow where crossflow is banned is handled in
the parser by shutting these wells. They will never be seen by the
simulator.
2015-10-19 08:17:52 +02:00
Tor Harald Sandve 0a5364a1d8 Modifications to handle additional argument in add_well() 2015-10-19 08:17:52 +02:00
Tor Harald Sandve 1772a8c257 Handle allowCrossFlow flags from the input deck 2015-10-19 08:15:21 +02:00
Tor Harald Sandve 3f089b10d8 Add support for banning crossflow in the well equations 2015-10-19 08:15:21 +02:00
Tor Harald Sandve dff77afff7 Use getConvergence and convergenceReduction from base 2015-10-06 11:04:34 +02:00
Tor Harald Sandve 56d6a1f54e Add missed parentheses from the rebase process 2015-10-06 10:51:20 +02:00
Tor Harald Sandve 83bcd24108 Fill vector with zeros as constructed 2015-10-06 10:40:18 +02:00
Tor Harald Sandve 60a6451a6f Fix typo 2015-10-06 10:40:18 +02:00
Tor Harald Sandve 8b8ca200d6 Use implemented computeWellConnectionPressures() 2015-10-06 10:40:18 +02:00
Tor Harald Sandve 6106d560ba Compute matbal_scale for the solvent model
The material balance scaling is extended to the solvent model
The gas value is used as default and an updateEquationsScaling() method
is added.

Minor modifications is done to the BlackoilModelBase.hpp and
BlackoilModelBase_impl.hpp in order to re-use code from the base case.
2015-10-06 10:40:18 +02:00
Tor Harald Sandve fb9e21d695 Add a local version of computeWellConnectionPressures()
Solvent is accounted for in the calculations of well connection
pressures by adjusting the surface_density and the b-factor

TODO: Restructuring to avoid code duplication with
BlackoilModelBase_impl
2015-10-06 10:38:36 +02:00
Tor Harald Sandve 7bdd91d78f Allow for different surface densities in well perforations
The surface density input in well_perforation_densities() in
WellDensitySegmented.hpp is changed from one value pr. phase to one
value pr phase and perforation. This allow for different densities in
different perforation. The test is changed accordingly.
2015-10-06 10:38:36 +02:00
Tor Harald Sandve 23f4f48df5 Initialize well solvent fraction
The well solvent fraction is set to zero as default.
2015-10-06 10:38:36 +02:00
Tor Harald Sandve 18613b9c7b Make flow_solvent run when SOLVENT is not specified 2015-10-06 10:38:36 +02:00
Tor Harald Sandve c9b6db6c7e Use a weighted sum of the b-factors of gas and solvent
A weighted sum of the b-factors of gas and solvent is used in the well
equation.
2015-10-06 10:33:17 +02:00
Tor Harald Sandve 08ce231869 Recalculate gas fluxes
The gas fluxes must be recalculated along with the mobilities after the
gasRelPermMultiplier is applied
2015-10-06 10:33:17 +02:00
Tor Harald Sandve 853e1f0dc1 Use ADB for solvent fraction 2015-10-06 10:33:17 +02:00