## Featured Articles

Check out the latest featured articles.

## New Article

Product Viscosity vs. Shear

## Featured File

Vertical Tank Selection

## New Blog Entry

Low Flow in Pipes- posted in Ankur's blog

# Prode Thermo Physidal Properties In Excel

properties excel gas liquid density isothermal compressibility viscosity speed of sound

This topic has been archived. This means that you cannot reply to this topic.
31 replies to this topic
|

### #1 frpe

frpe

Veteran Member

• Members
• 47 posts

Posted 16 February 2013 - 04:19 AM

I am learning how to utilize Prode Properties to estimate the thermophysical properties (density, viscosity, isothermal compressibility, speed of sound etc.) required in my Excel data sheets,

the operating manual says there are two different sets of methods,

for example I can calculate liquid isothermal compressibility in Excel with two different macros

=StrLIC(stream)

=EStrLIC(stream,t,p)

where the second allows to specify the operating conditions,

my question, which are the advantages to utilize the first macro over the second ?

How can I specify the operating conditions in the first case ?

### #2 Art Montemayor

Art Montemayor

Gold Member

• 5,721 posts

Posted 16 February 2013 - 08:07 AM

What is needed here is help and guidance from our Prode Expert: Paolo Pemi.

Help, Paolo!

### #3 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 16 February 2013 - 12:59 PM

frpe,
Properties exports many methods (available as macros in Excel) which allow to  calculate all usual properties as density, viscosity, cp, cv, isothermal compressibility etc. in addition there are methods for less common properties as for example the speed of sound for mixed (vapor+liquid)  mixtures (with HEM model)

=StrMSS(stream,t,p)

in Excel my preferred approach is to utilize the macros which include operating conditions,

=EStrLIC(1,\$A1,\$A2)

where the value of temperature is defined in cell A1 and pressure in cell A2,
you can easily change the values and this activates the macro EStrLIC(), the procedure solves a isothermal flash at specified t,p , calculates the values of isothermal compressibility for liquid phase and returns the value, results are almost immediate.

You can define a sequence of operations, for example temperature and/or pressure could be the result of some previous operation, this allows to simulate simple units, you can utilize the Solver (included in Excel) to change some variables to reach a desired value.

Also you can create tables of values, graphs etc. there are examples provided with the software.

In Properties You can define operating conditions with a flash operation,
for example the isothermal multiphase flash has the macro

=setOp(stream,t,p)

but all the methods for H-P, H-T, S-P, S-T, V-P, V-T operations are available,
some are (in my opinion) of limited use, for example the constant energy flash, but you may need them, in some cases.
Also you may define streams, solve all unit operations etc. from Editor, this is a quick way to get results.

I would suggest for Excel pages the methods which include operating conditions while other methods are probably more useful in union with VBA (in my opinion)

In Properties (as in other simulators) you can define operating conditions with a flash operation, in Excel via macro or Properties Editor.

### #4 frpe

frpe

Veteran Member

• Members
• 47 posts

Posted 09 March 2013 - 09:51 AM

many thanks Paolo !

Could you suggest how to calculate

1) bulk modulus for a oil
2) isentropic exponent (not cp/cv)

Edited by frpe, 09 March 2013 - 09:52 AM.

### #5 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 11 March 2013 - 04:30 AM

bulk modulus of a oil

1) if you do not know the exact composition as first step you may wish to define the components,
Prode includes a module to characterize petroleum fractions,
as input you may provide a series of points with vapor-liquid equilibria (ASTM, etc.), density, viscosity

etc.

2) as discussed in previous post I prefer to create Excel pages for calculating the different properties, for the case of bulk modulus (which is the inverse of isothermal compressibility)
enter in cell B3

=EStrLIC(1;\$B1;\$B2)

and in cell B4

=1/\$B3

for calculating bulk modulus (see the attached example)

the advantage of this approach is that the program recalculates automatically the values when you change t or p

isentropic exponent (not cp/cv)
for this example I propose the formulation (which I have found in a paper of Span and Wagner)

K = (rho/p)*ss^2

where rho is density, p pressure and ss speed of sound

Prode calculates all the properties required,
for the speed of sound enter in cell B8

=EStrMSS(2;\$B6;\$B7)

for gas density enter in cell B9

=EStrGD(2;\$B6;\$B7)

then you can calculate the isentropic exponent in cell B10

(see the attached example)

if you wish to receive a copy of the Excel page just ask :-)

### #6 frpe

frpe

Veteran Member

• Members
• 47 posts

Posted 13 March 2013 - 08:59 AM

thanks Paolo,

for the isentropic exponent I have a different correlation

