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.)
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".)
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.
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.
In fact, the temperature at the reservoir is not constant, so this
should be more thought of as "representative temperature" of the
reservoir.
In ECL, this value is specified using the RTEMP or the RTEMPA
keywords, opm-parser provides this via the table manager. (NB: is this
really something that belongs there?)
the problem is that some of these function names clash with those for
code using AutoDiffBlock. This is normally not a problem because of
the SFINAE rule, but the static assertation makes the compiler bail
out before SFINAE kicks in.
IMO this is a little unfortunate because without this static_assert
compiler errors are bound to becomming quite a bit more obscure, but
as long there is code which uses both AD approaches at the same time,
I cannot see a way to keep the assert without moving one approach or
the other to a different namespace (or renaming the math function for
one).
this patch converts to code to use the convenience functions instead
of the math toolboxes whereever possible. the main advantage is that
Opm::foo(x) will work regardless of the type of `x`, but it also
reduces visual clutter.
also, constant Evaluations are now directly created by assigning
Scalars, which removes further visual noise.
while I hope it improves the readability of the code,
functionality-wise this patch should not change anything.
i.e., we should not return references and we also should remove the
const qualifier in this context. (if these are wanted, the calling
scope should add them.)
this is anlogous to the dry gas PVT code but it uses the PVDS and
SDENSITY keywords.
Note that this object is only used by the eWoms black-oil solvent
code, i.e. it not used by the black oil fluid system or any other
opm-material code, but IMO opm-material is the right place for it
because of its similarity to dry gas.
that warning was correct, but bogus: while this data was indeed used
without initialization, using the mass composition of a phase before
fully specifying the molar composition is incorrect and would have
trigger a valgrind complaint. (valgrind will still complain after that
patch.)