diff --git a/src/alfasim_score/converter/alfacase/_tests/test_convert_alfacase/test_create_alfacase_with_operation.alfacase b/src/alfasim_score/converter/alfacase/_tests/test_convert_alfacase/test_create_alfacase_with_operation.alfacase index 91344d0..dd069b3 100644 --- a/src/alfasim_score/converter/alfacase/_tests/test_convert_alfacase/test_create_alfacase_with_operation.alfacase +++ b/src/alfasim_score/converter/alfacase/_tests/test_convert_alfacase/test_create_alfacase_with_operation.alfacase @@ -135,13 +135,13 @@ nodes: source_type: mass_source_type_all_volumetric_flow_rates volumetric_flow_rates_std: gas: - value: 345000.0 + value: -345000.0 unit: sm3/d oil: - value: 1500.0 + value: -1500.0 unit: sm3/d water: - value: 7500.0 + value: -7500.0 unit: sm3/d total_mass_flow_rate: value: 1.0 @@ -303,7 +303,7 @@ nodes: unit: '-' temperature: value: 60.0 - unit: psi + unit: degC source_type: mass_source_type_all_volumetric_flow_rates volumetric_flow_rates_std: gas: @@ -947,12 +947,44 @@ wells: bottom_node: WELLBORE_BOTTOM_NODE environment: thermal_model: steady_state_heat_transfer - position_input_mode: position_by_md + position_input_mode: position_by_tvd reference_y_coordinate: value: 0.0 unit: m md_properties_table: [] - tvd_properties_table: [] + tvd_properties_table: + - position: + value: 2072.0 + unit: m + temperature: + value: 4.44 + unit: degC + type: walls_and_environment_heat_transfer_coefficient + heat_transfer_coefficient: + value: 1000.0 + unit: W/m2.K + overall_heat_transfer_coefficient: + value: 0.0 + unit: W/m2.K + fluid_velocity: + value: 0.0 + unit: m/s + - position: + value: 5735.0 + unit: m + temperature: + value: 106.04 + unit: degC + type: walls_and_environment_heat_transfer_coefficient + heat_transfer_coefficient: + value: 1000.0 + unit: W/m2.K + overall_heat_transfer_coefficient: + value: 0.0 + unit: W/m2.K + fluid_velocity: + value: 0.0 + unit: m/s initial_conditions: pressures: position_input_type: length diff --git a/src/alfasim_score/converter/alfacase/base_operation.py b/src/alfasim_score/converter/alfacase/base_operation.py index dbb1d16..ab326c2 100644 --- a/src/alfasim_score/converter/alfacase/base_operation.py +++ b/src/alfasim_score/converter/alfacase/base_operation.py @@ -1,6 +1,7 @@ from typing import List import attr +from alfasim_sdk import MassInflowSplitType from alfasim_sdk import MassSourceNodePropertiesDescription from alfasim_sdk import MassSourceType from alfasim_sdk import MultiInputType @@ -29,10 +30,11 @@ def build_nodes(self) -> List[NodeDescription]: temperature_input_type=MultiInputType.Constant, source_type=MassSourceType.AllVolumetricFlowRates, volumetric_flow_rates_std={ - "gas": operation_data["gas_oil_ratio"].GetValue() + "gas": -1.0 + * operation_data["gas_oil_ratio"].GetValue() * operation_data["oil_flow_rate"], - "oil": operation_data["oil_flow_rate"], - "water": operation_data["water_flow_rate"], + "oil": -1.0 * operation_data["oil_flow_rate"], + "water": -1.0 * operation_data["water_flow_rate"], }, ), ), @@ -41,7 +43,7 @@ def build_nodes(self) -> List[NodeDescription]: pressure_properties=PressureNodePropertiesDescription( temperature=operation_data["flow_initial_temperature"], pressure=operation_data["flow_initial_pressure"], - split_type=self._get_mass_split(), + split_type=MassInflowSplitType.Pvt, ), ), ] diff --git a/src/alfasim_score/converter/alfacase/convert_alfacase.py b/src/alfasim_score/converter/alfacase/convert_alfacase.py index c294a4c..91ef4d9 100644 --- a/src/alfasim_score/converter/alfacase/convert_alfacase.py +++ b/src/alfasim_score/converter/alfacase/convert_alfacase.py @@ -75,16 +75,6 @@ def __init__(self, score_reader: ScoreInputReader): self.general_data = score_reader.read_general_data() self.well_start_position = self.general_data["water_depth"] + self.general_data["air_gap"] - def _get_mass_split(self) -> MassInflowSplitType: - """Check if the end of well trajectory is above the reservoir.""" - threshold_distance = Scalar(100.0, LENGTH_UNIT) - well_trajectory_end = self.score_input.read_general_data()["final_md"] - reservoir_position = self.score_input.read_operation_data()["perforation_base_depth"] - # TODO: check the returned massinflow splits used here.... - if reservoir_position - well_trajectory_end > threshold_distance: - return MassInflowSplitType.ConstantVolumeFraction - return MassInflowSplitType.Pvt - def _get_position_in_well(self, position: Scalar) -> Scalar: """Get the position relative to the well start position.""" return position - self.well_start_position diff --git a/src/alfasim_score/converter/alfacase/score_input_reader.py b/src/alfasim_score/converter/alfacase/score_input_reader.py index 32c1b38..91bd348 100644 --- a/src/alfasim_score/converter/alfacase/score_input_reader.py +++ b/src/alfasim_score/converter/alfacase/score_input_reader.py @@ -289,7 +289,7 @@ def read_operation_method_data(self) -> Dict[str, Any]: return { "well_head_pressure": Scalar(method_data["well_head_pressure"], PRESSURE_UNIT), "well_head_temperature": Scalar( - method_data["well_head_temperature"], PRESSURE_UNIT + method_data["well_head_temperature"], TEMPERATURE_UNIT ), "fluid": method_data["fluid_type"], "valve_depth": Scalar(method_data["valve_depth"], LENGTH_UNIT),