Commit Graph

1118 Commits

Author SHA1 Message Date
Andreas Lauser
b5b7864ca5 add a unit test for the components
note that this test only checks for API compliance but not if the
compotations of the components make any sense.
2015-05-21 15:33:09 +02:00
Andreas Lauser
dadefcd3f3 make all components local-AD aware 2015-05-21 15:33:07 +02:00
Andreas Lauser
35bbae78ab make the linear 1D and 2D tabulation classes local-AD aware 2015-05-21 15:33:05 +02:00
Andreas Lauser
2739b031b7 make the spline class usable with local function evaluations instead of scalars 2015-05-21 15:33:03 +02:00
Andreas Lauser
b9d9f893d9 introduce the concept of "math toolboxes"
these are "traits" classes and provide a way to access the value of
function evaluations, conditional access to its value (i.e., to
forward them if the target object of an assignment includes the
derivatives or use the function value if not) and some algebraic
functions.

the main idea is to be able to abstract the differences between plain
scalars and function evaluation...
2015-05-21 15:33:01 +02:00
Andreas Lauser
d34bbc57a9 add a "local" AD framework
The basic idea is to replace "plain" scalar values by "function
evaluations": these store the function's value plus a set of
derivatives for it and the chain rule is used to "drag" the
derivatives along.

So far, the framework only implements the "forward" approach to
automatic differentiation and expression templates are not supported
yet. (The latter point may change in the furture, though.)

"local" means that the framework uses static arrays to represent the
derivatives, i.e. the number of derivatives which are required must be
specified at compile time. Compared to dynamic arrays this improves
efficiency considerably if function evaluation objects must be
allocated and deallocated frequently.
2015-05-21 15:32:59 +02:00
Andreas Lauser
7b49035575 unify the formatting of the copyright statements 2015-04-29 13:59:08 +02:00
Andreas Lauser
d601f672ac {geometric,harmonic}Mean(): handle the case where both factors are zero properly
without this commit, this case caused NaNs which in turn cause quite a
bit of hilarity...
2015-04-29 13:59:08 +02:00
Andreas Lauser
5b08de4244 incorperate all infrastructural classes required into opm-material itself
they used to be in opm-core, but this allows to be more flexible with
the dependency order: What's now called "opm-core" can easily depend
on opm-material which might come in handy for the refactoring.

