diff --git a/src/alfasim_score/converter/alfacase/_tests/test_convert_casing/test_convert_casing_list.yml b/src/alfasim_score/converter/alfacase/_tests/test_convert_casing/test_convert_casing_list.yml index 3f1648f..485e92a 100644 --- a/src/alfasim_score/converter/alfacase/_tests/test_convert_casing/test_convert_casing_list.yml +++ b/src/alfasim_score/converter/alfacase/_tests/test_convert_casing/test_convert_casing_list.yml @@ -16,7 +16,7 @@ inner_roughness: 0.05 material: X-80 material_above_filler: fluid_default - name: SURFACE_CASING_2 + name: SURFACE_CASING_1 outer_diameter: 18.0 settings_depth: 3490.0 top_of_filler: 2072.0 @@ -27,7 +27,7 @@ inner_roughness: 0.05 material: N-80 material_above_filler: fluid_default - name: PRODUCTION_CASING_3 + name: PRODUCTION_CASING_1 outer_diameter: 11.875 settings_depth: 3072.0 top_of_filler: 4905.0 @@ -38,7 +38,7 @@ inner_roughness: 0.05 material: C-110 HC material_above_filler: fluid_default - name: PRODUCTION_CASING_4 + name: PRODUCTION_CASING_2 outer_diameter: 10.75 settings_depth: 5441.0 top_of_filler: 4905.0 @@ -49,7 +49,7 @@ inner_roughness: 0.05 material: SDSS/125KSI material_above_filler: fluid_default - name: PRODUCTION_CASING_5 + name: PRODUCTION_CASING_3 outer_diameter: 10.75 settings_depth: 5607.0 top_of_filler: 4905.0 diff --git a/src/alfasim_score/converter/alfacase/convert_alfacase.py b/src/alfasim_score/converter/alfacase/convert_alfacase.py index f48af47..9a33f9e 100644 --- a/src/alfasim_score/converter/alfacase/convert_alfacase.py +++ b/src/alfasim_score/converter/alfacase/convert_alfacase.py @@ -83,9 +83,8 @@ def _convert_formation(self) -> AnnulusDescription: def _convert_casing_list(self) -> List[CasingSectionDescription]: """Create the description for the casings.""" casing_sections = [] - i = 1 for data in self.score_input.read_casings(): - for section in data["sections"]: + for i, section in enumerate(data["sections"], 1): casing_sections.append( CasingSectionDescription( name=f"{data['function'].value}_{data['type'].value}_{i}", diff --git a/src/alfasim_score/converter/alfacase/score_input_reader.py b/src/alfasim_score/converter/alfacase/score_input_reader.py index 138fb38..b455ad1 100644 --- a/src/alfasim_score/converter/alfacase/score_input_reader.py +++ b/src/alfasim_score/converter/alfacase/score_input_reader.py @@ -159,7 +159,7 @@ def read_packer_fluid(self) -> List[Dict[str, Union[Scalar, str]]]: def read_casings(self) -> List[Dict[str, Any]]: """Read the data for the casing from SCORE input file""" casing_data = [] - for item in self.input_content["operation"]["thermal_simulation"]["well_strings"]: + for item in self.input_content["well_strings"]: if item["interval"] != WellItemFunction.OPEN.value: casing_data.append( { @@ -190,7 +190,7 @@ def read_casings(self) -> List[Dict[str, Any]]: ) return casing_data - def read_tubing(self) -> List[Dict[str, Union[Scalar, str]]]: + def read_tubing(self) -> List[Dict[str, Any]]: """Read the data for the tubing from SCORE input file""" tubing_data = [] for section in self.input_content["operation"]["tubing_string"]["string_sections"]: @@ -223,13 +223,13 @@ def read_packers(self) -> List[Dict[str, Union[Scalar, str]]]: def read_open_hole(self) -> List[Dict[str, Scalar]]: """Read the data for the open hole from SCORE input file""" - casing_data = [] - for section in self.input_content["operation"]["thermal_simulation"]["well_strings"]: + open_hole_data = [] + for section in self.input_content["well_strings"]: if section["interval"] == WellItemFunction.OPEN.value: - casing_data.append( + open_hole_data.append( { "final_md": Scalar(section["final_md"], LENGTH_UNIT, "length"), "hole_diameter": Scalar(section["hole_size"], DIAMETER_UNIT, "diameter"), } ) - return casing_data + return open_hole_data