pyrestoolbox 3.7.6__tar.gz → 3.7.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/Cargo.lock +1 -1
  2. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/Cargo.toml +1 -1
  3. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/PKG-INFO +1 -1
  4. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/mcp/pyrestoolbox_mcp/server.py +16 -0
  5. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyproject.toml +1 -1
  6. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/pr_vphi.py +14 -12
  7. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/vphi_route.py +4 -2
  8. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/brine.rst +11 -6
  9. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/changelist.rst +8 -0
  10. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/gas/gas.py +31 -31
  11. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/oil/density.rs +4 -6
  12. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/.github/complexity-baseline.json +0 -0
  13. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/.github/scripts/check_complexity.py +0 -0
  14. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/.github/workflows/build-wheels.yml +0 -0
  15. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/.github/workflows/tests.yml +0 -0
  16. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/.gitignore +0 -0
  17. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/LICENSE +0 -0
  18. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/MANIFEST.in +0 -0
  19. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/README.rst +0 -0
  20. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/ResToolbox/privacy_policy.md +0 -0
  21. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/build_pure_python.py +0 -0
  22. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/clippy.toml +0 -0
  23. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/mcp/DEPLOYMENT.md +0 -0
  24. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/mcp/Dockerfile +0 -0
  25. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/mcp/README.md +0 -0
  26. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/mcp/pyproject.toml +0 -0
  27. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/mcp/pyrestoolbox_mcp/__init__.py +0 -0
  28. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/mcp/pyrestoolbox_mcp/serialize.py +0 -0
  29. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/mcp/tests/test_server.py +0 -0
  30. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/__init__.py +0 -0
  31. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/_accelerator.py +0 -0
  32. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/__init__.py +0 -0
  33. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/_lib_dielectric.py +0 -0
  34. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/_lib_maoduan_viscosity.py +0 -0
  35. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/_lib_pitzer_params.py +0 -0
  36. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/_lib_salting_library.py +0 -0
  37. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/_lib_vle_engine.py +0 -0
  38. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/appelo_volumes.py +0 -0
  39. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/brine.py +0 -0
  40. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/iapws_viscosity.py +0 -0
  41. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/jones_dole_viscosity.py +0 -0
  42. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/kestin_nacl_viscosity.py +0 -0
  43. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/brine/viscosity_route.py +0 -0
  44. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/classes/__init__.py +0 -0
  45. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/classes/classes.py +0 -0
  46. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/constants/__init__.py +0 -0
  47. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/constants/constants.py +0 -0
  48. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/dca/__init__.py +0 -0
  49. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/dca/dca.py +0 -0
  50. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/dca.rst +0 -0
  51. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/examples.ipynb +0 -0
  52. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/gas.rst +0 -0
  53. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/bot.png +0 -0
  54. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/bot_PVTO.png +0 -0
  55. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/bot_img.png +0 -0
  56. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/dry_gas.png +0 -0
  57. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/grid_sat_df.png +0 -0
  58. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/influence.png +0 -0
  59. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/properties_df.png +0 -0
  60. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/sgof.png +0 -0
  61. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/img/swof.png +0 -0
  62. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/index.rst +0 -0
  63. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/layer.rst +0 -0
  64. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/library.rst +0 -0
  65. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/matbal.rst +0 -0
  66. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/nodal.rst +0 -0
  67. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/nodal_examples.ipynb +0 -0
  68. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/nodal_hydrate_demo.ipynb +0 -0
  69. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/oil.rst +0 -0
  70. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/plyasunov.rst +0 -0
  71. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/recommend.rst +0 -0
  72. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/sensitivity.rst +0 -0
  73. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/docs/simtools.rst +0 -0
  74. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/gas/__init__.py +0 -0
  75. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/gas/_hydrate.py +0 -0
  76. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/layer/__init__.py +0 -0
  77. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/layer/layer.py +0 -0
  78. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/library/__init__.py +0 -0
  79. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/library/component_library.xlsx +0 -0
  80. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/library/library.py +0 -0
  81. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/matbal/__init__.py +0 -0
  82. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/matbal/matbal.py +0 -0
  83. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/nodal/__init__.py +0 -0
  84. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/nodal/nodal.py +0 -0
  85. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/__init__.py +0 -0
  86. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_compressibility.py +0 -0
  87. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_constants.py +0 -0
  88. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_correlations.py +0 -0
  89. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_density.py +0 -0
  90. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_harmonize.py +0 -0
  91. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_pvt_class.py +0 -0
  92. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_rate.py +0 -0
  93. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_separator.py +0 -0
  94. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_tables.py +0 -0
  95. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/oil/_utils.py +0 -0
  96. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/plyasunov/__init__.py +0 -0
  97. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/plyasunov/iapws_if97.py +0 -0
  98. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/plyasunov/plyasunov_model.py +0 -0
  99. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/plyasunov/water_properties.py +0 -0
  100. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/recommend/__init__.py +0 -0
  101. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/recommend/recommend.py +0 -0
  102. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/sensitivity/__init__.py +0 -0
  103. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/sensitivity/sensitivity.py +0 -0
  104. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/shared_fns/__init__.py +0 -0
  105. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/shared_fns/shared_fns.py +0 -0
  106. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/simtools/__init__.py +0 -0
  107. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/simtools/_aquifer.py +0 -0
  108. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/simtools/_decks.py +0 -0
  109. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/simtools/_pvt_tables.py +0 -0
  110. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/simtools/_relperm.py +0 -0
  111. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/simtools/_vfp.py +0 -0
  112. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/simtools/simtools.py +0 -0
  113. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/validate/__init__.py +0 -0
  114. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/pyrestoolbox/validate/validate.py +0 -0
  115. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/setup.cfg +0 -0
  116. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/setup.py +0 -0
  117. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/bessel.rs +0 -0
  118. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/critical_properties/mod.rs +0 -0
  119. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/dca/hyperbolic.rs +0 -0
  120. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/dca/mod.rs +0 -0
  121. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/dca/ransac.rs +0 -0
  122. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/gas_viscosity/mod.rs +0 -0
  123. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/gwr.rs +0 -0
  124. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/lib.rs +0 -0
  125. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/matbal/mod.rs +0 -0
  126. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/matbal/objective.rs +0 -0
  127. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/oil/mod.rs +0 -0
  128. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/pseudopressure.rs +0 -0
  129. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/spycher_pruess/mod.rs +0 -0
  130. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/spycher_pruess/solubility.rs +0 -0
  131. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/alpha.rs +0 -0
  132. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/bip.rs +0 -0
  133. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/components.rs +0 -0
  134. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/eos.rs +0 -0
  135. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/flash.rs +0 -0
  136. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/fugacity.rs +0 -0
  137. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/k_init.rs +0 -0
  138. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/mod.rs +0 -0
  139. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vle/rachford_rice.rs +0 -0
  140. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/constants.rs +0 -0
  141. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/friction.rs +0 -0
  142. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/holdup_bb.rs +0 -0
  143. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/holdup_gray.rs +0 -0
  144. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/holdup_wg.rs +0 -0
  145. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/ift.rs +0 -0
  146. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/march.rs +0 -0
  147. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/mod.rs +0 -0
  148. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/pvt_helpers.rs +0 -0
  149. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/vlp/static_column.rs +0 -0
  150. {pyrestoolbox-3.7.6 → pyrestoolbox-3.7.7}/src/zfactor/mod.rs +0 -0
