diff --git a/src/libecalc/core/models/compressor/train/base.py b/src/libecalc/core/models/compressor/train/base.py index bb816546a..f6b2b4d91 100644 --- a/src/libecalc/core/models/compressor/train/base.py +++ b/src/libecalc/core/models/compressor/train/base.py @@ -5,7 +5,6 @@ from numpy.typing import NDArray from libecalc import dto -from libecalc.common.decorators.feature_flags import Feature from libecalc.common.logger import logger from libecalc.common.units import Unit from libecalc.core.models import ( @@ -18,9 +17,6 @@ from libecalc.core.models.compressor.train.fluid import FluidStream from libecalc.core.models.compressor.utils import map_compressor_train_stage_to_domain from libecalc.core.models.results import CompressorTrainResult -from libecalc.core.models.results.compressor import ( - CompressorTrainCommonShaftFailureStatus, -) from libecalc.domain.stream_conditions import StreamConditions from libecalc.dto.models.compressor.train import CompressorTrain as CompressorTrainDTO from libecalc.dto.models.compressor.train import ( @@ -168,10 +164,6 @@ def evaluate_rate_ps_pd( compressor_charts=[stage.compressor_chart.data_transfer_object for stage in self.stages], ) - train_results = self.adjust_train_results_for_maximum_power( - train_results=train_results, power=power_mw_adjusted - ) - return CompressorTrainResult( energy_usage=list(power_mw_adjusted), energy_usage_unit=Unit.MEGA_WATT, @@ -209,18 +201,6 @@ def evaluate_streams( discharge_pressure=np.asarray([outlet_stream.pressure.value]), ) - @Feature.experimental( - feature_description="Maximum power constraint is an experimental feature where the syntax may change at any time." - ) - def adjust_train_results_for_maximum_power( - self, train_results: List[CompressorTrainResultSingleTimeStep], power: NDArray[np.float64] - ) -> List[CompressorTrainResultSingleTimeStep]: - if self.data_transfer_object.maximum_power is not None: - for power_adjusted, train_result in zip(power, train_results): - if self.data_transfer_object.maximum_power < power_adjusted and train_result.failure_status is None: - train_result.failure_status = CompressorTrainCommonShaftFailureStatus.ABOVE_MAXIMUM_POWER - return train_results - @abstractmethod def _evaluate_rate_ps_pd( self, diff --git a/src/libecalc/core/models/compressor/train/variable_speed_compressor_train_common_shaft.py b/src/libecalc/core/models/compressor/train/variable_speed_compressor_train_common_shaft.py index 48bb057b7..fbf89554d 100644 --- a/src/libecalc/core/models/compressor/train/variable_speed_compressor_train_common_shaft.py +++ b/src/libecalc/core/models/compressor/train/variable_speed_compressor_train_common_shaft.py @@ -32,7 +32,6 @@ get_single_speed_equivalent, ) from libecalc.core.models.results.compressor import ( - CompressorTrainCommonShaftFailureStatus, StageTargetPressureStatus, ) from libecalc.dto.types import FixedSpeedPressureControl @@ -674,9 +673,6 @@ def _calculate_train_result_given_rate_ps_speed_asv_rate_fraction( ) if not train_result_max_recirculation.discharge_pressure < outlet_pressure: - train_result_max_recirculation.failure_status = ( - CompressorTrainCommonShaftFailureStatus.TARGET_DISCHARGE_PRESSURE_TOO_LOW - ) msg = ( f"Compressor train with inlet pressure {inlet_pressure} and speed {speed} is not able" f"to reach the required discharge pressure {outlet_pressure} even with full recirculation. " diff --git a/src/libecalc/core/models/compressor/train/variable_speed_compressor_train_common_shaft_multiple_streams_and_pressures.py b/src/libecalc/core/models/compressor/train/variable_speed_compressor_train_common_shaft_multiple_streams_and_pressures.py index 3e6047be8..78abbb549 100644 --- a/src/libecalc/core/models/compressor/train/variable_speed_compressor_train_common_shaft_multiple_streams_and_pressures.py +++ b/src/libecalc/core/models/compressor/train/variable_speed_compressor_train_common_shaft_multiple_streams_and_pressures.py @@ -22,7 +22,6 @@ ) from libecalc.core.models.compressor.train.utils.common import ( POWER_CALCULATION_TOLERANCE, - PRESSURE_CALCULATION_TOLERANCE, RATE_CALCULATION_TOLERANCE, ) from libecalc.core.models.compressor.train.utils.numeric_methods import ( @@ -34,7 +33,6 @@ ) from libecalc.core.models.results import CompressorTrainResult from libecalc.core.models.results.compressor import ( - CompressorTrainCommonShaftFailureStatus, StageTargetPressureStatus, ) from libecalc.domain.stream_conditions import StreamConditions @@ -898,10 +896,6 @@ def evaluate_rate_ps_pint_pd( power_mw > 0, power_mw + self.data_transfer_object.energy_usage_adjustment_constant, power_mw ) - for i, train_result in enumerate(train_results): - if input_failure_status[i] is not ModelInputFailureStatus.NO_FAILURE: - train_result.failure_status = input_failure_status[i] - return CompressorTrainResult( energy_usage=list(power_mw_adjusted), energy_usage_unit=Unit.MEGA_WATT, @@ -912,7 +906,12 @@ def evaluate_rate_ps_pint_pd( compressor_charts=[stage.compressor_chart.data_transfer_object for stage in self.stages], ), rate_sm3_day=cast(list, rate.tolist()), - failure_status=[t.failure_status for t in train_results], + failure_status=[ + input_failure_status[i] + if input_failure_status[i] is not ModelInputFailureStatus.NO_FAILURE + else t.failure_status + for i, t in enumerate(train_results) + ], ) def calculate_compressor_train_given_rate_ps_speed( @@ -1108,12 +1107,7 @@ def _calculate_train_result_given_rate_ps_speed_asv_rate_fraction( inlet_pressure_bara=inlet_pressure, speed=speed, ) - if train_results.discharge_pressure * (1 + PRESSURE_CALCULATION_TOLERANCE) < outlet_pressure: - # Should probably never end up here. This is just in case we do. - train_results.failure_status = ( - CompressorTrainCommonShaftFailureStatus.TARGET_DISCHARGE_PRESSURE_TOO_HIGH - ) - elif self.pressure_control == FixedSpeedPressureControl.UPSTREAM_CHOKE: + if self.pressure_control == FixedSpeedPressureControl.UPSTREAM_CHOKE: train_results = self.calculate_compressor_train_given_rate_pd_speed( std_rates_std_m3_per_day_per_stream=std_rates_std_m3_per_day_per_stream, outlet_pressure=outlet_pressure, @@ -1145,9 +1139,6 @@ def _calculate_train_result_given_rate_ps_speed_asv_rate_fraction( asv_rate_fraction=1.0, ) if not train_result_max_recirculation.discharge_pressure < outlet_pressure: - train_result_max_recirculation.failure_status = ( - CompressorTrainCommonShaftFailureStatus.TARGET_DISCHARGE_PRESSURE_TOO_LOW - ) msg = ( f"Compressor train with inlet pressure {inlet_pressure} and speed {speed} is not able" f"to reach the required discharge pressure {outlet_pressure} even with full recirculation. "