Streams - abhishekvraman/Propylean GitHub Wiki

Introduction

A chemical plant is a complex system of different type of Streams flowing from one end to another. Streams can be of solid, liquid or gas. Or it can be Energy flowing in form of electricity, steam or hot heat transfer medium. These streams have associated physical properties which governs their behaviour within the system. Simluation softwares often have stream objects as way to describe the fluid flowing and also serves as a means to connect one equipmnet object with another, with property of that stream changing as it moves in the system. Taking the similar approch, Propylean has Stream class which has two derived classes, MaterialStream and EnergyStream for users to simulate material flow and energy flow in a system.

MaterialStream

MaterialStream is a class which is used to define a material fluid flowing through equipments in a process plant. Currently, we only support gas and liquids only. Users can set values of property manually or let Propylean set the values. Propylean uses the thermo package to derive the properties.

Properties

User can set or get the properties of below described properties as demonstrated as follows:

from propylean.streams import MaterialStream
# or
from propylean import MaterialStream
from propylean import properties as prop
sour_gas = MaterialStream(tag="sour_gas_from_fields")
sour_gas.temperature =  prop.Temperature(25, "C")
sour_gas.pressure = prop.Pressure(75, "bar")
mol_fractions = {"methane": 0.95, "Ethane": 0.2, "Butane": 0.1, "Propane": 0.05, "water":0.05, "Hydrogen Sulphide": 0.01}
sour_gas.components = prop.Components(mol_fractions, type="mol")

# Get the density of the sour_gas MaterialStream.
print(sour_gas.density)

mol_flowrate

The molar flowrate of the material stream. This property cannot be set but is derived from mass flowrate and molecular weight. Type: MolarFlowRate

vol_flowrate

The volumetic flowrate of the material stream. This property cannot be set but is derived from mass flowrate and density. Type: VolFlowRate

Pc

Critical pressure of the material stream. Type: Pressure

Psat

Saturation pressure of the material stream. Type: Pressure

Z_g

The gas phase compressibility of the material stream. Type: Dimensionless

Z_l

The liquid phase compressibility of the material stream. Type: Dimensionless

components

The components of the mixture in the material stream. Can be mixture of various pure compunds in mol fraction, mass fraction or volume fraction. Set this property using propylean.properties.components class. Type: Components

d_viscosity

The dynamic viscosity of the material stream in mixed phase. Type: DViscosity

d_viscosity_g

The dynamic viscosity of the material stream in gas phase. Type: DViscosity

d_viscosity_l

The dynamic viscosity of the material stream in liquid phase. Type: DViscosity

density

The density of the material stream in mixed phase. Type: Density

density_g

The density of the material stream in gas phase. Type: Density

density_l

The density of the material stream in liquid phase. Type: Density

isentropic_exponent

The isentropic exponent or the specific heat ratio (Cp/Cv) of the material stream. Type: Dimensionless

mass_flowrate

Mass flowrate of the material stream. Type: MassFlowRate

molecular_weight

The molecular weight of the material stream. Type: MassFlowRate

phase

The phase of the material stream. "l" for liguid, "g" for gas, "l/g" for mixed phase as per fluids package. Type: String

pressure

The pressure of the material stream. It is recommended to set it to help derive other properties. Type: Pressure

temperature

The temperature of the material stream. It is recommended to set it to help derive other properties. Type: Temperature

EnergyStream

EnergyStream is a class which is used to define flow of energy(power) through equipments in a process plant.

Properties

User can set energy flow property which is also similar to Power in properties submodule.

from propylean.streams import EnergyStream
# or
from propylean import EnergyStream
heating = EnergyStream(tag="stream heating")
heating.amount =  prop.Power(25, "C")

amount

Power or energy flowrate of the stream. Type: Power