@@ -152,7 +152,7 @@ dependencies = [
152
152
 
153
153
  [[package]]
154
154
  name = "pyrestoolbox-native"
155
- version = "3.7.6"
155
+ version = "3.7.7"
156
156
  dependencies = [
157
157
  "pyo3",
158
158
  "rug",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "pyrestoolbox-native"
3
- version = "3.7.6"
3
+ version = "3.7.7"
4
4
  edition = "2021"
5
5
  license = "GPL-3.0-or-later"
6
6
  description = "Rust acceleration extensions for pyResToolbox"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyrestoolbox
3
- Version: 3.7.6
3
+ Version: 3.7.7
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -46,6 +46,13 @@ mcp = FastMCP(
46
46
  "recommend_methods(...) if unsure which correlation method suits a "
47
47
  "fluid. All inputs default to oilfield units (psia, deg F, ft, mD, "
48
48
  "cP); pass metric=True for Eclipse METRIC units where supported. "
49
+ "IMPORTANT: parameter NAMES keep their oilfield spelling under "
50
+ "metric=True. `degf` then takes deg C, `p`/`pr`/`pwf` take barsa, and "
51
+ "lengths take m; the docstring unit notation `(deg F | deg C)` gives "
52
+ "the field value first and the metric value second. Passing a "
53
+ "Fahrenheit value to `degf` with metric=True converts it twice and "
54
+ "returns a wrong answer silently. Standard volumes are always at "
55
+ "60 deg F and 14.696 psia, so metric sm3 is on that basis. "
49
56
  "Full module documentation is available as docs:// resources."
50
57
  ),
51
58
  )
@@ -104,6 +111,11 @@ def describe(name: str) -> str:
104
111
 
105
112
  name is 'module.function', e.g. 'gas.gas_z' or 'dca.fit_decline'.
106
113
  Also see the docs://<module> resources for worked examples.
114
+
115
+ Units live in the docstring, not the signature, which is why annotations
116
+ are stripped below. A parameter documented `(deg F | deg C)` takes the
117
+ first under the default and the second when metric=True; the parameter
118
+ name itself never changes.
107
119
  """
108
120
  _, obj = _resolve(name)
109
121
  target = obj.__init__ if inspect.isclass(obj) else obj
@@ -128,6 +140,10 @@ def call(name: str, arguments: dict = {}) -> dict:
128
140
 
129
141
  name is 'module.function', e.g. 'gas.gas_z'. arguments is a JSON object
130
142
  of keyword arguments, e.g. {"p": 2000, "sg": 0.75, "degf": 200}.
143
+ That example is oilfield units. With {"metric": true} the same keys take
144
+ metric values, so `degf` would be deg C and `p` barsa; the names do not
145
+ change. Call describe(name) first and read its unit notation: `(deg F |
146
+ deg C)` means field first, metric second.
131
147
  Correlation methods are strings (e.g. "zmethod": "DAK"); an invalid
132
148
  method string returns an error listing the valid options. Gas and brine
133
149
  functions accept lists for pressure-like inputs; oil functions are
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "pyrestoolbox"
7
- version = "3.7.6"
7
+ version = "3.7.7"
8
8
  description = "pyResToolbox - A collection of Reservoir Engineering Utilities"
9
9
  license = {text = "GPL-3.0-or-later"}
10
10
  authors = [{name = "Mark W. Burgoyne", email = "mark.w.burgoyne@gmail.com"}]
@@ -107,12 +107,12 @@ _SW_NAME = {'NC4H10': 'nC4H10'}
107
107
  # measurements only by `fit_pr_vshift.py`. Regenerate with that script if any
108
108
  # calibration point changes; the values below are pinned in validation.py.
109
109
  VSHIFT = {
110
- 'CH4': -0.109632,
111
- 'CO2': -0.037913,
112
- 'H2S': -0.078975,
113
- 'N2': -0.176510,
114
- 'H2': -0.177625,
115
- 'C2H6': -0.073142,
110
+ 'CH4': -0.111430,
111
+ 'CO2': -0.038965,
112
+ 'H2S': -0.079740,
113
+ 'N2': -0.176768,
114
+ 'H2': -0.178503,
115
+ 'C2H6': -0.073843,
116
116
  # C3H8 added 2026-07-25. NOT fitted to a densimetric data set, because none
117
117
  # exists for propane in water. Set from the only two direct 298 K
118
118
  # determinations available, Moore (1982) 70.7 and Zhou & Battino (2001)
@@ -120,7 +120,7 @@ VSHIFT = {
120
120
  # is their mean, giving V_phi = 72.85 at 298 K. Those two disagree by 6.1%,
121
121
  # which is the honest uncertainty on this gas and is far wider than for any
122
122
  # other. It replaces a fallback that sat BELOW both of them (66.99).
123
- 'C3H8': -0.112963,
123
+ 'C3H8': -0.113326,
124
124
  # NC4H10 added 2026-07-25 from Moore (1982) Table I, 76.6 +/- 0.1 cm3/mol
125
125
  # (2 runs; his stated overall imprecision is +/-1.5). Two oddities that
126
126
  # should not be smoothed over: the shift is POSITIVE, alone among the
@@ -128,7 +128,7 @@ VSHIFT = {
128
128
  # run +18.4, +17.8, then +5.9). Adopted because it is the only direct
129
129
  # measurement of this quantity, but it is a single lab and two runs, and
130
130
  # C4 sits outside the five-gas validated scope.
131
- 'NC4H10': +0.110924,
131
+ 'NC4H10': +0.110920,
132
132
  }
133
133
 
134
134
  # Gases whose shift rests on 298 K data alone, so their temperature behaviour is
@@ -213,10 +213,12 @@ def V2_inf_raw(gas, T, P, m_nacl=0.0):
213
213
  # Switched from finite differences 2026-07-31; the difference evaluation
214
214
  # agrees to 4e-5 cm3/mol, its truncation error.
215
215
  v = v_water_liquid(T, P, m_nacl)
216
- # Pinned to the 'mc3' kij_AQ set, which is what the VSHIFT values below were
217
- # fitted against. This must not follow the library's default framework: the
218
- # shift and the kij are one calibration and cannot be mixed across sets.
219
- kij = _SW.get_kij_aq(_SW_NAME.get(gas, gas), T, m_nacl, framework='mc3')
216
+ # Pinned to the 'default' kij_AQ set (the published S&W-refresh
217
+ # recommendation), which is what the VSHIFT values below are fitted
218
+ # against since 2026-09-01. The pin stays explicit even while it matches
219
+ # the library default: the shift and the kij are one calibration and must
220
+ # not silently follow a future default move.
221
+ kij = _SW.get_kij_aq(_SW_NAME.get(gas, gas), T, m_nacl, framework='default')
220
222
  a1, b1 = _ab('H2O', T, m_nacl)
221
223
  a2, b2 = _ab(gas, T)
222
224
  a12 = np.sqrt(a1 * a2) * (1.0 - kij)
@@ -48,7 +48,9 @@ DEFAULT_ROUTE = "auto"
48
48
  # brine-density data: the seven Tiepel & Gubbins (1972) KCl dilatometry points,
49
49
  # fitted as (generated by brine_props/code/relative_salt_shift.py)
50
50
  # V_eff = V_phi(T,P) * (1 + g(m)), g(m) = -c*m/(1 + d*m)
51
- # giving -1.56% at 1 molal and -5.85% at 5 molal. Enns and O'Sullivan & Smith
51
+ # giving -1.52% at 1 molal and -5.27% at 5 molal (Tiepel's molar KCl
52
+ # concentrations converted to molality at 25 degC since 2026-09-05; the
53
+ # molar-as-molal fit gave -1.56% / -5.85%). Enns and O'Sullivan & Smith
52
54
  # agree on sign and size; the magnitude is known to about a factor of two
53
55
  # (O'Sullivan NaCl shallower, Tiepel KCl at this value).
54
56
  #
@@ -56,7 +58,7 @@ DEFAULT_ROUTE = "auto"
56
58
  # -0.03 to -0.07 cm3/mol per molal, an order of magnitude too small and linear
57
59
  # where the measurements saturate. It is therefore not used, and this term
58
60
  # carries the whole effect, so there is no double counting.
59
- SALT_C, SALT_D = 0.017009386, 0.090684173 # 8 sig digits, generated - do not retype
61
+ SALT_C, SALT_D = 0.017061208, 0.12370899 # 8 sig digits, generated - do not retype
60
62
 
61
63
 
62
64
  def salt_fraction(m_nacl: float) -> float:
@@ -709,9 +709,12 @@ exactly. The PR
709
709
  route needs one fitted number per gas against 35 coefficients per gas for the
710
710
  correlation, matches or beats it on five of six gases against the calibration
711
711
  densimetry, and reproduces an H2S temperature trend the correlation misses.
712
- The delivered shifts are CH4 -0.109632, CO2 -0.037913, H2S -0.078975,
713
- N2 -0.176510, H2 -0.177625, C2H6 -0.073142, C3H8 -0.112963 and
714
- nC4H10 +0.110924.
712
+ The delivered shifts are CH4 -0.111430, CO2 -0.038965, H2S -0.079740,
713
+ N2 -0.176768, H2 -0.178503, C2H6 -0.073843, C3H8 -0.113326 and
714
+ nC4H10 +0.110920. They are fitted against the ``'default'`` kij_AQ set and the
715
+ route pins that framework internally (refitted in 3.7.7; the values before it
716
+ went with the ``'mc3'`` set the route pinned until then). A shift and the kij
717
+ set it was fitted against are one calibration, so the two are never mixed.
715
718
 
716
719
  Three ceilings should not be conflated: the arithmetic stops at 623.15 K, the
717
720
  volume shift stops being fitted at 473.15 K, and **accuracy is claimed only to
@@ -723,9 +726,11 @@ the equation of state unaided.
723
726
  **Salinity shift on V_phi** (new in 3.7.3; relative form from 3.7.4). A
724
727
  gas-generic dimensionless fraction is applied,
725
728
  ``V_eff = V_phi(T,P) * (1 + g(m))`` with
726
- ``g(m) = -1.7009 m/(1 + 0.090684 m)`` percent, giving -1.56% at 1 mol/kg and
727
- -5.85% at 5 mol/kg (for CO2, -0.5 to -2.7 cm3/mol over the working range). It
728
- is fixed entirely from Tiepel and Gubbins (1972) KCl dilatometry with no
729
+ ``g(m) = -1.7061 m/(1 + 0.12371 m)`` percent, giving -1.52% at 1 mol/kg and
730
+ -5.27% at 5 mol/kg (for CO2, -0.5 to -2.4 cm3/mol over the working range). It
731
+ is fixed entirely from Tiepel and Gubbins (1972) KCl dilatometry, their molar
732
+ concentrations converted to molality at 25 degC (from 3.7.7; the 3.7.4 fit
733
+ treated them as molal: -1.56% / -5.85%), with no
729
734
  parameter fitted to any brine-density data; the magnitude is known to about a
730
735
  factor of two. Freshwater results are unchanged exactly; gas-saturated brine
731
736
  densities move by up to a few hundredths of a percent. Pass
@@ -1,3 +1,11 @@
1
+ Changelist in 3.7.7:
2
+
3
+ - **BRINE DENSITY: the dissolved-gas volume shifts refitted under the published ``'default'`` framework** (``brine.pr_vphi.VSHIFT``). A volume shift and the S&W kij_AQ set it was fitted against are one calibration and cannot be mixed, so the module pinned ``framework='mc3'``. The reference calibration has moved to the published recommendation, the ``'default'`` embedded delta-kij framework, and the shifts move with it: CH4 -0.111430 (was -0.109632), CO2 -0.038965 (-0.037913), H2S -0.079740 (-0.078975), N2 -0.176768 (-0.176510), H2 -0.178503 (-0.177625) and C2H6 -0.073843 (-0.073142), with the two literature-anchored gases re-derived on the same basis at C3H8 -0.113326 and nC4H10 +0.110920. The pin stays explicit at ``'default'`` so that a later move of the library default cannot silently cross the shifts with a kij set they were not fitted against. V_phi moves by up to 0.14% (CH4 at 350 K and 20 MPa, 39.4072 to 39.4624 cm3/mol), gas-saturated brine density by under 0.002%, and Cf_sat, being a difference of two densities, by 0.025%.
4
+
5
+ - **BRINE DENSITY: the V_phi salinity fraction refitted on molality** (``brine.vphi_route.salt_fraction``). Tiepel and Gubbins' KCl concentrations are molar; the 3.7.4 fit treated them as molal. Converted with the KCl solution density at 25 degC (1, 2, 4 mol/L = 1.033, 2.133, 4.587 mol/kg) and refitted, ``g(m) = -1.7061 m/(1 + 0.12371 m)`` percent replaces ``-1.7009 m/(1 + 0.090684 m)``: -1.52% at 1 mol/kg (was -1.56%) and -5.27% at 5 (was -5.85%). Gas-saturated brine density moves by under 0.03% at 5 mol/kg; freshwater results are unchanged exactly.
6
+
7
+ - **GAS docstrings carry both unit systems, and the MCP server states the convention.** Every ``gas`` parameter that the code converts under ``metric=True`` now shows both halves on its own parameter line in the ``(field | metric)`` form, 31 lines across nine functions. Parameter *names* never change, so ``degf`` takes deg C under ``metric=True`` and a reader who stops at the name converts twice and is silently wrong. ``pyrestoolbox-mcp``'s instructions, ``call`` and ``describe`` now say so, and also that standard volumes stay on the 60 degF, 14.696 psia basis in both unit systems. Documentation only, no numerical change.
8
+
1
9
  Changelist in 3.7.6:
2
10
 
3
11
  - **OIL Rs: the Velarde, Blasingame & McCain correlation now refuses fluids it cannot represent, instead of returning negative Rs.** For rich separator gas with a light oil at a high bubble point, the correlation's leading coefficient a0 exceeds 1 and the published form ``rsr = a0*pr^a1 + (1-a0)*pr^a2`` turns negative over most of the pressure range: at 45 API, 200 degF, sg_sp 1.0 and pb 6000 psia it returned -421 scf/stb at 1000 psia, recovering only near Pb where the form is pinned to rsb by construction, and downstream ``oil_viso`` failed on a complex intermediate. The coefficients match the 1997 paper, so this is a range limit rather than a transcription error; a 72,900-case sweep found ``a0 > 1`` an exact test, with every such case non-physical and no ``a0 <= 1`` case affected. The boundary at 200 degF sits near Pb 5000 psia at sg_sp 1.0 with 45 API, or 8100 psia at sg_sp 0.85 with 35 API, falling roughly 10% per 100 degF of heating. ``oil_rs(rsmethod='VELAR')`` now raises ``ValueError`` naming the inputs, the offending coefficient and ``rsmethod='STAN'`` as the working alternative (Valko-McCain is not offered because its own Pb ceiling refuses most of the same corner). The same fluids are refused once at the nodal VLP entry points, where the segment march carries its own copy of the formula and the Rust path would otherwise return NaN silently.
@@ -347,12 +347,12 @@ def gas_rate_radial(
347
347
  ) -> np.ndarray:
348
348
  """ Returns gas rate for radial flow (mscf/day) using Darcy pseudo steady state equation & gas pseudopressure
349
349
  k: Permeability (mD)
350
- h: Net flow height (ft)
351
- pr: Reservoir pressure (psia)
352
- pwf: BHFP (psia)
353
- r_w: Wellbore Radius (ft)
354
- r_ext: External Reservoir Radius (ft)
355
- degf: Reservoir Temperature (deg F)
350
+ h: Net flow height (ft | m)
351
+ pr: Reservoir pressure (psia | barsa)
352
+ pwf: BHFP (psia | barsa)
353
+ r_w: Wellbore Radius (ft | m)
354
+ r_ext: External Reservoir Radius (ft | m)
355
+ degf: Reservoir Temperature (deg F | deg C)
356
356
  zmethod: Method for calculating Z-Factor
357
357
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
358
358
  'HY' Hall & Yarborough (1973)
@@ -433,10 +433,10 @@ def gas_rate_linear(
433
433
  ) -> np.ndarray:
434
434
  """ Returns gas rate for linear flow (mscf/day) using Darcy steady state equation & gas pseudopressure
435
435
  k: Permeability (mD)
436
- pr: Reservoir pressure (psia)
437
- pwf: BHFP (psia)
438
- area: Net cross sectional area perpendicular to direction of flow (ft2).
439
- length: Length over which flow takes place (ft)
436
+ pr: Reservoir pressure (psia | barsa)
437
+ pwf: BHFP (psia | barsa)
438
+ area: Net cross sectional area perpendicular to direction of flow (ft2 | m2).
439
+ length: Length over which flow takes place (ft | m)
440
440
  zmethod: Method for calculating Z-Factor
441
441
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
442
442
  'HY' Hall & Yarborough (1973)
@@ -448,7 +448,7 @@ def gas_rate_linear(
448
448
  'BNS' for Burgoyne, Nielsen and Stanko method (2025). If h2 > 0, then 'BNS' will be used
449
449
  Defaults to 'PMC' if not specified
450
450
  sg: Gas SG relative to air, Defaults to 0.75 if not specified
451
- degf: Reservoir Temperature (deg F).
451
+ degf: Reservoir Temperature (deg F | deg C).
452
452
  co2: Molar fraction of CO2. Defaults to zero if not specified
453
453
  h2s: Molar fraction of H2S. Defaults to zero if not specified
454
454
  n2: Molar fraction of Nitrogen. Defaults to zero if not specified
@@ -1111,9 +1111,9 @@ def gas_ug(
1111
1111
  Uses Lee, Gonzalez & Eakin (1966) Correlation using equations 2.14-2.17 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
1112
1112
  Except if 'BNS' Z-Factor method chosen, in which case tuned LBC viscosity model will be used instead
1113
1113
 
1114
- p: Gas pressure (psia)
1114
+ p: Gas pressure (psia | barsa)
1115
1115
  sg: Gas SG relative to air
1116
- degf: Reservoir Temperature (deg F).
1116
+ degf: Reservoir Temperature (deg F | deg C).
1117
1117
  zmethod: Method for calculating Z-Factor
1118
1118
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
1119
1119
  'HY' Hall & Yarborough (1973)
@@ -1129,7 +1129,7 @@ def gas_ug(
1129
1129
  n2: Molar fraction of Nitrogen. Defaults to zero if undefined
1130
1130
  h2: Molar fraction of Hydrogen. Defaults to zero if undefined
1131
1131
  tc: Critical gas temperature (deg R). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Tc (inert Tc stay at BNS internal constants)
1132
- pc: Critical gas pressure (psia). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Pc (inert Pc stay at BNS internal constants)
1132
+ pc: Critical gas pressure (psia | barsa). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Pc (inert Pc stay at BNS internal constants)
1133
1133
  zee: Gas Z-Factor. If undefined, will trigger Z-Factor calculation.
1134
1134
  ugz: Boolean flag that if True returns ugZ instead of ug
1135
1135
  metric: If True, input/output in Eclipse METRIC units (barsa, degC). Defaults to False (FIELD)
@@ -1430,15 +1430,15 @@ def gas_cg(
1430
1430
  """ Returns gas compressibility (1/psi) using the 'DAK' Dranchuk & Abou-Kassem (1975) Z-Factor &
1431
1431
  Critical property correlation values if not explicitly specified
1432
1432
  If h2 > 0, will use the 'BNS' Z-Factor method
1433
- p: Gas pressure (psia)
1433
+ p: Gas pressure (psia | barsa)
1434
1434
  sg: Gas SG relative to air
1435
- degf: Gas Temperature (deg F)
1435
+ degf: Gas Temperature (deg F | deg C)
1436
1436
  co2: Molar fraction of CO2. Defaults to zero if undefined
1437
1437
  h2s: Molar fraction of H2S. Defaults to zero if undefined
1438
1438
  n2: Molar fraction of Nitrogen. Defaults to zero if undefined
1439
1439
  h2: Molar fraction of Hydrogen. Defaults to zero if undefined
1440
1440
  tc: Critical gas temperature (deg R). Uses cmethod correlation if not specified. For BNS, overrides only the hydrocarbon pseudo-component Tc (inert Tc stay at BNS internal constants)
1441
- pc: Critical gas pressure (psia). Uses cmethod correlation if not specified. For BNS, overrides only the hydrocarbon pseudo-component Pc (inert Pc stay at BNS internal constants)
1441
+ pc: Critical gas pressure (psia | barsa). Uses cmethod correlation if not specified. For BNS, overrides only the hydrocarbon pseudo-component Pc (inert Pc stay at BNS internal constants)
1442
1442
  zmethod: Method for calculating Z-Factor
1443
1443
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
1444
1444
  'HY' Hall & Yarborough (1973)
@@ -1488,9 +1488,9 @@ def gas_bg(
1488
1488
  metric: bool = False,
1489
1489
  ) -> np.ndarray:
1490
1490
  """ Returns Bg (gas formation volume factor) for natural gas (rcf/scf)
1491
- p: Gas pressure (psia)
1491
+ p: Gas pressure (psia | barsa)
1492
1492
  sg: Gas SG relative to air
1493
- degf: Reservoir Temperature (deg F)
1493
+ degf: Reservoir Temperature (deg F | deg C)
1494
1494
  zmethod: Method for calculating Z-Factor
1495
1495
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
1496
1496
  'HY' Hall & Yarborough (1973)
@@ -1536,9 +1536,9 @@ def gas_den(
1536
1536
  metric: bool = False,
1537
1537
  ) -> np.ndarray:
1538
1538
  """ Returns gas density for natural gas (lb/cuft)
1539
- p: Gas pressure (psia)
1539
+ p: Gas pressure (psia | barsa)
1540
1540
  sg: Gas SG relative to air
1541
- degf: Reservoir Temperature (deg F)
1541
+ degf: Reservoir Temperature (deg F | deg C)
1542
1542
  zmethod: Method for calculating Z-Factor
1543
1543
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
1544
1544
  'HY' Hall & Yarborough (1973)
@@ -1598,9 +1598,9 @@ def gas_ponz2p(
1598
1598
  ) -> np.ndarray:
1599
1599
  """ Returns pressure corresponding to a P/Z value for natural gas (psia)
1600
1600
  Calculated through iterative solution method
1601
- poverz: Gas pressure / Z-Factor (psia)
1601
+ poverz: Gas pressure / Z-Factor (psia | barsa)
1602
1602
  sg: Gas SG relative to air
1603
- degf: Reservoir Temperature (deg F).
1603
+ degf: Reservoir Temperature (deg F | deg C).
1604
1604
  zmethod: Method for calculating Z-Factor
1605
1605
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
1606
1606
  'HY' Hall & Yarborough (1973)
@@ -1616,7 +1616,7 @@ def gas_ponz2p(
1616
1616
  n2: Molar fraction of Nitrogen. Defaults to zero if undefined
1617
1617
  h2: Molar fraction of Hydrogen. Defaults to zero if undefined
1618
1618
  tc: Critical gas temperature (deg R). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Tc (inert Tc stay at BNS internal constants)
1619
- pc: Critical gas pressure (psia). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Pc (inert Pc stay at BNS internal constants)
1619
+ pc: Critical gas pressure (psia | barsa). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Pc (inert Pc stay at BNS internal constants)
1620
1620
  rtol: Relative solution tolerance. Will iterate until abs[(p - poverz * Z)/p] < rtol
1621
1621
  metric: If True, input/output in Eclipse METRIC units (barsa, degC). Defaults to False (FIELD)
1622
1622
  """
@@ -1703,9 +1703,9 @@ def gas_grad2sg(
1703
1703
  Calculated through iterative solution method. Bisection bounds span pure H2 (SG ~0.070) to 3.0 to
1704
1704
  accommodate H2-blend and CO2-rich compositions; results outside this range will fail.
1705
1705
 
1706
- grad: Observed gas gradient (psi/ft)
1707
- p: Pressure at observation (psia)
1708
- degf: Reservoir Temperature (deg F). Defaults to False if undefined
1706
+ grad: Observed gas gradient (psi/ft | bar/m)
1707
+ p: Pressure at observation (psia | barsa)
1708
+ degf: Reservoir Temperature (deg F | deg C). Defaults to False if undefined
1709
1709
  zmethod: Method for calculating Z-Factor
1710
1710
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
1711
1711
  'HY' Hall & Yarborough (1973)
@@ -1721,7 +1721,7 @@ def gas_grad2sg(
1721
1721
  n2: Molar fraction of Nitrogen. Defaults to zero if undefined
1722
1722
  h2: Molar fraction of Hydrogen. Defaults to zero if undefined
1723
1723
  tc: Critical gas temperature (deg R). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Tc (inert Tc stay at BNS internal constants)
1724
- pc: Critical gas pressure (psia). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Pc (inert Pc stay at BNS internal constants)
1724
+ pc: Critical gas pressure (psia | barsa). Calculates using cmethod if not specified. For BNS, overrides only the hydrocarbon pseudo-component Pc (inert Pc stay at BNS internal constants)
1725
1725
  rtol: Relative solution tolerance. Will iterate until abs[(grad - calculation)/grad] < rtol
1726
1726
  metric: If True, input/output in Eclipse METRIC units (bar/m, barsa, degC). Defaults to False (FIELD)
1727
1727
  """
@@ -1770,9 +1770,9 @@ def gas_dmp(
1770
1770
  ) -> float:
1771
1771
  """ Numerical integration of real-gas pseudopressure between two pressures
1772
1772
  Returns integral over range between p1 to p2 (psi**2/cP)
1773
- p1: Starting (lower) pressure (psia)
1774
- p2: Ending (upper) pressure (psia)
1775
- degf: Gas Temperature (deg F)
1773
+ p1: Starting (lower) pressure (psia | barsa)
1774
+ p2: Ending (upper) pressure (psia | barsa)
1775
+ degf: Gas Temperature (deg F | deg C)
1776
1776
  sg: Specific gravity of gas (relative to air)
1777
1777
  zmethod: Method for calculating Z-Factor
1778
1778
  'DAK' Dranchuk & Abou-Kassem (1975) using from Equations 2.7-2.8 from 'Petroleum Reservoir Fluid Property Correlations' by W. McCain et al.
@@ -28,9 +28,7 @@ pub fn deno_below_pb(
28
28
  sg_o: f64,
29
29
  api: f64,
30
30
  ) -> f64 {
31
- let rho_po: f64;
32
-
33
- if sg_sp > 0.0 {
31
+ let rho_po: f64 = if sg_sp > 0.0 {
34
32
  // Iterative path (Eq 3.18b-3.18c)
35
33
  let a: [f64; 6] = [-49.8930, 85.0149, -3.70373, 0.0479818, 2.98914, -0.0356888];
36
34
  let mut rho_est = (52.8 - 0.01 * rs).max(20.0);
@@ -49,13 +47,13 @@ pub fn deno_below_pb(
49
47
  }
50
48
  rho_est = new_rho;
51
49
  }
52
- rho_po = new_rho;
50
+ new_rho
53
51
  } else {
54
52
  // Non-iterative fallback using sg_g (Eq 3.17e)
55
53
  let rhoa = 38.52 * 10.0_f64.powf(-0.00326 * api)
56
54
  + (94.75 - 33.93 * api.log10()) * sg_g.log10();
57
- rho_po = (rs * sg_g + 4600.0 * sg_o) / (73.71 + rs * sg_g / rhoa);
58
- }
55
+ (rs * sg_g + 4600.0 * sg_o) / (73.71 + rs * sg_g / rhoa)
56
+ };
59
57
 
60
58
  // Pressure correction (Eq 3.19d)
61
59
  let p_k = p / 1000.0;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes