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

Phase Envelope In Excel 2010

phase diagram excel prode envelope liquid vapor

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

#1 mrbabu

mrbabu

    Gold Member

  • Members
  • 55 posts

Posted 08 January 2013 - 12:45 PM

I wish to calculate the phase envelope for different mixtures of hydrocarbons + water including different line fractions,
Prode Properties has a Excel page to calculate vapor-liquid-liquid diagrams,
the page allows to print the bubble line, dew line plus a line with specified phase fraction,
with water the procedure correctly shows as bubble line a vapor-liquid-liquid equilibrium line,
plus the line with specified phase fraction and the water dew line (see attached image)
For my application I need to calculate at least three lines with specified phase fractions,
say 0.25 , 0.5, 0.75
how should I proceed ?

Attached Files


Edited by mrbabu, 08 January 2013 - 05:21 PM.


#2 marchem

marchem

    Gold Member

  • Members
  • 153 posts

Posted 08 January 2013 - 02:47 PM

differently from other simulators Prode integrates directly with Excel or Matlab,
you have access to all the methods in the library and can modify almost everything by program,
this gives great flexibility and I really appreciate this feature,

in the specific if you look inside the Excel page, VBA code you'll find
this little piece of code

' Original VBA code (prints one line with specified phase fraction)
nrpt = PFLine(stream, 1, pf, pt(0), pp(0), 51)
' nrpt is the effective number of calculated points
ri = 15
For i = 0 To nrpt - 1
Cells(ri + i, ci) = pt(i)
Cells(ri + i, ci + 1) = pp(i)
Next i

here the code calls the method PFLine in the library for calculating the line with specified state and phase fraction
the remaining stuff is the code to write on Excel Cells

you can easily modify this code for including more than one line with specified state and phase fraction

' Modified VBA code (prints three lines with 0.25,0.5,0.75 liq. molar fractions)
pf = 0
For ii = 0 To 2
pf = pf + 0.25
nrpt = PFLine(stream, 1, pf, pt(0), pp(0), 51)
' nrpt is the effective number of calculated points
ri = 15
For i = 0 To nrpt - 1
Cells(ri + i, ci + 2 * ii) = pt(i)
Cells(ri + i, ci + 2 * ii + 1) = pp(i)
Next i
Next ii

I have added the first For (For ii = 0 To 2) to calculate three lines as you wish,
very simple.

Remember to define properly the settings (see the operating manual) ,
these are available under the Tab Models in Properties Editor,
for example you may decide to
-print vapor-liquid; vapor-liquid-liquid; vapor-liquid-solid diagrams
-print all calculated points or stop when crossing dew or bubble lines (default)
-validate points (default) or not etc.

remember that a phase diagram is complex to calculate and may take a lot of time to complete if you add many lines,
you may test different possibilities as for example print all calculated points to see how the phase diagram appears before to customize on your needs.

Edited by marchem, 08 January 2013 - 03:03 PM.


#3 mrbabu

mrbabu

    Gold Member

  • Members
  • 55 posts

Posted 08 January 2013 - 05:16 PM

thank you !
Does the method PFLine all the work for calculating a line with specified phase fraction ?

#4 marchem

marchem

    Gold Member

  • Members
  • 153 posts

Posted 09 January 2013 - 10:58 AM

I utilize method PFLine in that way,

Prode exposes several methods which you can access from Excel or Matlab,
these are discussed in paragraph "Methods for calculating equilibrium lines in phase diagrams" in Operating Manual,

herebelow the description of PFLine
integer nrpt = PFLine(integer stream,double pf, double *P, double *T, int maxpt)
Given a stream, a state, a specified phase fraction and two arrays (0-maxpt elements) the procedure returns nrpt < maxpt
equilibrium points in specified phase fraction line

the above is C/C++ syntax but you can use different languages as VBA, C#, VB-Net, FORTRAN etc.

#5 mrbabu

mrbabu

    Gold Member

  • Members
  • 55 posts

Posted 14 January 2013 - 11:06 AM

thanks,
the VBA code works very well,
I do not understand the option (which you mention) about stopping the specified phase fraction line when near the dew (or bubble) line, is not that by default?

#6 marchem

marchem

    Gold Member

  • Members
  • 153 posts

Posted 17 January 2013 - 03:05 AM

mrbabu,
yes, the option of stopping a line with specified phase fraction when crossing dew or bubble line is the default,
there are cases within a vapor-liquid-liquid area where bubble line (a liquid-liquid-vapor line) and a line with specified phase fraction (say a line with specified liquid fraction = 0.9) are very close,
an example is the mixture
C1 0.7
CO2 0.15
H2S 0.15
with Soave Redlich Kwong or Peng Robinson packages
if you choose to stop the line with specified liquid phase fraction 0.9 then the procedure will not calculated the line,
to see the line you have to deselect that option

