Menu

Bringing the density of a selected compound in PYTHON coding

nihal
2021-03-05
2021-03-09
  • nihal

    nihal - 2021-03-05

    Is there any code to extract the density and viscosity of the compound using the command rho1=Flowsheet.SelectedCompounds['hydrogen'].density

     
  • nihal

    nihal - 2021-03-05

    It was showing the error as it is not attributed to constant property

     
  • Leandro Favaretto

    try tiping Hydrogen instead of hydrogen

     
  • Daniel Medeiros

    Daniel Medeiros - 2021-03-06

    Vapor phase density is not available for single compounds. DWSIM calculates the density for the entire vapor phase mixture.

     
  • Daniel Medeiros

    Daniel Medeiros - 2021-03-06

    To get the density of the whole vapor phase, use

    vapdens = stream.PropertyPackage.AUX_VAPDENS(T_in_K, P_in_Pa) # density in kg/m3
    
     
  • nihal

    nihal - 2021-03-09

    Sir, can you please share some source code regarding extracting and viscosity for the overall compound

     
  • Daniel Medeiros

    Daniel Medeiros - 2021-03-09

    Overall compound or overall phase?

    visc = stream.GetPhase("Vapor").Properties.viscosity # Pa.s
    dens = stream.GetPhase("Vapor").Properties.density # kg/m3
    
     
  • nihal

    nihal - 2021-03-09

    Sir, i want from the overall compound

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.