
2-52 Key HYSYS Objects
2-52
Solver & Integrator
The Solver is accessed from the SimulationCase object. The
Solver object can be used to turn the calculations on and off.
When accessing HYSYS through Automation it is important to
note that HYSYS does not allow communication while it is
solving. If information is sent to HYSYS from a client application,
HYSYS does not return control to the calling program until
calculations are complete. If it is necessary to pass a large
amount of information to HYSYS it is best to turn the solver off
first and then turn it on once the information is sent. Otherwise,
HYSYS calculates after each piece of information is sent and it
takes much longer to transfer the data.
Syntax for the Solver and Integrator
Solver
SimulationCase.Solver.CanSolve = False
SimulationCase.Solver.CanSolve = True
Integrator
SimulationCase.Solver.Integrator.Active = True
SimulationCase.Solver.Integrator.Active = False
Example: Starting/Stopping the Solver
Dim hystream As ProcessStream
Set hystream = hyCase.Flowsheet.MaterialStreams.Item(0)
hyCase.Solver.CanSolve = False
hystream.Temperature.SetValue 100, “F”
hystream.Pressure.SetValue 1, “atm”
hystream.MassFlow.SetValue 1000, “lb/hr”
hyCase.Solver.CanSolve = True
Comentários a estes Manuais