Besides moving in classes from opm-core, the infrastructural code
which was still in opm-material is moved to the directory
opm/material/common. The intention is to collect these classes at a
central location to make it easy to move them to a real "core" module.
(if this is ever going to happen.)
2015-04-28 12:17:49 +02:00
Andreas Lauser
0c4fd68f2a update version number to 2015.10 2015-03-29 15:13:19 +02:00
Andreas Lauser
2c5d51f841 change the version number to the scheme used by eWoms
i.e., there is no distinction between the "API version" and the
"Release version" anymore. IMO, the split scheme is just confusing for
no benefit because we are handling API/ABI changes in a pretty relaxed
manner anyway: i.e., whenever the "release version" gets incremented,
the "API version" needs to follow suite!
2015-03-29 15:07:06 +02:00
Andreas Lauser
898930b3d5 black oil fluid system: implement vaporized oil 2015-02-11 15:31:15 +01:00
Andreas Lauser
dc5fdd7059 change the surface temperature to 15.56 degrees Celsius
this is what Eclipse seems to use, at least according to the STDCOND
keyword...
2015-02-05 16:22:31 +01:00
Andreas Lauser
e036cbea5c Black oil fluid system: use dynamic polymorphism to determine the phase quantities
this allows to freely mix and match ECL keywords like PVT[OG],
PVC[OG], PVDC[OG], and PVTW...
2015-02-05 16:22:31 +01:00
Andreas Lauser
f896d85f4f add a wrapper macro for the c++-2011 "final" keyword 2015-02-05 16:03:47 +01:00
Andreas Lauser
ee05d77f79 black oil fluid system: use extrapolation for all tabulated quantities
this seems to be required for my version of SPE9...
2015-01-26 16:08:25 +01:00
Andreas Lauser
ea3c68694b black oil fluid system: correct a few method descriptions and names 2015-01-26 12:56:53 +01:00
Andreas Lauser
d074070e11 Revert "rename {gil,gas}FormationVolumeFactor to \1FormationFactor"
This reverts commit 1cf745943a. After a
more thorough investigation, the cannonical name of these quantities
turned out to be "* formation volume factor"...
2015-01-26 12:03:42 +01:00
Andreas Lauser
1cf745943a rename {gil,gas}FormationVolumeFactor to \1FormationFactor
the new name is shorter, not less descriptive and it seems like it is
also more common...
2015-01-25 18:20:58 +01:00
Andreas Lauser
b1c35e0e0d Black oil fluid system: make immiscible components less dissolvable
This is only relevant for the approximation which uses large instead
of infinite fugacity coefficients for immiscible components. The
motivation is to bring the solution of the NCP flash solver closer to
what's expected using the blackoil assumptions directly. (Physically
speaking, the result is less realistic in most cases, though...)
2015-01-21 15:33:12 +01:00
Andreas Lauser
f1cb777fb0 Tabulated functions: fix the bisection code
seems like somebody can't properly implement an interval-halving
algorithm. Maybe I should consider to give back my degree...
2015-01-21 15:33:12 +01:00
Andreas Lauser
0b675bfa38 Black oil fluid system: fix Rs <-> XoG conversions
some stupid guy messed them up...
2015-01-21 15:33:09 +01:00
Andreas Lauser
2f343412b7 black oil fluid system: Do things the Eclipse way
i.e., interpolate between inverse volume factors and the inverse of
the product of the volume factors. I have my doubts if these
"optimizations" make the results physically better, but it seems like
they at least make things different...
2015-01-21 15:32:13 +01:00
Andreas Lauser
a44bb9b887 add methods to access the sample points to the tabulated function classes
also, the getSamplePoint() has been renamed to valueAt()
2015-01-21 15:32:13 +01:00
Andreas Lauser
3f82e67847 Black oil fluid system: Use piecewise linear interpolation for all parameters
seems like this is what causes the discrepancies to eclipse in SPE1.
2015-01-21 15:32:05 +01:00
Andreas Lauser
e01cf39448 add a class for piecewise linear 1D functions
this class exhibits almost the same interface as Opm::Spline in order
to faciliate replacing one by the other.
2015-01-16 17:50:39 +01:00
Andreas Lauser
df0dc97c53 fluid-matrixinteractions: remove the derivative functions
these were unused, quite likely broken and could only calculate the
derivatives with regard to some quantities.

