Jump to content



Featured Articles

Check out the latest featured articles.

File Library

Check out the latest downloads available in the File Library.

New Article

Product Viscosity vs. Shear

Featured File

Vertical Tank Selection

New Blog Entry

Low Flow in Pipes- posted in Ankur's blog

Binary Interaction Parameters


This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic
Share this topic:
| More

#1 satsat

satsat

    Brand New Member

  • Members
  • 2 posts

Posted 07 January 2009 - 01:00 PM

I need to use Binary Interaction Parameters for Wilson property package in Hysys Micro Language Editor.

I need your help for my classroom project.
Some thing like:
------ 276.756
975.486 ----

Aij for H2O-Ethanol

Source code like :
?? = ?? WilsonPropPkg.Aij .??

Waiting for your kind help
Please help me


#2 Padmakar Katre

Padmakar Katre

    Gold Member

  • ChE Plus Subscriber
  • 992 posts

Posted 12 January 2009 - 08:13 AM

Dear,
Could you give the further details of your problem as it is hard to interprete from your post.

#3 joerd

joerd

    Gold Member

  • ChE Plus Subscriber
  • 371 posts

Posted 12 January 2009 - 11:59 AM

QUOTE (satsat @ Jan 7 2009, 11:00 AM) <{POST_SNAPBACK}>

I don't know the Hysys macro language editor very well - it is not very userfriendly IMHO - but here is the VBA code to retrieve the Aij values. You can probably adapt it to suit your situation.
CODE

Sub GetAij()
Const hyEMPTY As Integer = -32767
Dim h As HYSYS.Application
Dim s As SimulationCase
Dim fp As FluidPackage
Dim wp As WilsonPropPkg
Dim a As Variant
Dim nc As Integer, i As Integer, j As Integer

'Link to the open HYSYS case
Set h = GetObject(, "HYSYS.Application")
Set s = h.ActiveDocument
'Link to the desired fluid package (here named "Basis-1)
Set fp = s.BasisManager.FluidPackages("Basis-1")
Set wp = fp.PropertyPackage
'Get the number of components
nc = fp.Components.Count
'Get the Aij parameter values as a two-dimensional array of dimension nc,nc
a = wp.Aij.GetValues("")

'Print the values, display nice --- instead of <empty> value (-32767)
For i = 0 To nc - 1
For j = 0 To nc - 1
If CInt(a(i, j)) = hyEMPTY Then
Debug.Print "---",
Else
Debug.Print a(i, j),
End If
Next j
Debug.Print
Next i

End Sub


#4 satsat

satsat

    Brand New Member

  • Members
  • 2 posts

Posted 15 January 2009 - 03:00 AM

Dear joerd
Thank you
it solved my problem

rolleyes.gif






Similar Topics