#7 Guest_mdepeche_*

Guest_mdepeche_*
  • guestGuests

Posted 21 February 2013 - 12:27 PM

for that composition

C1 0.7

H2S 0.15

CO2 0.15

the vapor-liquid-liquid phase envelope utility available in Prode Properties calculates a very narrow three phase vapor-liquid-liquid area (see the image),

is that correct ?

Attached Files



#8 marchem

marchem

    Gold Member

  • Members
  • 153 posts

Posted 22 February 2013 - 12:15 PM

the vapor-liquid-liquid phase envelope utility of Prode Properties shows for that mixture two vapor-liquid-liquid areas,

see also the three phase line starting at about 155K (1 Bar),

generally when I wish to verify some results I calculate a series of isothermal flash (in this case with multiphase option activated),

you may follow the same way.



#9 Guest_mdepeche_*

Guest_mdepeche_*
  • guestGuests

Posted 18 March 2013 - 07:42 AM

do you know how to redefine the enthalpy and entropy values (base values) in P-H , P-S diagrams created with Prode Properties ?

Attached Files



#10 marchem

marchem

    Gold Member

  • Members
  • 153 posts

Posted 21 March 2013 - 05:25 AM

mdepeche,

 

in Prode properties you can define your own base values for enthalpy and entropy calcs,

to do that go to Settings dialog (see attached image enthapy_entropy_basevalues.jpg)

 

in Base values for enthalpy calc you can select


-specified value and temperature
or
-enthalpy of formation in database

 

if you have selected specified value and temperature
then you can define a initial temperature and initial value for enthalpy


(integration starts from initial temperature with enthalpy = initial value)

 

in a similar way you can define the base values for entropy calc's

Attached Files



#11 mrbabu

mrbabu

    Gold Member

  • Members
  • 55 posts

Posted 12 April 2013 - 05:10 AM

thanks Marchem,

are the P-H, P-S, P-V (or T-H, T-S, T-V) diagrams calculated by Prode Properties based on p,t,compositions of phase envelope?



#12 PaoloPemi

PaoloPemi

    Gold Member

  • Members
  • 549 posts

Posted 23 April 2013 - 11:02 AM

>are the P-H, P-S, P-V (or T-H, T-S, T-V) diagrams calculated by Prode Properties based on p,t,compositions of phase envelope?

 

yes,

the procedure calculates those properties at the different equilibrium points in phase envelope,

with the advantage that one can easily draw

P-H, P-S, P-V etc. diagrams

in addition, since the properties are calculated at the same p,t,w, conditions

you can correlate H,S,V and draw complex diagrams in Excel or Matlab


Edited by PaoloPemi, 23 April 2013 - 11:31 AM.


#13 mrbabu

mrbabu

    Gold Member

  • Members
  • 55 posts

Posted 07 May 2013 - 02:19 AM

thanks to your help I am able to create phase diagrams with Prode in both Excel and Matlab,

still I have some doubts about settings,  

for example for mixtures with large amounts (mol fract > 0.5) of water,

the procedure calculates the vapor-liquid-liquid phase diagram

but I see (very) different results selecting different EOSs,

which are the optimal settings for these cases ?



#14 PaoloPemi

PaoloPemi

    Gold Member

  • Members
  • 549 posts

Posted 22 May 2013 - 03:08 AM

it's really difficult to answer this question,

although Prode Properties can include many packages including GERG, EOS with complex mixing rules, CPA, SAFT  etc.

I am not aware of a model in literature that gives entirely successful results with those mixtures (HC + Water > 50% mol.fract.),

I fear that you must accept the limits of each model in this area of application.



#15 Guest_mdepeche_*

Guest_mdepeche_*
  • guestGuests

Posted 03 June 2013 - 01:45 AM

when calculating vapor-liquid-liquid phase envelope (see the test case in my previous post)

with Excel in union with 32 or 64 bits versions of PRODE PROPERTIES

I noticed that the number of points calculated for additional (2nd) liquid phase

may be slightly different in 64 and 32 bits version while numerical values are the same,

does this mean that I have to change some settings in the software ?


Edited by mdepeche, 03 June 2013 - 01:46 AM.


#16 marchem

marchem

    Gold Member

  • Members
  • 153 posts

Posted 04 June 2013 - 11:49 AM

I have noticed a similar behaviour (i.e. some difference in the number of points calculated for 2nd liquid phase in 32 and 64 bit versions),

I guess that since the code has been probably optimized for speed

