Access Units and Factors#

Author: Zakariya Abugrin | Date: November 2023

In reservoirflow, both UNITS and FACTORS are defined as global dictionaries. The same dictionaries are used by all submodules which have unit in their arguments (e.g. grids, fluids, models). This system was inspired by Abou-Kassem et al.[1].

1import reservoirflow as rf
2
3print(rf.__version__)
0.1.0

Accessing UNITS Dictionary#

Since UNITS is a dictionary, keys represent the 3 unit categories and can be accessed as following:

1rf.UNITS.keys()
dict_keys(['field', 'metric', 'lab'])

For example, 'field' key can be used to access field units:

1rf.UNITS["field"]
{'transmissibility': 'stb/(day.psi)',
 'error': 'stb/day',
 'pressure': 'psia',
 'potential': 'psia',
 'time': 'days',
 'rate': 'stb/day',
 'length': 'ft',
 'area': 'ft^2',
 'volume': 'ft^3',
 'permeability': 'md',
 'viscosity': 'cp',
 'gas formation volume factor': 'bbl/scf',
 'liquid formation volume factor': 'bbl/stb',
 'solution gas oil ratio': 'scf/stb',
 'gravity': 'psi/ft',
 'gas flow rate': 'scf/day',
 'liquid flow rate': 'stb/day',
 'volumetric velocity': 'bbl/(day.ft^2)',
 'density': 'lbm/ft^3',
 'compressibility': 'psi^{-1}',
 'compressibility factor': 'dimensionless',
 'temperature': 'R',
 'porosity': 'fraction',
 'saturation': 'fraction',
 'relative permeability': 'fraction',
 'angle': 'rad',
 'gravitational acceleration': 'ft/(sec^2)',
 'transmissibility conversion': 'dimensionless',
 'gravity conversion': 'dimensionless',
 'volume conversion': 'dimensionless'}

Accessing FACTORS Dictionary#

Similar to above, FACTORS has also 3 keys and can be accessed as follows:

1rf.FACTORS.keys()
dict_keys(['field', 'metric', 'lab'])

FACTORS depend on the selected unit. In case of 'field':

1rf.FACTORS["field"]
{'gravitational acceleration': 32.174,
 'transmissibility conversion': 0.001127,
 'gravity conversion': 0.00021584,
 'volume conversion': 5.614583}

References ๐Ÿ“ฆ#

Comments ๐Ÿ’ฌ#

Feel free to make a comment, ask a question, or share your opinion about this specific content. Please keep in mind the Commenting Guidelines โš–.