Commit Graph

1081 Commits

Author SHA1 Message Date
Andreas Lauser
4416b4ae83 fix typo in version of getInvB_() for generic fluid states 2018-01-19 11:31:50 +01:00
Andreas Lauser
d3b20fa5c5 use has_invB() to decide if the generic or trivial versions of getInvB_() are used
this used to be has_pvtRegionIndex(). While there currently is no
difference in practice because the only fluid state that exhibits a
pvtRegionIndex() method also has invB(), a bug is a bug...
2018-01-19 11:30:55 +01:00
Andreas Lauser
847213f36e Merge pull request #275 from andlaus/implement_TOLCRIT
implement support for the TOLCRIT ECL keyword
2018-01-08 15:41:03 +01:00
Andreas Lauser
68ed9ea7b3 implement support for the TOLCRIT ECL keyword 2018-01-08 11:58:53 +01:00
Andreas Lauser
e4d4454671 Merge pull request #273 from andlaus/avoid_heat
thoroughly rename the thermal laws
2018-01-05 13:59:35 +01:00
Andreas Lauser
86a0e9befc ECL thermal gas PVT: add the heat of vaporization to the gas enthalpy
this does only matters for temperature changes due to dissolution and
evaporization of gas in oil or oil in gas. The comprehensive solution
would be to make the enthalpy of the phases composition dependent, but
ECL does not seem to support this when using the black-oil model.
2018-01-04 15:25:12 +01:00
Andreas Lauser
bf3cffa6b4 thoroughly rename the thermal laws
this was only partially done so far: the term "heat" should be avoided
if possible because it is a somewhat fuzzy concept. Thus, replace it
by "energy" and "thermal" where it is not a well established
term. ("well established" basically means "heat capacity".)
2018-01-04 15:25:11 +01:00
Andreas Lauser
d2588eac7d compute the inverse formation volume factor for generic fluid states
before, if the fluid state did not provide an invB() method,
Opm::getInvB_() just returned 0.0. with this, it uses the composition
and density of the phase in question to compute that quantity.

(also, this commit contains a few stylistic cleanups for
BlackOilFluidSystem)
2018-01-02 10:33:22 +01:00
Andreas Lauser
1f114a2bc9 Merge pull request #268 from andlaus/improve_BlackOilFluidState
improve the BlackOilFluidState class
2017-12-15 09:26:51 +01:00
Andreas Lauser
644240e6b9 improve the BlackOilFluidState class
now the assign() function should work and all functions should exhibit
a doxygen string. note that the inverse formation volume factors are
zero if the fluid state passed as the argument to assign() does not
feature an invB() member function.
2017-12-14 17:54:22 +01:00
Andreas Lauser
a4aa334c02 Merge pull request #267 from andlaus/implement_blackoil_energy
Implement blackoil energy
2017-12-14 10:44:33 +01:00
Andreas Lauser
f8ecd7ceaa implement the ECL thermal laws
Like for the material laws, an EclThermalLaw manager class is provided
to simplify initialization of the parameter objects from ECL decks.
2017-12-14 10:43:54 +01:00
Andreas Lauser
7b8951ed83 refactor the "heat conduction" laws into "thermal laws"
thermal laws are the heat conduction laws plus "solid energy laws"
which can be used to specify the relations which govern the volumetric
internal energy of the solid matrix of the porous medium.
2017-12-14 10:43:54 +01:00
Andreas Lauser
f195effcdd VanGenuchtenParams: remove superfluous include 2017-12-14 10:43:54 +01:00
Andreas Lauser
0bd4596e8d BlackOilFluidSystem: implement enthalpy() 2017-12-14 10:43:54 +01:00
Andreas Lauser
255fa88bd5 BlackOilFluidSystem: honor the STCOND keyword to specify the standard conditions 2017-12-14 10:43:54 +01:00
Andreas Lauser
7e651c2317 black-oil: improve the thermal fluid PVT classes
- Introduce an enthalpy() method to all low-level PVT classes
- change the approach to define temperature dependent density for oil
  and gas to the OPM-specific keywords GASDENT and OILDENT. Funnily
  enough, ECL already has a WATDENT keyword.
