splitting#

This module contains unit operations for splitting flows.

class Splitter(ID='', ins=None, outs=(), thermo=None, **kwargs)[source]#

Create a splitter that separates mixed streams based on splits.

Parameters:
  • ins (Stream], optional) – Inlet fluid to be split.

  • outs (Stream], optional) –

    • [0] Split stream

    • [1] Remainder stream

  • split (Should be one of the following) –

    • [float] The fraction of net feed in the 0th outlet stream

    • [array_like] Componentwise split of feed to 0th outlet stream

    • [dict] ID-split pairs of feed to 0th outlet stream

  • order=None (Iterable[str], defaults to biosteam.settings.chemicals.IDs) – Chemical order of split.

Examples

Create a Splitter object with an ID, a feed stream, two outlet streams, and an overall split:

>>> from biosteam import units, settings, Stream
>>> settings.set_thermo(['Water', 'Ethanol'], cache=True)
>>> feed = Stream('feed', Water=20, Ethanol=10, T=340)
>>> S1 = units.Splitter('S1', ins=feed, outs=('top', 'bot'), split=0.1)
>>> S1.simulate()
>>> S1.show()
Splitter: S1
ins...
[0] feed
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    20
                    Ethanol  10
outs...
[0] top
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    2
                    Ethanol  1
[1] bot
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    18
                    Ethanol  9

Create a Splitter object, but this time with a componentwise split using a dictionary:

>>> S1 = units.Splitter('S1', ins=feed, outs=('top', 'bot'),
...                     split={'Water': 0.1, 'Ethanol': 0.99})
>>> S1.simulate()
>>> S1.show()
Splitter: S1
ins...
[0] feed
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    20
                    Ethanol  10
outs...
[0] top
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    2
                    Ethanol  9.9
[1] bot
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    18
                    Ethanol  0.1

Create a Splitter object using componentwise split, but this time specify the order:

>>> S1 = units.Splitter('S1', ins=feed, outs=('top', 'bot'),
...                     order=('Ethanol', 'Water'),
...                     split=(0.99, 0.10))
>>> S1.simulate()
>>> S1.show()
Splitter: S1
ins...
[0] feed
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    20
                    Ethanol  10
outs...
[0] top
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    2
                    Ethanol  9.9
[1] bot
    phase: 'l', T: 340 K, P: 101325 Pa
    flow (kmol/hr): Water    18
                    Ethanol  0.1

Splits can also be altered after creating the splitter:

>>> S1.split = 0.5
>>> S1.isplit.show()
SplitIndexer:
 Water    0.5
 Ethanol  0.5
>>> S1.isplit['Water'] = 1.0
>>> S1.isplit.show()
SplitIndexer:
 Water    1
 Ethanol  0.5
>>> S1.split = [0.9, 0.8]
>>> S1.isplit.show()
SplitIndexer:
 Water    0.9
 Ethanol  0.8
class PhaseSplitter(ID='', ins=None, outs=(), thermo=None, **kwargs)[source]#

Create a PhaseSplitter object that splits the feed to outlets by phase.

Parameters:
  • ins (Stream], optional) – Feed.

  • outs (Stream], optional) – Outlets.

Notes

Phases allocate to outlets in alphabetical order. For example, if the feed.phases is ‘gls’ (i.e. gas, liquid, and solid), the phases of the outlets will be ‘g’, ‘l’, and ‘s’.

Examples

>>> import biosteam as bst
>>> bst.settings.set_thermo(['Water', 'Ethanol'], cache=True)
>>> feed = bst.Stream('feed', Water=10, Ethanol=10)
>>> feed.vle(V=0.5, P=101325)
>>> s1 = bst.Stream('s1')
>>> s2 = bst.Stream('s2')
>>> PS = bst.PhaseSplitter('PS', feed, [s1, s2])
>>> PS.simulate()
>>> PS.show()
PhaseSplitter: PS
ins...
[0] feed
    phases: ('g', 'l'), T: 353.94 K, P: 101325 Pa
    flow (kmol/hr): (g) Water    3.87
                        Ethanol  6.13
                    (l) Water    6.13
                        Ethanol  3.87
outs...
[0] s1
    phase: 'g', T: 353.94 K, P: 101325 Pa
    flow (kmol/hr): Water    3.87
                    Ethanol  6.13
[1] s2
    phase: 'l', T: 353.94 K, P: 101325 Pa
    flow (kmol/hr): Water    6.13
                    Ethanol  3.87
class MockSplitter(ID='', ins=None, outs=(), thermo=None, **kwargs)[source]#

Create a MockSplitter object that does nothing when simulated.

class ReversedSplitter(ID='', ins=None, outs=(), thermo=None, **kwargs)[source]#

Create a splitter that, when simulated, sets the inlet stream based on outlet streams. Must have only one input stream. The outlet streams will have the same temperature, pressure and phase as the inlet.