Skip to content

Commit 57ae74a

Browse files
Merge pull request #420 from equinor/CCS-411_B
CCS-411: Replace occurrences of Pflotran with Cirrus
2 parents abc6176 + dabc55c commit 57ae74a

288 files changed

Lines changed: 95 additions & 98 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ccs-scripts
22

3-
:scroll: **ccs-scripts** gathers a collection of post-processing scripts dedicated to CCS outputs from Eclipse and Pflotran.
3+
:scroll: **ccs-scripts** gathers a collection of post-processing scripts dedicated to CCS outputs from Eclipse and Cirrus.
44

55
>Note: These scripts are beeing tested and frequently updated, new releases will be available occasionally :recycle:
66

docs/scripts/co2_plume_area.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CO2_PLUME_AREA
77
:func: get_parser
88
:prog: plume_area
99

10-
Calculates the area of the CO\ :sub:`2` plume for each formation and time step, for both SGAS and AMFG (Pflotran) / YMF2 (Eclipse).
10+
Calculates the area of the CO\ :sub:`2` plume for each formation and time step, for both SGAS and AMFG (Cirrus) / YMF2 (Eclipse).
1111

1212
Output is a table on CSV format.
1313

docs/scripts/co2_plume_extent.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CO2_PLUME_EXTENT
1010
Calculates the maximum lateral distance of the CO\ :sub:`2` plume from a given location,
1111
for instance an injection point. It is also possible to instead calculate the distance
1212
to a point or a line (north-south or east-west). The distances are calculated for each
13-
time step, for both SGAS and AMFG (Pflotran) / YMF2 (Eclipse). It is possible to
13+
time step, for both SGAS and AMFG (Cirrus) / YMF2 (Eclipse). It is possible to
1414
use an YAML-file to set up multiple calculations.
1515

1616
Output is a table on CSV format. Multiple calculations specified in the YAML-file

src/ccs_scripts/co2_containment/co2_calculation.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
DEFAULT_CO2_MOLAR_MASS = 44.0
3030
DEFAULT_WATER_MOLAR_MASS = 18.0
31-
PROPERTIES_NEEDED_PFLOTRAN = ["SGAS", "DGAS", "DWAT"]
31+
PROPERTIES_NEEDED_CIRRUS = ["SGAS", "DGAS", "DWAT"]
3232
PROPERTIES_NEEDED_ECLIPSE = ["SGAS", "BGAS", "BWAT", "XMF2", "YMF2"]
3333

