Menu

PT flash on pure component stream gives a wrong value

Charan
2018-06-14
2018-06-15
  • Charan

    Charan - 2018-06-14

    Hi All,
    When i perform a PT flash on a pure water stream , all the values on the output material stream are incorrect.
    However if i perform a PH flash for the same stream the values are correct. I have attached my code below where i have just transferred values from one stream to another.
    The code was written inside the python scripting unit operation tool and water was the only component used

    from DWSIM.Thermodynamics import *
    
    feed1 = ims1
    P_1 = feed1.GetProp("pressure", "Overall", None, "", "")
    massflow_1 = feed1.GetProp("totalFlow" ,"Overall", None, "", "mass")
    molfrac_1 = feed1.GetProp("fraction", "Overall", None, "", "mole")
    molflow_1 = feed1.GetProp("totalFlow" ,"Overall", None, "", "mole")
    enthalpy_1 = feed1.GetProp("enthalpy" ,"Overall", None, "Mixture", "mass")
    T_1 = feed1.GetProp("temperature","Overall",None,"","")
    
    out = oms1
    out.Clear()
    out.SetProp("temperature","Overall",None,"","",T_1)
    out.SetProp("pressure", "Overall", None, "", "", P_1)
    out.SetProp("fraction", "Overall", None, "", "mole", molfrac_1)
    out.SetProp("totalFlow", "Overall", None, "", "mass", massflow_1)
    #out.SetProp("enthalpy", "Overall", None, "", "mass",enthalpy_1)
    #out.PropertyPackage.DW_CalcEquilibrium(PropertyPackages.FlashSpec.P, PropertyPackages.FlashSpec.H)
    
     
  • Daniel Medeiros

    Daniel Medeiros - 2018-06-14

    Please define what are the correct and incorrect values...

     
  • Charan

    Charan - 2018-06-15

    This is output value i get when i use the code above. By incorrect values i mean that the input and output values are not same.I used the same property values for both material streams and therfore should get identical values. I get identical values only when i use PH flash

     
  • Daniel Medeiros

    Daniel Medeiros - 2018-06-15

    When a single-compound stream is connected to the outlet of an unit operation, a PH flash is forced. In this case, you must specify the enthalpy of the outlet stream so it can be calculated correctly. This is because you can't specify a partial vaporization (if required) with T and P only.

    See the debug output for more details:

    Calculation spec: Temperature_and_Pressure
    
    Input variables: T = 373.132345797454 K, P = 101325 Pa
    
    Checking mixture composition. Sum must be higher than zero. Sum = 1
    
    Checking flow definition. Mass flow specified, will calculate molar and volumetric flow.
    
    Property Package: Peng-Robinson (PR)
    
    Flash Algorithm: NestedLoops
    
    Calculating phase equilibria...
    
    **Stream is single-compound and attached to the outlet of an unit operation. PH flash equilibrium calculation forced.**
    
    Phase equilibria calculated succesfully.
    
    Calculating phase properties...
    
    Phase properties calculated successfully.
    
    Material Stream calculated successfully.