I am trying to set up a user variable for calculating erosional velocity in Hysys. I know I can manually calculate it but want to show it in my simulation. The code I wrote is not working. Or is there any solution.
Sub PostExecute ()
InletDensity = activeobject.FeedStream.MassDensityValue
outletDensity = activeobject.FeedStream.MassDensityValue
averageDensity = 0.5 * (inletDensity + outletDensity)
erosionalVelocty = 100 / Sqr (averageDensity)
End Sub