3434
RELEVANT_PROPERTIES = [
@@ -747,7 +747,7 @@ def _set_calc_type_from_input_string(calc_type_input: str) -> CalculationType:
747747
return CalculationType[calc_type_input]
748748

749749

750-
def _pflotran_co2mass(
750+
def _cirrus_co2mass(
751751
source_data,
752752
scenario: Scenario,
753753
pore_volume_prop: str,
@@ -757,7 +757,7 @@ def _pflotran_co2mass(
757757
oil_molar_mass: Optional[float] = None,
758758
) -> Dict[str, List[np.ndarray]]:
759759
"""
760-
Calculates CO2 mass based on the existing properties in PFlotran
760+
Calculates CO2 mass based on the existing properties in Cirrus
761761
762762
Args:
763763
source_data (SourceData): Data with the information of the necessary properties
@@ -918,7 +918,7 @@ def _compositional_co2mass(
918918
soil = source_data.SOIL
919919
eff_vols = source_data.RPORV if pore_volume_prop == "RPORV" else source_data.PORV
920920
conv_fact = co2_molar_mass
921-
if co2_position is not None and source != "PFlotran COMP":
921+
if co2_position is not None and source != "Cirrus COMP":
922922
xmf_co2 = getattr(source_data, f"XMF{co2_position}")
923923
ymf_co2 = getattr(source_data, f"YMF{co2_position}")
924924
else:
@@ -945,7 +945,7 @@ def _compositional_co2mass(
945945
else:
946946
zmf_co2 = (
947947
getattr(source_data, f"ZMF{co2_position}")
948-
if co2_position is not None and source != "PFlotran COMP"
948+
if co2_position is not None and source != "Cirrus COMP"
949949
else source_data.ZMF2
950950
)
951951
phase_moles[date].extend([boil[date] * soil[date] * eff_vols[date]])
@@ -970,7 +970,7 @@ def _compositional_co2mass(
970970
return co2_mass
971971

972972

973-
def _pflotran_co2_molar_volume(
973+
def _cirrus_co2_molar_volume(
974974
source_data,
975975
scenario: Scenario,
976976
water_density: np.ndarray,
@@ -982,7 +982,7 @@ def _pflotran_co2_molar_volume(
982982
oil_molar_mass: Optional[float] = None,
983983
) -> Dict:
984984
"""
985-
Calculates CO2 molar volume (mol/m3) based on the existing properties in PFlotran
985+
Calculates CO2 molar volume (mol/m3) based on the existing properties in Cirrus
986986
987987
Args:
988988
source_data (SourceData): Data with the information of the necessary properties
@@ -1322,17 +1322,17 @@ def _calculate_co2_data_from_source_data(
13221322
gas_molar_mass = None
13231323
oil_molar_mass = None
13241324
comp_molar_masses = None
1325-
if source == "PFlotran COMP":
1325+
if source == "Cirrus COMP":
13261326
if cirrus_info_file is None:
1327-
error_text = "Source: PFlotran COMP"
1327+
error_text = "Source: Cirrus EOS COMP"
13281328
error_text += f"\nScenario: {scenario.name}."
13291329
error_text += (
13301330
"\nTo compute mass or actual volume in this scenario "
13311331
"path to cirrus INFO file must be provided."
13321332
)
13331333
raise ValueError(format_error(error_text))
13341334
comp_molar_masses = _extract_comp_molar_masses(cirrus_info_file)
1335-
elif source == "PFlotran":
1335+
elif source == "Cirrus":
13361336
gas_molar_mass, oil_molar_mass = _extract_molar_masses(
13371337
scenario, cirrus_info_file
13381338
)
@@ -1393,21 +1393,21 @@ def _find_pore_volume_prop(active_props: List[str]) -> str:
13931393
def _find_source_and_scenario(
13941394
residual_trapping: bool, active_props: List[str]
13951395
) -> Tuple[str, Scenario]:
1396-
props_needed_pflotran = PROPERTIES_NEEDED_PFLOTRAN.copy()
1396+
props_needed_cirrus = PROPERTIES_NEEDED_CIRRUS.copy()
13971397
props_needed_eclipse = PROPERTIES_NEEDED_ECLIPSE.copy()
13981398
if residual_trapping:
1399-
props_needed_pflotran.append("SGSTRAND")
1399+
props_needed_cirrus.append("SGSTRAND")
14001400
props_needed_eclipse.append("SGTRH")
1401-
if is_subset(props_needed_pflotran, active_props):
1402-
source = "PFlotran"
1401+
if is_subset(props_needed_cirrus, active_props):
1402+
source = "Cirrus"
14031403
if is_subset(["AMFS", "YMFO"], active_props):
14041404
scenario = Scenario.DEPLETED_OIL_GAS_FIELD
14051405
elif is_subset(["AMFS"], active_props):
14061406
scenario = Scenario.DEPLETED_GAS_FIELD
14071407
elif is_subset(["AMFG", "YMFG"], active_props):
14081408
scenario = Scenario.AQUIFER
14091409
elif is_subset(["XMF2"], active_props):
1410-
source = "PFlotran COMP"
1410+
source = "Cirrus COMP"
14111411
if _n_components(active_props) <= 3:
14121412
scenario = Scenario.AQUIFER
14131413
elif is_subset(["SOIL"], active_props):
@@ -1429,7 +1429,7 @@ def _find_source_and_scenario(
14291429
scenario = Scenario.DEPLETED_GAS_FIELD
14301430
else:
14311431
_raise_missing_props_error(
1432-
active_props, props_needed_pflotran, props_needed_eclipse
1432+
active_props, props_needed_cirrus, props_needed_eclipse
14331433
)
14341434
return source, scenario
14351435

@@ -1447,8 +1447,8 @@ def _calc_co2_amount(
14471447
oil_molar_mass: Optional[float],
14481448
comp_molar_masses: Optional[Dict[str, Tuple[int, float]]],
14491449
) -> Co2Data:
1450-
if source == "PFlotran":
1451-
co2_mass_cell = _pflotran_co2mass(
1450+
if source == "Cirrus":
1451+
co2_mass_cell = _cirrus_co2mass(
14521452
source_data,
14531453
scenario,
14541454
pore_volume_prop,
@@ -1459,7 +1459,7 @@ def _calc_co2_amount(
14591459
)
14601460
else:
14611461
co2_position = None
1462-
if source == "PFlotran COMP" and comp_molar_masses is not None:
1462+
if source == "Cirrus COMP" and comp_molar_masses is not None:
14631463
bwat, bgas, boil = _convert_phase_density_from_mass_to_mole(
14641464
source_data,
14651465
comp_molar_masses,
@@ -1576,7 +1576,7 @@ def _calculate_molar_vols_co2(
15761576
gas_molar_mass: Optional[float],
15771577
oil_molar_mass: Optional[float],
15781578
):
1579-
if source == "PFlotran":
1579+
if source == "Cirrus":
15801580
y_prop = source_data.AMFG if scenario == Scenario.AQUIFER else source_data.AMFS
15811581
y = y_prop[source_data.DATES[0]]
15821582
where_min_amf_co2 = np.where(y < THRESHOLD_DISSOLVED)[0]
@@ -1629,7 +1629,7 @@ def _calculate_molar_vols_co2(
16291629
for x in enumerate(doil)
16301630
]
16311631
)
1632-
molar_vols_co2 = _pflotran_co2_molar_volume(
1632+
molar_vols_co2 = _cirrus_co2_molar_volume(
16331633
source_data,
16341634
scenario,
16351635
water_density,
@@ -1721,13 +1721,13 @@ def _calc_co2_amount_cell_volume(
17211721

17221722
def _raise_missing_props_error(
17231723
active_props: List[str],
1724-
props_needed_pflotran: List[str],
1724+
props_needed_cirrus: List[str],
17251725
props_needed_eclipse: List[str],
17261726
):
1727-
if any(prop in props_needed_pflotran for prop in active_props):
1728-
missing_props = [x for x in props_needed_pflotran if x not in active_props]
1727+
if any(prop in props_needed_cirrus for prop in active_props):
1728+
missing_props = [x for x in props_needed_cirrus if x not in active_props]
17291729
error_text = "Lacking some required properties to compute CO2 mass/volume."
1730-
error_text += "\nAssumed source: PFlotran"
1730+
error_text += "\nAssumed source: Cirrus"
17311731
error_text += "\nMissing properties: "
17321732
error_text += ", ".join(missing_props)
17331733
raise ValueError(format_error(error_text))
@@ -1740,8 +1740,8 @@ def _raise_missing_props_error(
17401740
raise ValueError(format_error(error_text))
17411741
error_text = "Lacking all required properties to compute CO2 mass/volume."
17421742
error_text += "\nNeed either:"
1743-
error_text += f"\n PFlotran: \
1744-
{', '.join(props_needed_pflotran)}"
1743+
error_text += f"\n Cirrus: \
1744+
{', '.join(props_needed_cirrus)}"
17451745
error_text += f"\n Eclipse : \
17461746
{', '.join(props_needed_eclipse)}"
17471747
raise ValueError(format_error(error_text))

src/ccs_scripts/hook_implementations/forward_model_steps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def documentation() -> ForwardModelStepDocumentation:
376376

377377
_DESC_CO2_PLUME_AREA = """
378378
Calculates the area of the CO2 plume for each formation and time step, for both
379-
SGAS and AMFG (Pflotran) / YMF2 (Eclipse).
379+
SGAS and AMFG (Cirrus) / YMF2 (Eclipse).
380380
381381
Output is a table on CSV format.
382382
"""
@@ -386,7 +386,7 @@ def documentation() -> ForwardModelStepDocumentation:
386386
Calculates the maximum lateral distance of the CO2 plume from a given location,
387387
for instance an injection point. It is also possible to instead calculate the
388388
distance to a point or a line (north-south or east-west). The distances are
389-
calculated for each time step, for both SGAS and AMFG (Pflotran) / XMF2
389+
calculated for each time step, for both SGAS and AMFG (Cirrus) / XMF2
390390
(Eclipse).
391391
392392
Output is a table on CSV format. Multiple calculations specified in the

tests/answers/containment/plume_actual_volume_pflotran.csv renamed to tests/answers/containment/plume_actual_volume_cirrus.csv

File renamed without changes.

tests/answers/containment/plume_actual_volume_pflotran_residual_trapping.csv renamed to tests/answers/containment/plume_actual_volume_cirrus_residual_trapping.csv

File renamed without changes.

tests/answers/containment/plume_cell_volume_pflotran.csv renamed to tests/answers/containment/plume_cell_volume_cirrus.csv

File renamed without changes.
File renamed without changes.

tests/answers/containment/plume_mass_pflotran_residual_trapping.csv renamed to tests/answers/containment/plume_mass_cirrus_residual_trapping.csv

File renamed without changes.

0 commit comments

Comments
 (0)