Connect and Disconnect Equipment Object with Stream Object - abhishekvraman/Propylean GitHub Wiki

Introduction

Every equipment class supports two methods to connect streams objects with the equipment objects. Both MaterialStream and EnergyStream objects can be connected to any equipment inlet and outlet. By connecting the an equipment with Stream object, you can transfer physical property data in the stream object to downstream equipments as well as make the property available for the equipment to use.

equp_obj.connect_stream()

connect_stream(stream_object=None, direction=None, stream_tag=None, stream_type=None, stream_governed=True)
       DESCRIPTION:
           Class method to connect a stream object with equiment.
       
       PARAMETERS:
           stream_object:
               Required: No if stream_tag is provided else Yes
               Type: EnergyStream or MaterialStream
               Acceptable values: object of specified stream types
               Default value: None
               Description: Stream object user wants to connect the equipment with.
           
           direction:
               Required: Yes for material stream. For energy stream, may needed or not based on equipment type.
               Type: str
               Acceptable values: 'in', 'out', 'inlet' or 'outlet'
               Default value: None
               Description: Direction in which stream should be with respect to equipment.
           
           stream_tag:
               Required: No if stream_object is provided else Yes
               Type: str
               Acceptable values: stream tag provided by user
               Default value: None
               Description: Stream object with known stream_tag user wants to connect the equipment with.
       
           stream_type:
               Required: No if stream_object provided
               Type: str
               Acceptable values: 'm', 'mass', 'e', 'energy'
               Description: Type of stream user wants to connect.
          
           stream_governed:
               Required: Not required but recommended to override default value.
               Type: bool
               Default values: True 
               Description: Specifies if property is to be passed from stream to equipment and further to downstream material streams and equipments.
                            If True, property like pressure, temperature and mass flowrate of stream is transfered equipment. 
                            If False, property are transfered from equipment to stream.
       
       RETURN VALUE:
           Type: bool
           Description: True is returned if connection is successful else False.
       
       ERROR RAISED:
           Type: General
           Description: Error raised if arguments are wrong.
       
       SAMPLE USE CASES:
           >>> eq1.connect_stream(en1, direction="in")
           >>> eq1.connect_stream(direction='out', stream_tag='Pump-outlet', stream_type='m')

equp_obj.disconnect_stream()

disconnect_stream(stream_object=None, direction=None, stream_tag=None, stream_type=None)
       DESCRIPTION:
           Class method to disconnect a stream object from equiment.
       
       PARAMETERS:
           stream_object:
               Required: No if stream_tag is provided else Yes
               Type: EnergyStream or MaterialStream
               Acceptable values: object of specified stream types
               Default value: None
               Description: Stream object user wants to disconnect the equipment with.
           
           direction:
               Required: Yes if stream_object or stream_tag not provided
               Type: str
               Acceptable values: 'in', 'out', 'inlet' or 'outlet'
               Default value: None
               Description: Direction in which stream should be with respect to equipment.
           
           stream_tag:
               Required: No if stream_object is provided else Yes
               Type: str
               Acceptable values: stream tag provided by user
               Default value: None
               Description: Stream object with known stream_tag user wants to disconnect the equipment from.
       
           stream_type:
               Required: No if stream_object provided
               Type: str
               Acceptable values: 'm', 'mass', 'e', 'energy'
               Description: Type of stream user wants to disconnect.
       
       RETURN VALUE:
           Type: bool
           Description: True is returned if disconnection is successful else False
       
       ERROR RAISED:
           Type: General
           Description: Error raised if arguments are wrong
       
       SAMPLE USE CASES:
           >>> eq1.disconnect_stream(s1)
           >>> eq1.disconnect_stream(stream_tag='Pump-outlet')
           >>> eq1.disconnect_stream(direction='in', stream_type="energy")