2017-12-14 10:43:54 +01:00
Andreas Lauser
835a74cc1e extend BlackOilFluidState by energy related quantities
i.e. enthalpy, internal energy and temperature. To make sure that this
does not affect simulatiors which do not use energy, two additional
template parameters, `enableTemperature` and `enableEnergy` are
introduced and the energy quantities are only stored
conditionally. The first parameter allows to store a temperature in
the fluid state without storing enthalpies while the second stores
everything (i.e., setting it to true also implies the first).
2017-12-14 10:43:54 +01:00
Andreas Lauser
aacdf72356 BlackOilFluidState: document it properly 2017-12-14 10:43:54 +01:00
Andreas Lauser
ab0183f6d8 quad.hpp: simplify the error prevention mechanism for Dune::className()
there is no need to include quad.hpp before dune's
classname.hh. Instead we just include classname.hh into quad.hpp and
it will work unconditionally.
2017-12-14 10:42:23 +01:00
Andreas Lauser
300bbe4fe8 Merge pull request #263 from andlaus/remove_blackoil_satinterpolation
BlackOilFluidSystem: remove interpolation between saturated and unsaturated quantities
2017-12-13 09:49:28 +01:00
Andreas Lauser
b9b81b38b6 BlackOilFluidSystem: re-add the linear interpolation between saturated and undersaturated conditions
since the undersaturated PVT relations may use bi-linear 2D
interpolation but the saturated ones always use linear 1D
interpolation, not having this leads to a discontinuity. that
discontinuity turns out to be very bad news if the partial derivatives
are calculated using finite differences. On the other hand, the
untersaturated PVT relations cannot be used unconditionally (this
would be the clean solution, IMO) because this causes the results to
deflect from those produced by ECL. The hack to make DR[SV]DT work is
to only use the saturated PVT quantities if the R value is
sufficiently large. (This may lead to issues in the future because
there now is a discontinuity w.r.t. R, but let's burn that bridge when
we come to it.)
2017-12-11 15:35:01 +01:00
Andreas Lauser
fc1a042669 black oil: only use the saturated quantities if the R factor is large enough
in the oil case the previous condition that the saturation of the gas
phase is non-zero is cheaper to evaluate, but it does not work when
the maximum Rs value at which the gas phase starts to appear is lower
than the Rs value of the saturated gas. In particular this happens for
the DRSDT keyword.

note that the best solution would be to eliminate these case
distinctions alltogether, but this does not work because ECL does not
seem to use bi-linear interpolation if the pressure gets larger than
the maximum pressure specified by the PVT table. (it only seems to use
the pressure to extrapolate linearly.)
2017-12-11 15:35:01 +01:00
Andreas Lauser
45870255f7 fluid states: remove phaseIsPresent()
this method is now unused and before, it only caused trouble. To
replicate it, use fluidState.saturation(phaseIdx) > 0.0.
2017-12-11 15:35:01 +01:00
Andreas Lauser
a15cb08d2e do not use fluidState.phaseIsPresent() anymore
this lead to problems if finite differences were used because to
calculate the derivative, it may deflect the saturations.
2017-12-11 15:35:01 +01:00
Andreas Lauser
5f650785a9 BlackOilFluidSystem: remove interpolation between saturated and unsaturated quantities
this causes problems with things like DRSDT where
"isSaturated(oilPhasIdx)" is not necessarily related to the presence
of the gas phase. (analogous for DRVDT.)

The impact of performance seems to be negligible:

```
Total time (seconds):         550.185
Solver time (seconds):        534.769
 Assembly time (seconds):     251.509 (Failed: 4.51604; 1.79558%)
 Linear solve time (seconds): 263.03 (Failed: 5.78332; 2.19873%)
 Update time (seconds):       11.0526 (Failed: 0.220144; 1.99177%)
 Output write time (seconds): 18.1411
Overall Well Iterations:      902 (Failed: 7; 0.776053%)
Overall Linearizations:       1890 (Failed: 33; 1.74603%)
Overall Newton Iterations:    1553 (Failed: 33; 2.12492%)
Overall Linear Iterations:    23525 (Failed: 511; 2.17216%)
```

before and

```
Total time (seconds):         556.463
Solver time (seconds):        541.06
 Assembly time (seconds):     253.165 (Failed: 4.42903; 1.74946%)
 Linear solve time (seconds): 267.343 (Failed: 4.52042; 1.69087%)
 Update time (seconds):       11.334 (Failed: 0.214721; 1.89449%)
 Output write time (seconds): 18.0694
Overall Well Iterations:      903 (Failed: 8; 0.885936%)
Overall Linearizations:       1909 (Failed: 33; 1.72865%)
Overall Newton Iterations:    1572 (Failed: 33; 2.09924%)
Overall Linear Iterations:    23866 (Failed: 391; 1.63831%)
```

