Specifications

Extensibility 3-61
3-61
WorkFluid.TPFlash
hyFeedStrm.TemperatureValue,
hyFeedStrm.PressureValue
If WorkFluid.FluidPhases.Count = 1 Then
CalcError(0) = True
GoTo ErrorTrap
End If
Do a TP Flash on the fluid at the
temperature and pressure of the stream
hyFeedStrm. If there is a second phase
then an error has occurred.
Temp = hyWatStrm.ComponentMolarFraction
If Temp(0) = conEmpty Then
MoleFl =
hyWatStrm.ComponentMolarFraction
Creates a temporary array containing the
component molar fraction values of the
stream object hyWatStrm (the water
stream).
If the mole fraction of the first component
in the stream is not specified, then do the
following:
For i = 0 To Components.Count - 1
MoleFl(i) = 0
Next i
MoleFl(H2O) = 1
Set the mole fraction of every component
in the temporary array to be zero. Then
set the mole fraction of water to be 1.
hyWatStrm.ComponentMolarFraction.Erase
hyWatStrm.ComponentMolarFraction.Calculate
MoleFl
Deletes the current component molar
fraction values of the stream
hyWatStrm. It then sets the component
fraction of the stream to the contents of
the temporary array MoleFl.
ElseIf Temp(H2O) = 0 Then
CalcError(1) = True
GoTo ErrorTrap
End If
Else if the mole fraction of water in the
stream hyWatStrm is zero then an error
has occurred.
With hyWatStrm
.Pressure.Erase
.Pressure.Calculate
hyFeedStrm.PressureValue
.Temperature.Erase
.Temperature.Calculate
hyFeedStrm.TemperatureValue
End With
Resets the water stream temperature and
pressure at the new molar composition.
If hyFeedStrm.MolarFlowValue = 0 Then
hyWatStrm.MolarFlow.Calculate 0
GoTo EndCalcs
End If
If the feed stream molar flow is 0 then
exit.
Set WorkFluid = hyFeedStrm.DuplicateFluid
Set WatFluid = hyWatStrm.DuplicateFluid
Count = 0
Creates a duplicate fluid of the feed and
water streams and sets the counter
variable Count to zero.
If WorkFluid.FluidPhases.Count > 1 Then
hyWatStrm.MolarFlow.Calculate 0
GoTo EndCalcs
End If
If the number of phases in the feed
stream fluid is greater than 1, then set
the molar flow of the water stream to
zero.
Code Explanation