Splitter - Nouman090/ThermoSim GitHub Wiki
A splitter divides one inlet stream into multiple outlet streams with specified mass-flow fractions. All outlets have the same temperature, pressure, and enthalpy as the inlet (isenthalpic, isobaric split).
Physics
áš_out,i = fraction_i Ă áš_in
H_out,i = H_in
P_out,i = P_in
Ex_D = 0 (ideal splitter)
The fractions must sum to 1.0 (or will be normalized automatically).
Syntax
Splitter(Model, ID, In_state, Out_states, split_fractions, Calculate=False)
| Parameter | Type | Default | Description |
|---|---|---|---|
Model |
ThermodynamicModel | â | The model object |
ID |
str | â | Unique component name |
In_state |
str | â | Inlet state point name |
Out_states |
list of str | â | List of outlet state point names |
split_fractions |
list of float | â | Mass-flow fractions for each outlet |
Calculate |
bool | False | Solve immediately if True |
Output Attributes
| Attribute | Type | Unit | Description |
|---|---|---|---|
.Ex_D |
float | W | Exergy destruction (always 0) |
.split_fractions |
list | â | Normalized fractions |
.Solution_Status |
bool | â | True if solved |
.In |
Prop | â | Inlet state point object |
Cases
Case 1: Two-Way Split
Most common. Split one stream into two equal or unequal parts.
from Thermosim import ThermodynamicModel, Splitter
Model = ThermodynamicModel()
Model.set_dead_state()
# Inlet
Model.add_point('water', 'In', P=10e5, T=473.15, Mass_flowrate=1.0)
# Outlets (will be calculated)
Model.add_point('water', 'Out1', P=10e5)
Model.add_point('water', 'Out2', P=10e5)
Splitter(Model, 'Split1', In_state='In', Out_states=['Out1', 'Out2'],
split_fractions=[0.6, 0.4], Calculate=True)
print(f"Out1 mass flow: {Model.Point['Out1'].Mass_flowrate:.2f} kg/s")
print(f"Out2 mass flow: {Model.Point['Out2'].Mass_flowrate:.2f} kg/s")
print(f"Out1 T: {Model.Point['Out1'].T - 273.15:.2f} °C")
print(f"Out2 T: {Model.Point['Out2'].T - 273.15:.2f} °C")
Case 2: Three-Way Split
Split into three outlets with different fractions.
Model = ThermodynamicModel()
Model.set_dead_state()
Model.add_point('air', 'Inlet', P=5e5, T=300, Mass_flowrate=10)
Model.add_point('air', 'A', P=5e5)
Model.add_point('air', 'B', P=5e5)
Model.add_point('air', 'C', P=5e5)
Splitter(Model, 'Manifold', In_state='Inlet', Out_states=['A', 'B', 'C'],
split_fractions=[0.5, 0.3, 0.2], Calculate=True)
print(f"A: {Model.Point['A'].Mass_flowrate:.2f} kg/s")
print(f"B: {Model.Point['B'].Mass_flowrate:.2f} kg/s")
print(f"C: {Model.Point['C'].Mass_flowrate:.2f} kg/s")
Case 3: Regenerative Rankine (Steam Extraction)
Extract steam from turbine for feedwater heating.
Model = ThermodynamicModel()
Model.set_dead_state()
# Turbine mid-point extraction
Model.add_point('water', 'Turb_mid', P=5e5, T=425.15, Mass_flowrate=1.0)
# Split: 20% to feedwater heater, 80% continues to LP turbine
Model.add_point('water', 'Extraction', P=5e5)
Model.add_point('water', 'To_LP_Turb', P=5e5)
Splitter(Model, 'Extractor', In_state='Turb_mid',
Out_states=['Extraction', 'To_LP_Turb'],
split_fractions=[0.2, 0.8], Calculate=True)
print(f"Extraction flow: {Model.Point['Extraction'].Mass_flowrate:.2f} kg/s")
print(f"LP turbine flow: {Model.Point['To_LP_Turb'].Mass_flowrate:.2f} kg/s")
Case 4: Fractions Don't Sum to 1 (Auto-Normalization)
If fractions sum to something other than 1.0, the splitter normalizes them and issues a warning.
Model = ThermodynamicModel()
Model.set_dead_state()
Model.add_point('water', 'In', P=10e5, T=473.15, Mass_flowrate=1.0)
Model.add_point('water', 'Out1', P=10e5)
Model.add_point('water', 'Out2', P=10e5)
Splitter(Model, 'Split1', In_state='In', Out_states=['Out1', 'Out2'],
split_fractions=[3, 2], Calculate=True)
# Warning: Split fractions for Split1 sum to 5. Normalising.
# Actual fractions: [0.6, 0.4]
print(f"Normalized fractions: {Model.Component['Split1'].split_fractions}")
Print Component Data
print(Model.Component['Split1'])
Output:
Split1 (Splitter):
Inlet mass flow : 1.0000 kg/s
Split fractions : [0.6, 0.4]
Exergy destr. : 0
Solved : True
Complete Example
from Thermosim import ThermodynamicModel, Splitter
# Create model
Model = ThermodynamicModel()
Model.set_dead_state()
# Define inlet
Model.add_point('water', 'MainFlow', P=20e5, T=500, Mass_flowrate=5.0)
# Define outlets
Model.add_point('water', 'Branch1', P=20e5)
Model.add_point('water', 'Branch2', P=20e5)
Model.add_point('water', 'Branch3', P=20e5)
# Add splitter
Splitter(Model, 'FlowDivider', In_state='MainFlow',
Out_states=['Branch1', 'Branch2', 'Branch3'],
split_fractions=[0.5, 0.3, 0.2], Calculate=True)
# Access results
print(f"Branch 1 flow: {Model.Point['Branch1'].Mass_flowrate:.2f} kg/s")
print(f"Branch 2 flow: {Model.Point['Branch2'].Mass_flowrate:.2f} kg/s")
print(f"Branch 3 flow: {Model.Point['Branch3'].Mass_flowrate:.2f} kg/s")
print(f"All have T = {Model.Point['Branch1'].T - 273.15:.2f} °C")