streams
- class pyheatintegration.streams.streams.Stream(input_temperature: float, output_temperature: float, heat_load: float, type_: pyheatintegration.enums.StreamType = StreamType.AUTO, state: pyheatintegration.enums.StreamState = StreamState.UNKNOWN, cost: float = 0.0, reboiler_or_reactor: bool = False, id_: str = '')
熱交換を行う流体を表すクラス。
- パラメータ
input_temperature (float) -- 入り口温度 [℃]。
output_temperature (float) -- 出口温度 [℃]。
heat_load (float) -- 熱量 [W]。
type_ (StreamType) -- 流体の種類。
state (StreamState) -- 流体の状態。
cost (float) -- 流体のコスト [円/J]。外部流体の場合のみ設定可能。
reboiler_or_reactor (bool) -- 流体がリボイラーまたは反応器で用いられるかどうか。
id_ (str) -- 流体を区別する識別子。
- id_
流体を区別する識別子。
- Type
str
- temperature_range
温度範囲。
- Type
TemperatureRange
- heat_load
熱量 [W]。
- Type
float
- cost
コスト [円/J]。
- Type
float
- type_
流体の種類。
- Type
- state
流体の状態。
- Type
- reboiler_or_reactor
流体がリボイラーまたは反応器で用いられるかどうか。
- Type
bool
- 例外
InvalidStreamError -- 入り口温度と出口温度の大小関係と流体種の関係が不正である場合。また、外部流体の熱 量が0以外の場合および外部流体以外の流体の熱量が0である場合。外部流体以外にコスト を設定した場合。
サンプル
>>> Stream(0, 20, 300) Stream(0, 20, 300, type_=StreamType.COLD, state=StreamState.UNKNOWN, cost=0.0, reboiler_or_reactor=False, id_="e0c1facb-538b-417f-862c-5cf8043ec075") >>> Stream(20, 0, 300) Stream(20, 0, 300, type_=StreamType.HOT, state=StreamState.UNKNOWN, cost=0.0, reboiler_or_reactor=False, id_="1a193fc7-9f34-4e6a-8e99-615d40be1b20") >>> Stream(0, 0, 0) Traceback (most recent call last): ... InvalidStreamError: 入り口温度と出口温度が同じ流体の種類は明示的に指定する必要があります。
- contain_temperature(temperature: float) bool
与えられた温度をとるかを返します。
- パラメータ
temperature (float) -- 検証したい温度。
- 戻り値
与えられた温度をとるかどうか。
- 戻り値の型
bool
- contain_temperatures(temperatures: collections.abc.Iterable[float]) bool
与えられた複数の温度をとるかを返します。
全ての温度をとる場合のみTrueを返します。
- パラメータ
temperatures (Iterable[float]) -- 検証したい温度のリスト。
- 戻り値
与えられた複数の温度をとるかどうか。
- 戻り値の型
bool
- heat() float
熱量を返します。
- 戻り値
熱量 [W]。
- 戻り値の型
float
- input_temperature() float
入り口温度を返します。
- 戻り値
入り口温度。
- 戻り値の型
float
- is_cold() bool
受熱流体であるかを返します。
- 戻り値
受熱流体であるかどうか。
- 戻り値の型
bool
- is_external() bool
外部流体であるかを返します。
- 戻り値
外部流体であるかどうか。
- 戻り値の型
bool
- is_hot() bool
与熱流体であるかを返します。
- 戻り値
与熱流体であるかどうか。
- 戻り値の型
bool
- is_internal() bool
外部流体以外であるかを返します。
- 戻り値
外部流体以外であるかどうか。
- 戻り値の型
bool
- is_isothermal() bool
等温流体かを返します。
- 戻り値
等温流体であるかどうか。
- 戻り値の型
bool
- output_temperature() float
出口温度を返します。
- 戻り値
出口温度。
- 戻り値の型
float
- shift_temperature(delta: float) None
入り口温度と出口温度をずらします。
- パラメータ
delta (float) -- ずらす値。
- sort_key() float
ソートの際に用いるキーを返します。
与熱流体は出口温度、受熱温度は入口温度を返します。
- 戻り値
ソート時にキーとなる値。
- 戻り値の型
float
- temperature() float
温度変化を返します。
- 戻り値
温度変化 [℃]。
- 戻り値の型
float
- temperatures() tuple[float, float]
入り口温度と出口温度を返します。
- 戻り値
温度範囲。
- 戻り値の型
tuple[float, float]
- update_heat(heat_load: float) None
熱量を更新します。
入り口温度と出口温度が異なる流体に対しては呼び出せません。
- パラメータ
heat_load (float) -- 更新する熱量。
- 例外
ValueError -- 等温流体以外に対して熱量を更新しようとした場合。
- update_temperature(input_temperature: float, output_temperature: float) None
入り口温度と出口温度を更新します。
等温流体に対しては呼び出せません。温度の値に加えて、熱量の値を元々の温度変化と新たな温 度変化の比に従って更新します。
- パラメータ
input_temperature (float) -- 更新する入り口温度 [℃]。
output_temperature (float) -- 更新する出口温度 [℃]。
- 例外
ValueError -- 等温流体に対して温度を更新しようとした場合。
- pyheatintegration.streams.streams.get_temperature_range_heats(streams: list[pyheatintegration.streams.streams.Stream]) tuple[list[pyheatintegration.ranges.temperature_range.TemperatureRange], dict[pyheatintegration.ranges.temperature_range.TemperatureRange, float]]
温度領域ごとに必要な熱量を返します。
- パラメータ
streams (list[Stream]) -- 流体のリスト。
- 戻り値
温度領域、温度領域ごとの必要熱量。
- 戻り値の型
tuple[list[TemperatureRange], dict[TemperatureRange, float]]
- pyheatintegration.streams.streams.get_temperature_range_streams(streams: list[pyheatintegration.streams.streams.Stream]) tuple[list[pyheatintegration.ranges.temperature_range.TemperatureRange], collections.defaultdict[pyheatintegration.ranges.temperature_range.TemperatureRange, set[pyheatintegration.streams.streams.Stream]]]
温度領域に属する流体を返します。