(cp/cv) / (Bp*T)

where Bp is the isobaric compressibility

Bp = -1/V * (dV/dT)p

and T is the temperature

do you know how to calculate these values with Prode Properties ?

Edited by frpe, 13 March 2013 - 09:00 AM.

### #7 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 15 March 2013 - 06:07 AM

> for the isentropic exponent I have a different correlation

> (cp/cv) / (Bp*T)

> where Bp is the isobaric compressibility

> Bp = -1/V * (dV/dT)p

> and T is the temperature

> do you know how to calculate these values with Prode Properties ?

Prode Properties exports (in Excel) the value of volume (gas, liquid, solid phases) and the derivatives vs. temperature, pressure and composition,

specifically Bp (isobaric compressibility)

Bp = -1/V * (dV/dT)p

is the derivative vs. temperature which you can calculate (in Excel) with the macro

=EStrGVE(2;\$B6;\$B7)

by the way for the liquid phase there is a equivalent macro

=EStrLVE(2;\$B6;\$B7)

remember that with Prode Properties you can calculate (in Excel) cp and cv with the macros

=EStrGCp(2;\$B6;\$B7)

and

=EStrGCv(2;\$B6;\$B7)

then you can calculate

cp = EStrGCp(2;\$B6;\$B7)

cv = EStrGCv(2;\$B6;\$B7)

bp = =EStrGVE(2;\$B6;\$B7)

and finally the required value for isentropic exponent

= (cp/cv) / (bp*t)

### #8 frpe

frpe

Veteran Member

• Members
• 47 posts

Posted 28 March 2013 - 04:40 AM

thanks Paolo, I am able to calculate the isentropic exponent in Excel, however I have to define a graph for different compositions, actually I edit compositions from the editor, is there a simple way to modify the compositions from an Excel page or with VBA code?

### #9 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 10 April 2013 - 10:39 AM

Prode Properties allows to define a composition in different ways

1) from Stream Editor, you can edit compositions of all streams, change models, solve flash operations etc.

(see attached image)

2) with Excel VBA (Visual Basic) or other applications as C, C++ , FORTRAN compilers, Matlab etc. to define a new composition (a list of components and fractions) you can utilize these methods

Call initS(Stream)
Call putZ(Stream, 1, cc1)
Call putCC(Stream, 1, w1)
....
Call setS(Stream)

where cc1 and w1 are the component's code and mole fraction

as alternative you can simply change a composition (for a predefined list of components) with putZ() methods

3) directly in Excel's cells you can utilize the above methods as Macros

=putZ(1,1,\$B1)

=putZ(1,2,\$B2)

where cells \$B1, \$B2 contains the molar fraction of components 1 ad 2

Finally you can modify the composition of each pahse in equilibria with method (or, in Excel,  Macro) putW()

### #10 marchem

marchem

Gold Member

• Members
• 153 posts

Posted 27 April 2013 - 11:09 AM

Paolo has presented several ways to define/modify a compositions in Prode Properties,

AOpen(),

AFOpen(char *path)

ASave()

AFSave(char *path)

these methods allow to save all the details of your projects (operating conditions and compositions of all streams, thermodynamics, units of measuremet etc.)

### #11 frpe

frpe

Veteran Member

• Members
• 47 posts

Posted 16 May 2013 - 07:29 AM

thanks Paolo & marchem,

I am now able to define compositions, save and restore !

Next step will be to save intermediate values (in a generic simulation),

does Prode allow to save only binary files or textual (or XML) files are also possible¨?

### #12 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 29 May 2013 - 01:09 AM

with Prode Properties methods you can export data in almost every format supported by your code,

I mean textual, XML etc.

there was a VBA example to save and restore a stream to a text file,

of course a SQL database or other applications are also possible,

let me know if you need a specific example...

### #13 frpe

frpe

Veteran Member

• Members
• 47 posts

Posted 07 June 2013 - 04:38 PM

yes, can you provide an example of how to save / restore a stream to a text file ?

(or XML or equivalent format which I can read with Excel)

### #14 serra

serra

Gold Member

• Members
• 310 posts

Posted 18 June 2013 - 08:52 AM

Hi frpe,

the operating manual of PRODE PROPERTIES has examples to save data to a file,

you can utilize the VBA in Excel to export to XML format,

for example you can define a XML structure then create a function XMLWrite with std., objects as

Private Sub XMLWrite()
Dim objDom As DOMDocument
Dim objXMLRoot As IXMLDOMElement
Dim objXMLelem As IXMLDOMElement
Dim objXMLattr As IXMLDOMAttribute
....