after this patch, i.e., on my machine the runtime for Norne went from
550 to 556 seconds due to slightly larger number of non-linear and
linear iterations. Note that this also happens if the 1e-4 threshold
value is changed instead of the case distinction being removed. (This
hints on the into the direction that the performance difference is
just numerical noise.)
2017-12-11 15:35:01 +01:00
Andreas Lauser
1f0be92300 add a unit test for BlackOilFluidSystem 2017-12-11 15:35:01 +01:00
Andreas Lauser
53d9d92d65 make Tabulated1DFunction more consistent with UniformXTabulated2DFunction
these are basically cosmetic cleanups.
2017-12-11 15:35:01 +01:00
Andreas Lauser
94b6124fba improve implementation of UniformXTabulated2DFunction
in particular, do not mingle the segment index and the relative
position within the segment into a single number anymore.
2017-12-11 15:35:01 +01:00
Andreas Lauser
408ceb820b Merge pull request #265 from andlaus/remove_useComplexRelations
fluid systems: remove the complex relations flag from the fluid systems
2017-12-04 15:20:30 +01:00
Andreas Lauser
9c57728405 fluid systems: remove the complex relations flag from the fluid systems
this flag is way too non-descript (a complex relation for one person
may be a simple one for another), the implementation is pretty
inconsistent and it makes the code more complicated and harder to
maintain. Thus, IMO the approach turned out to be a bummer, so let's
pull the plug.
2017-12-04 11:08:50 +01:00
Andreas Lauser
0d6ef73d9e Merge pull request #264 from andlaus/add_BlackOilFluidState
add a tailor-made fluid state for black-oil models
2017-12-01 17:52:51 +01:00
Andreas Lauser
7cb5e91e2b add a tailor-made fluid state for black-oil models
this is basically a slightly cleaned up version of
Ewoms::BlackOilFluidState.
2017-12-01 17:25:08 +01:00
Andreas Lauser
5f7ac68b1a Merge pull request #260 from totto82/supportSOF2
Add support for SOF2 for 2p runs.
2017-11-24 10:29:28 +01:00
Tor Harald Sandve
f6146db122 Add support for SOF2 for 2p runs.
Make it possible to use SOF2 in combination with either
SGFN og SWFN for gas-oil and water-oil case respectivly.
2017-11-23 10:46:55 +01:00
Andreas Lauser
cb75a7ad6f Merge pull request #259 from andlaus/fix_n2_heatcap
N2: make the heat capacity consistent with the enthalpy again
2017-11-17 19:19:21 +01:00
Andreas Lauser
0d613a7c25 N2: make the heat capacity consistent with the enthalpy again
I missed the fact that in the enthalpy() function, the polynomial
coefficients are divided, i.e., this component defines a polynomial
for the heat capacity and integrates it for the enthalpy. (not
the other way around.)
2017-11-17 19:09:01 +01:00
Andreas Lauser
0e78de262d Merge pull request #258 from andlaus/fix_component_enthalpy
fix heatCapacity() and enthaply() of some components
2017-11-17 19:00:49 +01:00
Andreas Lauser
db87b77896 fix heatCapacity() and enthaply() of some components
I looked at all components: For the ones that use simple enthalpy
relations, heatCapacity() and enthalpy() should now be
consistent. (Here "simple" means "an approach that I understood without
reading literature for several hours".)
2017-11-16 16:30:24 +01:00
Tor Harald Sandve
ef91bbf7d2 SWATINIT Also scale capPres when water saturation is below residual
This assure that the initial state is in eqvilibrium also for cells with
where SWATINIT is set below residual value.
2017-09-21 14:50:08 +02:00
Andreas Lauser
93d448457c Merge pull request #246 from totto82/gasoil
Allow for 2p gasoil case
2017-09-05 21:28:14 +02:00
Tor Harald Sandve
a13a3a3f62 Allow for 2p gasoil case 2017-09-04 12:32:27 +02:00
Andreas Lauser
d68dd09aee Merge pull request #245 from andlaus/limit_VAPPARS
limit the reduction due to VAPPARS to a factor of 1000
2017-07-31 15:01:13 +02:00
Andreas Lauser
2457b4d5af VAPPARS: considerably increase the epsilon value for the numerator
again, the effect of this on the results should be negligible, but the
numerical performance should become much better.
2017-07-28 23:04:18 +02:00
Andreas Lauser
87122bb2f5 limit the reduction due to VAPPARS to a factor of 1000
a reduction of Rs and Rv of a factor 1000 should be enough physically
and the numerical stability is quite a bit better with this. In
particular, this is should not really matter because the whole concept
of VAPPARS is a staggeringly ugly hack from the outset.
2017-07-28 23:02:37 +02:00
Andreas Lauser
2f537717c8 Merge pull request #244 from andlaus/VAPPARS_limit_SoMax
VAPPARS: limit the maximum oil saturation to 1.0
2017-07-28 20:54:46 +02:00
Andreas Lauser
b631809de8 VAPPARS: limit the maximum oil saturation to 1.0
It should never become larger than 1, but during a Newton-Raphson
update it may happen anyway.
2017-07-28 19:13:10 +02:00
Andreas Lauser
3a65e712c9 Merge pull request #242 from andlaus/Evaluation_default_copy
Evaluation: use the trivial copy constructor and copy operator
2017-07-27 20:14:24 +02:00
Andreas Lauser
be96015760 Merge pull request #243 from andlaus/no_by_value_catch
TabulatedComponent: don't catch std::exception by value
2017-07-27 20:03:14 +02:00
Andreas Lauser
2b4114907e TabulatedComponent: don't catch std::exception by value
std::exception is a polymorphic type and catching these by values
generates warnings when using the latest GCC from SVN. Besides this,
catching objects by value is bad style and was unintended from the
start.
2017-07-27 18:04:43 +02:00