@@ -141,8 +141,8 @@ def evaluate(
141141 self ,
142142 inlet_stream_stage : FluidStream ,
143143 speed : float ,
144- additional_rates_to_splitter : list [float ] | None = None ,
145- additional_streams_to_mixer : list [FluidStream ] | None = None ,
144+ rates_out_of_splitter : list [float ] | None = None ,
145+ streams_in_to_mixer : list [FluidStream ] | None = None ,
146146 asv_rate_fraction : float | None = 0.0 ,
147147 asv_additional_mass_rate : float | None = 0.0 ,
148148 ) -> CompressorTrainStageResultSingleTimeStep :
@@ -153,8 +153,8 @@ def evaluate(
153153 inlet_stream_stage (FluidStream): The conditions of the inlet fluid stream. If there are several inlet streams,
154154 the first one is the stage inlet stream, the others enter the stage at the Mixer.
155155 speed (float): The speed of the shaft driving the compressor
156- additional_rates_to_splitter (list[float] | None, optional): Additional rates to the Splitter if defined.
157- additional_streams_to_mixer (list[FluidStream] | None, optional): Additional streams to the Mixer if defined.
156+ rates_out_of_splitter (list[float] | None, optional): Additional rates to the Splitter if defined.
157+ streams_in_to_mixer (list[FluidStream] | None, optional): Additional streams to the Mixer if defined.
158158 asv_rate_fraction (float | None, optional): Fraction of the available capacity of the compressor to fill
159159 using some kind of pressure control (on the interval [0,1]). Defaults to 0.0.
160160 asv_additional_mass_rate (float | None, optional): Additional recirculated mass rate due to
@@ -165,22 +165,20 @@ def evaluate(
165165 """
166166 # First the stream passes through the Splitter (if defined)
167167 if self .splitter is not None :
168- if additional_rates_to_splitter is None :
169- raise IllegalStateException ("additional_rates_to_splitter cannot be None when a splitter is defined" )
168+ self .splitter .rates_out_of_splitter = rates_out_of_splitter
170169 inlet_stream_after_splitter = self .split (
171170 inlet_stream_stage = inlet_stream_stage ,
172- additional_rates_to_splitter = additional_rates_to_splitter ,
173171 )
174172 else :
175173 inlet_stream_after_splitter = inlet_stream_stage
176174
177175 # Then the stream passes through the Mixer (if defined)
178176 if self .mixer is not None :
179- if additional_streams_to_mixer is None :
180- raise IllegalStateException ("additional_streams_to_mixer cannot be None when a mixer is defined" )
177+ if streams_in_to_mixer is None :
178+ raise IllegalStateException ("streams_in_to_mixer cannot be None when a mixer is defined" )
181179 inlet_stream_after_mixer = self .mix (
182180 inlet_stream_stage = inlet_stream_after_splitter ,
183- additional_streams_to_mixer = additional_streams_to_mixer ,
181+ streams_in_to_mixer = streams_in_to_mixer ,
184182 )
185183 else :
186184 inlet_stream_after_mixer = inlet_stream_after_splitter
@@ -257,38 +255,26 @@ def evaluate(
257255 def split (
258256 self ,
259257 inlet_stream_stage : FluidStream ,
260- additional_rates_to_splitter : list [float ],
261258 ) -> FluidStream :
262259 """Split the inlet stream into many streams. One stream goes to the compressor stage. The other(s) are taken out.
263260 In the future, the additional streams could be used for other purposes, but today they are just dropped completely.
264261
265262 Args:
266263 inlet_stream_stage (FluidStream): The inlet stream for the stage.
267- additional_rates_to_splitter (list[float]): Additional rates to split from the inlet stream.
268264
269265 Returns:
270266 FluidStream: The stream going to the compressor stage.
271267 """
272268 assert self .splitter is not None
273- assert additional_rates_to_splitter is not None
274- if self .splitter .number_of_outputs != len (additional_rates_to_splitter ) + 1 :
275- raise IllegalStateException (
276- f"Number of additional rates to Splitter ({ len (additional_rates_to_splitter )} ) "
277- f"does not match number of Splitter outputs ({ self .splitter .number_of_outputs } )."
278- )
279- all_rates_to_splitter = additional_rates_to_splitter + [
280- inlet_stream_stage .standard_rate - sum (additional_rates_to_splitter )
281- ]
282269 split_streams = self .splitter .split_stream (
283270 stream = inlet_stream_stage ,
284- split_fractions = all_rates_to_splitter ,
285271 )
286272 return split_streams [- 1 ] # The last stream goes to the compressor stage
287273
288274 def mix (
289275 self ,
290276 inlet_stream_stage : FluidStream ,
291- additional_streams_to_mixer : list [FluidStream ],
277+ streams_in_to_mixer : list [FluidStream ],
292278 prefer_first_stream : bool = True ,
293279 ) -> FluidStream :
294280 """Mix the inlet stream with additional streams.
@@ -300,22 +286,22 @@ def mix(
300286
301287 Args:
302288 inlet_stream_stage (FluidStream): The inlet stream for the stage.
303- additional_streams_to_mixer (list[FluidStream]): Additional streams to mix with the inlet stream.
289+ streams_in_to_mixer (list[FluidStream]): Additional streams to mix with the inlet stream.
304290 prefer_first_stream (bool): Whether to prefer the properties of the first stream when mixing streams
305291 with zero mass flow. Defaults to True. (Which fluid to recirculate)
306292
307293 Returns:
308294 FluidStream: The mixed stream.
309295 """
310296 assert self .mixer is not None
311- assert additional_streams_to_mixer is not None
312- if self .mixer .number_of_inputs != len (additional_streams_to_mixer ) + 1 :
297+ assert streams_in_to_mixer is not None
298+ if self .mixer .number_of_inputs != len (streams_in_to_mixer ) + 1 :
313299 raise IllegalStateException (
314- f"Number of additional rates to Splitter ({ len (additional_streams_to_mixer )} ) "
300+ f"Number of additional rates to Splitter ({ len (streams_in_to_mixer )} ) "
315301 f"does not match number of Splitter outputs ({ self .splitter .number_of_inputs } )."
316302 )
317303
318- all_streams_to_mixer = [inlet_stream_stage ] + additional_streams_to_mixer
304+ all_streams_to_mixer = [inlet_stream_stage ] + streams_in_to_mixer
319305 if sum (s .mass_rate_kg_per_h for s in all_streams_to_mixer ) == 0 :
320306 if prefer_first_stream :
321307 return inlet_stream_stage
0 commit comments