Skip to content

Commit

Permalink
Fix the missing ensity product for API;
Browse files Browse the repository at this point in the history
PWPA-1989
  • Loading branch information
Gabriel Antão committed Jul 10, 2024
1 parent 08240e8 commit 57670ec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/alfasim_score/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from enum import Enum

from alfasim_score.constants import AIR_DENSITY_STANDARD
from alfasim_score.constants import WATER_DENSITY_STANDARD
from alfasim_score.units import DENSITY_UNIT
from alfasim_score.units import FRACTION_UNIT
from alfasim_score.units import LENGTH_UNIT
Expand Down Expand Up @@ -77,7 +78,8 @@ def convert_quota_to_tvd(quota: Scalar, air_gap: Scalar) -> Scalar:

def convert_api_gravity_to_oil_density(api_gravity: Scalar) -> Scalar:
"""Calculate the oil standard condition density based on API density."""
return Scalar(141.5 / (api_gravity.GetValue(FRACTION_UNIT) + 131.5), DENSITY_UNIT)
specific_gravity = 141.5 / (api_gravity.GetValue(FRACTION_UNIT) + 131.5)
return WATER_DENSITY_STANDARD * specific_gravity


def convert_gas_gravity_to_gas_density(gas_gravity: Scalar) -> Scalar:
Expand Down
7 changes: 5 additions & 2 deletions src/alfasim_score/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from alfasim_score.units import DENSITY_UNIT
from alfasim_score.units import FRACTION_UNIT
from alfasim_score.units import HEAT_TRANSFER_COEFFICIENT_UNIT
from alfasim_score.units import LENGTH_UNIT
from alfasim_score.units import MASS_FLOW_RATE_UNIT
from alfasim_score.units import ROUGHNESS_UNIT
from alfasim_score.units import STD_VOLUMETRIC_FLOW_RATE_UNIT
Expand All @@ -14,11 +16,11 @@
CEMENT_NAME = "cement"

ROCK_DEFAULT_ROUGHNESS = Scalar(0.1, ROUGHNESS_UNIT)
ROCK_DEFAULT_HEAT_TRANSFER_COEFFICIENT = Scalar(1000.0, "W/m2.K")
ROCK_DEFAULT_HEAT_TRANSFER_COEFFICIENT = Scalar(1000.0, HEAT_TRANSFER_COEFFICIENT_UNIT)
CASING_DEFAULT_ROUGHNESS = Scalar(0.05, ROUGHNESS_UNIT)
TUBING_DEFAULT_ROUGHNESS = Scalar(0.05, ROUGHNESS_UNIT)

REFERENCE_VERTICAL_COORDINATE = Scalar(0.0, "m", "length")
REFERENCE_VERTICAL_COORDINATE = Scalar(0.0, LENGTH_UNIT, "length")

# This default fluid name for packer and fluid above filler
FLUID_DEFAULT_NAME = "fluid_default"
Expand All @@ -30,6 +32,7 @@
NULL_MASS_FLOW_RATE = Scalar(0.0, MASS_FLOW_RATE_UNIT)

AIR_DENSITY_STANDARD = Scalar(1.225, DENSITY_UNIT)
WATER_DENSITY_STANDARD = Scalar(999.016, DENSITY_UNIT)

# default values used in the context of black-oil models
H2S_MOLAR_FRACTION_DEFAULT = Scalar(0.0, FRACTION_UNIT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pvt_models:
correlations:
DFLT_BLACK_OIL_27.40_230.00_1.17:
oil_density_std:
value: 0.8904971680302076
value: 889.6209188168658
unit: kg/m3
gas_density_std:
value: 1.43325
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pvt_models:
correlations:
DFLT_BLACK_OIL_27.40_230.00_1.17:
oil_density_std:
value: 0.8904971680302076
value: 889.6209188168658
unit: kg/m3
gas_density_std:
value: 1.43325
Expand Down
1 change: 1 addition & 0 deletions src/alfasim_score/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
PRESSURE_UNIT = "psi"
TEMPERATURE_UNIT = "degC"
GAS_OIL_RATIO_UNIT = "sm3/sm3"
HEAT_TRANSFER_COEFFICIENT_UNIT = "W/m2.K"

0 comments on commit 57670ec

Please sign in to comment.