Commit Graph

58 Commits

Author SHA1 Message Date
Bård Skaflestad
7d67ddc099 UnitSystem: Add skeleton implementation of LAB conventions
This commit adds conversion factors for the ECL LAB unit
conventions--notably Atmospheres for pressures, Hours for time,
Grams for mass, and cubic centimetres for volumes.
2016-09-01 12:21:53 +02:00
Arne Morten Kvarving
4c32e602da changed: generate unit type conversion constants on compile-time
as a bonus it avoids unused variable warnings in compile units
only using parts of the conversion units.
2016-08-15 14:52:48 +02:00
Jørgen Kvalsvik
f6cffb4c07 Support for ratio-type units 2016-07-19 14:34:51 +02:00
Jørgen Kvalsvik
c4e8149717 UnitSystem string-description of a unit
Analoguous to to/from_si but for string-representation of the unit in
question.
2016-07-19 14:34:21 +02:00
Jørgen Kvalsvik
de9ecedf2d Fix warnings in COMPSEGUnits 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
3696b750cd Remove opm-common dependency
Severs the code dependency on opm-commmon. There was no actual
functional dependency here, with the exception of some enable/disable
warning headers. To properly make opm-parser a stand-alone module the
usage of these headers have been removed and the dependency on
opm-common is gone.
2016-07-08 15:53:40 +02:00
Jørgen Kvalsvik
d6940647bd UnitSystem::measure::identity
Adds the "identity" unit which is a no-op under to_si/from_si
conversion.
2016-06-28 17:15:24 +02:00
Jørgen Kvalsvik
1c7e7e08c6 Move to_si/from_si into UnitSystem
UnitSystem already offered similar functionality, but via string-map
lookup and a very clunky interface. Offer simple to/from methods as an
addition.
2016-05-23 15:11:33 +02:00
Jørgen Kvalsvik
dfb9a629e4 Support for eclipse -> SI unit conversions 2016-05-12 11:30:51 +02:00
Jørgen Kvalsvik
822ac1bcb2 SI-to-unitsystem conversion tables. 2016-05-09 15:10:23 +02:00
Liu Ming
6e542cb083 rename ParseMode as ParseContext in Units folder. 2016-03-17 08:29:32 +08:00
Jørgen Kvalsvik
f0ae5db131 opm-parser adoption of Deck automatic ownership
Since the Deck* family of classes have changed their interfaces to no
longer use shared_ptr, a lot of code broke. This patch fixes all
problems in tests, other signatures and accesses to now use the new Deck
interfaces.
2016-02-18 13:27:24 +01:00
Jørgen Kvalsvik
4b98943665 Replaces unecessary header includes with fwd decls
Every header is self-contained and includes only what it must to
function, relying on users include what they need in source files,
adopting a pay-what-you-use model (in particular for internal
dependencies).
2016-01-26 13:23:22 +01:00
Jørgen Kvalsvik
04900a4bb6 ParserKeywords.hpp -> ParserKeywordsX.hpp
To reduce compiler stress and be more explicit w.r.t. dependencies, all
files now includes only the keywords they need, instead of the
collection of all files.
2016-01-21 09:25:58 +01:00
Joakim Hove
1bde4e48ec ParserKeywords::hasDimension() check all records. 2015-11-11 10:39:11 +01:00
Kai Bao
96bf3648df Adding unit Salinity.
For the METRIC and FIELD system.
2015-04-16 16:59:59 +02:00
Atgeirr Flø Rasmussen
d33a05db70 Remove surplus const for return-by-value.
This triggers compiler warnings at high warning levels.
2015-03-06 08:52:39 +01:00
chflo
439d0ee924 OPM-157: Added enum UnitType, using this when creating an UnitSystem instance 2015-03-05 12:40:59 +01:00
Andreas Lauser
03366fe2e4 add unit for absolute (i.e., thermodynamic) temperature
This is required for keywords which do not use "every-day" temperature
values but thermodynamic ones or keywords that use "per degree"
values. Examples of such specimen are the OILCOMPR and WATDENT
keywords.
2015-03-02 19:11:18 +01:00
Andreas Lauser
0d3659f111 introduce dimension "ReservoirVolume" and rename "*Volume" to "\1SurfaceVolume"
Also, I tried to convert all keywords that use reservoir volumes and
the associated code. Although I tried my best on that front, it might
not be enough. (in any case, I consider it very unlikely that there
are any regressions caused by this.)
2015-02-13 13:41:07 +01:00
Andreas Lauser
b8a5280428 fix the unit for transmissibility when using the metric unit system
I don't know why exactly this happend, but anyway thanks to [at] bska
for catching it...
2014-12-12 12:21:38 +01:00
Andreas Lauser
764dd03153 add a "Transmissibility" unit
this is required because Eclipse is inconsistent when specifying
transmissiblities: the only difference between transmissibilities in
metric and field units is that the pressures are in bars instead of
PSI, i.e. the numerator for metric units is still given in centi-Poise
times bbl. This makes it impossible to specify the transmissibilities
in terms of their constituting bits...
2014-12-10 16:58:37 +01:00
Andreas Lauser
ea38a25af4 remove all trailing white space
this is just the result of

```
find -iname "*.[ch]pp" | xargs sed -i "s/ *$//"
find opm/parser/share/keywords -type f |  xargs sed -i "s/ *$//"
```

