say 99.95% of all time: premature optimization is the root of all
evil.
in this case it turned out that iterating over a std::unordered_map is
very slow and that this is a quite common operation in
ebos. Fortunately the fix for this problem is very simple: use the
tree-based std::map instead of the hash function based
std::unordered_map.
on SPE9 this yielded a performance improvement of about 10% on my
machine...
this is because the "bottom hole pressure" by default is the the
presssure at the center of the _topmost_ cell penetrated by the
well. (The terminology keeps getting more weird the longer you look at
it.)
this patch also changes the default way to calculate the reference
depth from the center of the deepest to the center of the highest cell
and makes the reference depth settable in the deck.
note: the doxygen groups are quite a bit behind the curve and should
be overhauled soon. (e.g. now there's not only the vertex centered
finite volume space discretization anymore...)
first, it's not a good idea to go over the whole grid for each well at
the beginning of a time step, second the Jacibian matrix of the
linearization only needs to be recreated if the well completions have
changed...
SPE is closer, but not close enough. Note that the using total
mobility is probably "more wrong" than the previous approach (i.e.,
lambda = 1/viscosity of the injected phase)
"BHP" stands for "bottom hole pressure" so it sounded logical that
"THP" is an acronym for "top hole pressure". It isn't but the quantity
in question is still the pressure which is seen at the top of the
well's bore hole...
this helps to keep the core blackoil model code lean and mean and it
is also less confusing for newbies because the ECL blackoil simulator
is not a "test" anymore.
in case somebody wonders, "ebos" stands for "&eWoms &Black-&Oil
&Simulator". I picked this name because it is short, a syllable, has
not been taken by anything else (as far as I know) and "descriptive"
names are rare for programs anyway: everyone who does not yet know
about 'git' or 'emacs' and tells me that based on their names they
must be a source-code managment system and an editor gets a crate of
beer sponsored by me!