then you utilize the methods in PRODE PROPERTIES to get all the values in a stream and initialize the objects which will be saved (by Excel)  into a XML file

### #15 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 04 July 2013 - 09:17 AM

frpe,

I have the VBA code (which you include in a Excel page) to generate both text and XML files,

of course you need to define a specific structure to export / import this information,

there was an example (in PRODE PROPERTIES manual) to save / load streams data to / from text files,

I can email if you provide the address.

### #16 Art Montemayor

Art Montemayor

Gold Member

• 5,721 posts

Posted 04 July 2013 - 10:10 AM

Paolo / frpe:

I recommend you employ the Forum's Messaging feature to communicate personally and exchange information on a one-to-one basis.   This way, you avoid exposing your email address - which can bring on bad consequences in the future.

### #17 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 04 July 2013 - 10:20 AM

thanks Art,

Paolo

### #18 pathensey

pathensey

Brand New Member

• Inactive Member
• 9 posts

Posted 26 September 2013 - 12:32 PM

Paolo, the method based on =EStrLIC(1;\$B1;\$B2) for calculating bulk modulus does work reliably also for a (liquid) mixture of light hydrocarbons ? I need to calculate bulk modulus for some gas condensate, does Peng Robinson model give good values ?

### #19 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 27 September 2013 - 01:48 AM

yes,

you can apply in Excel the macro

=EStrLIC(1;\$B1;\$B2)

or the method EStrLIC(1,p,t) in your code to calculate bulk modulus,  accuracy will depend from selected models,

The extended versions of Soave-Redlich-Kwong and Peng-Robinson (available in PRODE PROPERTIES)

are reasonably accurate (much more than original versions).  For additional accuracy you may adopt GERG model which is, however, available only for a few fluids.

### #20 KhuramB

KhuramB

Brand New Member

• Members
• 3 posts

Posted 30 September 2013 - 08:45 AM

Hi,

I am trying to use prode macros in excel which is not working. could you please help me out that how to include properties.vba in excel 2007 to use prode macros?

### #21 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 30 September 2013 - 09:34 AM

dear KhuramB

I suggest to follow the instruction provided in the operating manual,  PRODE PROPERTIES supports both 32 and 64 bit versions of Excel and installs automatically a 32 bit on Windows 32 and 64 bit version on Windows 64.

if you run Excel 2007 (which is 32 bit)  on a 64 bit Windows you may need to replace the 64 bit version of dll with the 32 bit version required by Excel 32,

hoping this helps to solve the problem,

Paolo

### #22 KhuramB

KhuramB

Brand New Member

• Members
• 3 posts

Posted 01 October 2013 - 03:27 AM

dear PaoloPemi,

I am using Microsoft Excel 2007 in windows xp and the prode properties package is working but my question was that I am unable to use prode macros like this "macro=PfTF(1,B1,0,1,1)" because I dont know how to include ppp.vba file in Excel. Which is also mentioned in Manual to include properties.vba file in Excel but it is not mention how to include it.

Khuram

### #23 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 01 October 2013 - 08:37 AM

dear Khuram,

to use the macros in Excel you need to install the properties.xla file,

this file instructs Excel about the calling conventions and required parameters of each method in PRODE PROPERTIES library,  As said, there are two versions of properties.xla.  One is good for 32 bit versions of Excel

and one for 64 bit versions,

you'll find these files under directories Excel\32 and Excel\64.  You need only to open properties.xla,  this adds a specific menu for PRODE PROPERTIES, too

Once you'll have the file installed PRODE PROPERTIES works as an add-on to Excel and you'll be to access all PROPERTIES macros as well as other Excel macros

Paolo

### #24 KhuramB

KhuramB

Brand New Member

• Members
• 3 posts

Posted 01 October 2013 - 10:16 AM

dear Paolo,

I have installed the properties.xla and already followed the procedure. I am able to use edit properties, open archives and save archives but the problem I am facing is to use macros because when I type this "macro=PfTF(1,B1,0,1,1)" on Excel cell. Excel do not recognize it as macros it deals it as text. Thats why I asked that how I can enable the prode macros. So could you please help me out on this. Thanks.

Khuram

### #25 PaoloPemi

PaoloPemi

Gold Member

• Members
• 500 posts

Posted 01 October 2013 - 10:38 AM

Khuram,

1) install the file properties.xla following the procedure discussed in operating manual

3) select the Edit Properties menu to define a stream and operating conditions

(by the way you can do those operations also with macros)

4) at this point enter

= StrH(1)

in a Excel cell and you should obtain the total enthalpy for stream 1

Paolo

Edited by PaoloPemi, 01 October 2013 - 10:42 AM.