depending from the resources (CPU, memory) allocated for that process (which may differ in different installations)

some equilibrium points which require many calc's are not included

(i.e. the procedure exits before to complete),

according my experience the 64 bits version shows a significant improvement in speed of execution,

which is useful working with Excel....



#17 Guest_mdepeche_*

Guest_mdepeche_*
  • guestGuests

Posted 14 June 2013 - 03:07 AM

thanks Marchem,

that confirms my observations based on tests in two computers,

since there are different resources available (on each computer) that could be the reason.



#18 PaoloPemi

PaoloPemi

    Gold Member

  • Members
  • 549 posts

Posted 28 June 2013 - 02:04 AM

I see a similar behaviour in my computers,

the same problem may require more or less time to converge depending from resources (CPU speed, RAM installed, other programs running etc.) available for that task.



#19 mrbabu

mrbabu

    Gold Member

  • Members
  • 55 posts

Posted 15 July 2013 - 03:08 PM

I noticed that calculated phase envelope (with mixtures of hydrocarbons + water) may be very different  if I set standard or extended versions of Peng Robinson or Soave, 

also I see that PRODE has a default value of 0.5 as BIP for water-hydrocarbons, 

is that value good for both standard and extended EOS or should I define different values?



#20 PaoloPemi

PaoloPemi

    Gold Member

  • Members
  • 549 posts

Posted 19 August 2013 - 07:55 AM

no,

according some tests with Peng Robinson Extended (or Soave) values about 0.1-0.2 are required for Kij with water-light hydrocarbons,

as said on a different thread the value 0.5 could be ok for standard Peng Robinson (or Soave),

not for extended versions,

however, since PRODE PROPERTIES includes a VLE data regression procedure if you have access to some experimental VLE data you can calculate these BIPs.



#21 mrbabu

mrbabu

    Gold Member

  • Members
  • 55 posts

Posted 23 September 2013 - 07:17 AM

Paolo, considering the limits of Van der Waals mixing rules with Soave and Peng Robinson models for water-hydrocarbons would you recommend to use constant BIP or temperature dependent BIP ?

#22 marchem

marchem

    Gold Member

  • Members
  • 153 posts

Posted 24 September 2013 - 05:53 AM

my experience with temperature dependent BIPs in PRODE PROPERTIES
is that they allow to fit also VLE points where
the standard Kij-Lij pair doesn't work well,

for example I have been able with Soave and Peng-Robinson to get
very limited errors for water-ammonia and water-ethanol VLE points.

One thing that I would consider carefully before to
set temperature dependent BIPs is that these values
must be suitable for the whole range of temperatures
in your application,

you may calculate temperature dependent BIPs from
a relatively large number of points to cover
the range of temperatures in a phase envelope,
or reduce the influence of temperature dependent
parameters
(PRODE PROPERTIES allows up to two temperature dependent
BIPs on each binary pair)
to avoid wrong results.

Edited by marchem, 24 September 2013 - 05:54 AM.


#23 PaoloPemi

PaoloPemi

    Gold Member

  • Members
  • 549 posts

Posted 27 September 2013 - 01:27 AM

Marchem is correct,

 

temperature dependent BIPs should be utilized

with care for a extended range ot temperatures as in phase envelopes,

 

an example is water-methane,

with Soave Redlich Kwong  (or Peng Robinson)

and the four BIPs (2 temperature dependent)

available in PRODE PROPERTIES

 

you can fit well experimental VLE data points

such as the dew points available in literature

with the data regression utility available

in PRODE PROPERTIES,

for example you can fit almost exactly

results from ISO 18453 and other

standards,

 

however you should  verify that

temperature dependent BIPs have

acceptable values in the whole range

of application to avoid wrong results,

that will depend mainly from

the range of temperatures of

VLE points which you provide

as input to the data regression utility.


Edited by PaoloPemi, 27 September 2013 - 01:31 AM.


#24 mrbabu

mrbabu

    Gold Member

  • Members
  • 55 posts

Posted 17 October 2013 - 05:24 AM

thanks Marchem and Paolo, very good answers, I did some tests and I can confirm that both Extended Peng Robinson and Extended Soave Redlick Kwong with temperature dependent BIPs do indeed a good job for water-methane equilibria, I wonder if temperature dependent BIPs are available for binaries hydrocarbons-Glycols, could you suggest some sources?

#25 PaoloPemi

PaoloPemi

    Gold Member

  • Members
  • 549 posts

Posted 04 November 2013 - 04:34 AM

PRODE PROPERTIES includes temperature dependent

BIPs for water-glycol,

I do not know if there are good sources for HC-Glycols VLE data,

have you access to DDB and GPA ?






Similar Topics