so if it causes conflicts with other patches, the others should get
priority. The rationale behind this patch is that some people tell
their editor to remove white space which leads to larger than
necessary patches...
2014-12-08 16:34:28 +01:00
Andreas Lauser
b1de0bf338 unit system: add temperature
this requires the possibility of specifying an offset for the SI
conversion because Eclipse in its eternal wisdom chooses to specify
temperatures using degrees Celsius and degrees Fahrenheit instead of
using Kelvin an Rankine...
2014-12-03 16:56:25 +01:00
Joakim Hove
b660cc1b6a Merge pull request #213 from atgeirr/conversion-factors
Conversion factors
2014-05-19 12:18:34 +02:00
Atgeirr Flø Rasmussen
61d1c1a2cf Make conversion factors more readable.
The using directives will put a lot into the Field and Metric
namespaces, but it should not be problematic.
2014-05-19 12:10:11 +02:00
Atgeirr Flø Rasmussen
799a52e8bc Embedded unit system from opm-core to ensure proper conversion factors. 2014-05-19 12:10:11 +02:00
Arne Morten Kvarving
3827ddca64 fixed: mark static symbols as such to quell warnings 2014-05-15 14:46:16 +02:00
Arne Morten Kvarving
670e8b692b changed: don't use parameter names that conflicts with member function names
quells warnings (with gcc 4.8)
2014-05-15 14:46:16 +02:00
Liu Ming
49376a554c Add PolymerDensity to system. 2014-03-18 08:19:15 +08:00
Liu Ming
52bd8cceb9 Add polymer density unit. 2014-03-17 09:12:14 +08:00
Andreas Lauser
849bc7df93 units: introduce a "ContextDependent" dimension
this is meant for those nasty keywords where the dimension of an entry
depends on a user-defined value of some field of a (potentially
different) keyword. One example for this are the surface rates of the
produced fluids for the .CON(INJ|PROD).* keywords which exhibit
different units depending on whether the user choses to control for
the surface gas or the liquid rate.

the approach taken in this patch is to convert all numbers to NaN if
the unit is queried in SI (via item->getSIDouble()). It might be more
desireable to throw an exception in this case, but this approach would
be more elaborate and NaNs should be quickly noticeable by the users
of this code.

I tried to adapt all implemented keywords, but it's quite likely that
I missed some...
2014-02-11 12:45:44 +01:00
Andreas Lauser
50f2288148 units: rename "m" to "Mass" 2014-02-11 12:45:44 +01:00
Andreas Lauser
690f26c223 units: rename "Rho" to "Density" 2014-02-11 12:45:43 +01:00
Andreas Lauser
ae73345763 units: rename "K" to "Permeability" 2014-02-11 12:45:43 +01:00
Andreas Lauser
ac60eed7d6 units: rename "1/Rs to "OilDissolutionFactor" and "Rs to "GasDissolutionFactor" 2014-02-11 12:45:43 +01:00
Andreas Lauser
bc4d467322 units replace: "mu" by "Viscosity" 2014-02-11 12:45:43 +01:00
Andreas Lauser
19d89d44cd units: Replace "P" by "Pressure" 2014-02-11 12:45:43 +01:00
Andreas Lauser
0129a382a8 units: Replace "L" by "Length" 2014-02-11 12:45:43 +01:00
Andreas Lauser
6a97d78cc6 units: replace "t" with "Time"
this makes things more explicit and more readable
2014-02-11 12:45:41 +01:00
Andreas Lauser
44f310bfbf units: substitute "FlowVolume" by "LiquidVolume" and "GasVolume"
because the units for them are different in the "Field" unit system.
2014-02-11 12:45:05 +01:00
Arne Morten Kvarving
4a9c18ac9f run tests through valgrind 2014-01-27 15:16:34 +01:00
Andreas Lauser
7a3755926b Units: add 'Timestep' dimension
the motivation for this is the 'TSTEP' eclipse keyword.

the reason why this dimension is not simply called 'Time' is that in
eclipse, different keywords might use different units, e.g. one
keyword could use seconds, another could use years while a third uses
days. As an added bonus, the used time units may be different for
different scales but identical in others (e.g., for one keyword times
might be specified in 'days' for the metric as well as for the
labscale, but in 'days' and 'hours' for another second keyword.)
2014-01-15 12:52:12 +01:00
Andreas Lauser
a88b47750e fix more (hopefully all) conversion factors
also, correct the dimension of the Rv item of the PVDG keyword which
is 1/Rs. Finally, the conversion factor for stock tank barrels to m^3
was off by a factor of 1000. (I suppose that liters instead of m^3
were assumed to be the SI unit in this case.)
2013-12-22 11:03:26 +01:00
Andreas Lauser
d1f224fd79 Units: fix thinko
milli means division by 1000 not multiplication...

this makes SPE1 converge nicely with opm-parser in autodiff!
2013-12-21 16:56:04 +01:00
Andreas Lauser
472b16b42a units: fix typo
Raito -> Ratio
2013-12-21 16:53:28 +01:00
Andreas Lauser
7096979a4b add a few missing dimensions
This makes getSIDouble*() work on PORO and PVTW.
2013-12-18 16:27:47 +01:00
Joakim Hove
6b29d4d0d2 Added some documentation to the ConversionFactors. 2013-12-18 12:52:29 +01:00
Joakim Hove
c1d7e87b71 Added dimension FlowVolume 2013-12-18 12:30:10 +01:00
Joakim Hove
800c4ff32e Added dimensions to TVDP* keyword family. 2013-12-15 22:38:57 +01:00