if the general derivatives of the relperms and capillary pressures are
ever required, finite differences can be used to save the
day... (these *might* be sightly slower, but they are automatically
consistent with the function.)
2015-01-08 17:57:40 +01:00
Andreas Lauser
0c8a5503d7 fix the headercheck
i.e. make all headers includable without preconditions.
2015-01-06 14:38:00 +01:00
Andreas Lauser
e97c16eeb5 PiecewiseLinearTwoPhaseMaterial: use constant extrapolation.
this makes the result identical to the saturation functions used by
opm-core, although I have my doubts if this is the physically correct
thing to do.
2014-12-16 17:18:54 +01:00
Andreas Lauser
33671258eb EclDefaultMaterial: fix typo
it is Sw instead of Sg. with this, the results for SPE9 seem
reasonable again.
2014-12-16 17:17:37 +01:00
Andreas Lauser
578980e16a PiecewiseLinearTwoPhaseMaterialParams: use the same API as SplineTwoPhaseMaterialParams
this allows to use the two by changing the class name but without
requiring any further code changes...
2014-12-08 17:50:36 +01:00
Andreas Lauser
c267cacbd6 water viscosity: calculate it the same way as documented by the Eclipse RM 2014-12-08 14:58:02 +01:00
Andreas Lauser
8109900567 ECL default material: make the oil relperm match that of autodiff
at least it seems to be very similar for SPE1. the difference in the
BHP of the wells for SPE1 is significantly reduced (but still too
large) by this...
2014-11-27 19:26:47 +01:00
Andreas Lauser
e57b4410f1 ECL default material parameters: add connate water 2014-11-27 19:22:06 +01:00
Andreas Lauser
447268e79d remove unused variable to fix compiler warnings 2014-10-29 16:07:58 +01:00
Andreas Lauser
1f91c1fd93 rename PengRobinsonparamsMixture.hpp to PengRobinsonParamsMixture.hpp 2014-10-29 16:07:21 +01:00
Andreas Lauser
6b5973d6a1 black oil fluid system: use Rs instead of XoG and interpolate the inverse B factor
this is much closer to how things are done in Eclipse. For the
external API, nothing changes provided that only the "official" fluid
system API is used...
2014-10-01 13:46:12 +02:00
Andreas Lauser
f4eaf1769b UniformXTabulated2DFunction: fix interval halving code
now the values for X and Y can be added in ascending or descending
order. The descending code path is pretty slow though, and it is still
possible to screw up the object by specifying the inputs in a totally
unsorted manner. (At this place, I don't really care about these two
things, though.)
2014-10-01 13:41:44 +02:00
Joakim Hove
59bd096d40 Merge pull request #18 from andlaus/table_improvements
adapt the the table related API changes of opm-parser
2014-09-19 15:27:53 +02:00
Andreas Lauser
b865227cfc adapt the the table related API changes of opm-parser 2014-09-18 16:49:02 +02:00
Andreas Lauser
0f17c64f39 Black oil fluid system: copy the undersaturated oil info from a master table
... instead of just assuming some arbitrary behavior. this fixes SPE9
for eWoms as far as the fluid system is concerned. (the ecl_blackoil
still seems to have some problems with anisotropic permeability. this
will hopefulls be fixed soon.)
2014-08-19 15:53:28 +02:00
Andreas Lauser
feeedb7428 properly deal with water compressibility and water "viscosibility" 2014-08-15 16:26:50 +02:00
Andreas Lauser
39cfb4e38a Make it work if HAVE_OPM_PARSER is false
currently, this can't happen because opm-material depends mandatorily
on opm-core which in turn requires opm-parser. In the future, this
might change, though...
2014-08-15 14:01:44 +02:00
Andreas Lauser
197fe4b1e3 black oil fluid system: fix stupid bug when setting the gas viscosity
gas viscosity != gas formation volume factor (even if the values are
somewhat similar)
2014-08-12 16:45:19 +02:00
Andreas Lauser
1051a964e0 black oil fluid system: rename surfaceDensity() to referenceDensity()
because it seems like what eclipse uses in the DENSITY keyword is not
really for surface pressure but at the pressure where the phase's
formation volume factor is one. (this pressure does not seem to be
specified and can potentially be different for every fluid phase.)
Thus rename surfaceDensity() to referenceDensity() and remove the
logic to allow volume formation factors which are not equal to one at
the reference pressure. (i.e., formerly the surface pressure.)
2014-08-12 15:49:01 +02:00
Andreas Lauser
d4a58aefd3 fluid systems: return human readable strings for the phaseName() method
this avoids a bit of guess-work...
2014-08-07 19:19:03 +02:00
Andreas Lauser
883f032aa0 {Spline,PiecewiseLinear}TwoPhaseMaterial: limit the relperms to [0, 1]
it used to be the range of the sampling points. If for some reason the
sampling points describe a subset of the full range, the material laws
use extrapolation outside of the table and properly limit the values
of that operation.

In the real world, the effect of this change is rather limited because
all tested tables used the range...

TODO: adapt the evalDerivative() methods. This is not very urgent, though
because they are usually not used...
2014-08-06 14:53:42 +02:00
Andreas Lauser
34f50e6613 fluid-matrix interactions: add a tabulated two-phase pc/kr law which uses splines
compared to the variant which uses linear interpolation, this makes
the resulting curves smoother and thus hopefully improves the
convergence rates of the simulations.
2014-08-06 13:52:23 +02:00
Andreas Lauser
1108f24c33 black oil fluid system: fix build on GCC 4.4
this compiler is for some reason not able to determine the number of
phases for externally defined attributes the way it was done. this is
most likely a compiler bug (or it is a left-over ideosyncrasy from
c++-2003 which was not yet removed for GCC 4.4...)
2014-08-06 11:26:25 +02:00
Andreas Lauser
20b63fdb6e Black oil fluid system: implement support for multi-region PVT tables
it is slightly hacky that the ParameterCache is used to specify the
PVT region. Having said that, the multiple PVT regions stuff in no way
based on physical assumptions, but is just a way to fit the black-oil
model to the measured values of real reservoirs...
2014-08-05 16:27:08 +02:00