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

Depressurization: Calculation Basis


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

#1 Dacs

Dacs

    Gold Member

  • Members
  • 457 posts

Posted 28 April 2013 - 10:35 PM

Hi guys!

 

I'm currently working on an Excel spreadsheet that does depressurization calculation.

 

I've managed to incorporate these so far in the spreadsheet:

1. Flowrate across an orifice (for subsonic and choked flow)

2. Adiabatic expansion inside the vessel.

 

With that said, the spreadsheet is able to calculate for the required orifice area or the vessel final pressure (given the proper needed data).

 

#1 is kinda straightforward so there's little difficulty dealing with but as for #2, this is where some issue lie, but let me discuss how I did my calculation:

1. Since I employed a numerical approach, I set a certain time step (del_t) and calculate the required mass flow across the nozzle (m) and then I calculate its corresponding volume flow (Qm) and then subtract this from the vessel inventory (Q-Qm*del_t) at the prevailing pressure (P1). With those info at hand, I do the adiabatic expansion calculation (from Q-Qm*del_t to Q, which is the vessel volume) and calculate the corresponding P2 and T2 from it.

2. I used compressibility factor (Z) and ratio of Cp/Cv (k) to do the adiabatic expansion calculation (at initial vessel conditions)

3. I have not included heat losses in the calculation (not yet anyway)

 

I ran the spreadsheet in comparison with what Hysys depressurizing utility produces and while I was able to get a somewhat similar result (within 5%) with it, there are fluids (such as propane) that behaves erratically (final vessel temperature in particular). I suspect the non-ideal behavior of ethane comes into picture.

 

So for the questions:

1. Is my method in #1 reasonable? Because I can also do the subtraction of inventory on mole basis and back calculate P and T from it, though how it fits in adiabatic expansion isn't that clear (at least for me).

2. I think I hit a brick wall on how I do my adiabatic expansion calculation since I basically treat it as an expansion of ideal gas. So I plan on doing calculation based on EOS (I already implemented Peng-Robinson in the spreadsheet) and do the adiabatic expansion using EOS.

 

Since it's been a while since I dealt with it, my understanding is that for an adiabatic expansion, your entropy remains the same and the work done by expansion (is it PdV?) is absorbed by the change in enthalpy.

 

So basically, I need to calculate the initial enthalpy H1 and entropy S1 and knowing delS=0, I can back calculate H2 using S1, and thus the temperature. And I presume that P2 will be tied up in this calculation (since H depends weakly on P).

 

Is that right? Basically I want to ask for a nudge in the right direction on how to make this work.

 

Thanks!



#2 PaoloPemi

PaoloPemi

    Gold Member

  • Members
  • 550 posts

Posted 29 April 2013 - 01:09 AM

altough my software (Prode Properties) has a specific Excel Macro for calculating vessel depressurization I prefer the direct approach in Excel + VBA with numerical integration at defined time steps,

it's something not too different from your approach but I prefer to use the library for process calc's,

to model the BDV valve + orifice I utilize the constant energy flash EPF() method which solves

 

hin+1/2*vin^2 = ho+1/2*vo^2

 

where in and out are inlet and outlet H and V

 

then in each time step I subtract the mass discharged and since I know the contribute of vessel walls I can correct H, internal volume is constant so I am  able to solve t, p, w

As said I use Excel but all calc's are done by Prode Properties library,

of course the procedure works for vessels filled with liquid, liquid+gas and gas only.

 

In you case, to obtain accurate results (for fluid conditions inside vessel), you can adopt a EOS approach and a very limited time step,

with a limited time step (and/or use of derivatives to correct errors) simple procedures can produce results somewhat equivalent to the procedure described,

however a more complex approach is required to predict the wall's temperature in contact with gas or liquid,

you should consider fluid properties, velocities etc. not an easy task.


Edited by PaoloPemi, 29 April 2013 - 02:49 AM.


#3 chemsac2

chemsac2

    Gold Member

  • ChE Plus Subscriber
  • 119 posts

Posted 29 April 2013 - 10:29 AM

Dacs,

 

I had done mole balance calculation which is alternative to your method based on volume outflow. Based on moles outflow in a given timestep, I calculated new moles. With P1, T1, n2 and system volume, objective is to calculate P2 and T2. Two equations in the form of gas law (P2*V=n2*Z2*R*T2) and adiabatic expansion equation given below can be solved for two unknowns P2 and T2.

 

T2/T1 = (P2/P1)^((k-1)/k))

 

I could predict pressure and temperature profile correctly for first few time steps. But as blowdown progressed, HYSYS predicted pressure and calculated pressure differed significantly leading to errors in temperature.

 

Few sources of error I could of think of are:

  • Use of Cp/(Cp-R) as isentropic coefficient gives positive error (Pcalc/P-HYSYS > 1 and Tcalc-T-HYSYS > 0), while actual Cp/Cv from HYSYS gives negative deviations.
  • Error in pressure gives rise to error in temperature. Error in pressure is probably due to inability of Z in describing gas deviation from ideal gas law. HYSYS uses EOS and hence Z is not an input, but an output. My thoughts on this are not yet crystallised, but I feel this needs to be looked into.
  • Liquid forms some time into blowdown and then isentropic assumption is no longer valid.

Hope this helps. If you succeed in figuring out correct cause of this discrepancy, I would be interested in knowing.

 

Regards,

 

Sachin



#4 Dacs

Dacs

    Gold Member

  • Members
  • 457 posts

Posted 29 April 2013 - 06:08 PM

Thanks for the replies.

 

I have not considered vessel wall effects nor heat losses to the environment (have to make the adiabatic expansion work first :P ). I'll do that later once I sorted this out though.

 

Also, I have not considered the vessel content at dew point (will drastically affect the methodologies involved), but also will consider it later.

 

then in each time step I subtract the mass discharged and since I know the contribute of vessel walls I can correct H, internal volume is constant so I am  able to solve t, p, w

I have not thought of this, not yet anyway since I try to avoid H and S calculations, but it seems this is the most logical step to do. Will try this later.

 

I had done mole balance calculation which is alternative to your method based on volume outflow. Based on moles outflow in a given timestep, I calculated new moles. With P1, T1, n2 and system volume, objective is to calculate P2 and T2. Two equations in the form of gas law (P2*V=n2*Z2*R*T2) and adiabatic expansion equation given below can be solved for two unknowns P2 and T2.

I tried this approach and it didn't differ in what I did. I think it's essentially the same.

 

Use of Cp/(Cp-R) as isentropic coefficient gives positive error (Pcalc/P-HYSYS > 1 and Tcalc-T-HYSYS > 0), while actual Cp/Cv from HYSYS gives negative deviations.

I think it's more than that because I coded PR in my spreadsheet to calculate Z and k (Cp/Cv) and it still grossly missed the final temperature. I think the idea of using PV^k=constant doesn't hold up at all in high pressure system and we have to resort to a more general approach (like using changes in enthalpy and fixing the entropy at 0 in adiabatic expansion).

 

I'm brushing up my thermodynamics and trying to look at the problem from the outside. So far, I was able to get the required H and S (from PR departure functions, which is such a PITA since it slows down VB considerably) and I'll attempt to do an adiabatic expansion calculation from there.


Anyway, what I'm planning to do is for a certain time step (I use del_t=0.5 s) and reduced volume (Vessel volume - what came out of the vessel), I'll get the work to be done by the fluid in expanding from the reduced volume to the original vessel volume (is it really P*delV?), with that, I'll calculate the change in enthalpy, and that'll give me the final temperature. With that, I'll set delS=0 and calculate the required pressures.

 

Thanks for the input again :)



#5 Dacs

Dacs

    Gold Member

  • Members
  • 457 posts

Posted 03 May 2013 - 01:52 AM

Success! I was able to do my spreadsheet that matches very closely with what Hysys produces :D

 

Just for the benefit of other people who might be planning on doing this in the future, it took me these things to make it work:

1. Code Peng-Robinson to calculate for the state properties (such as P, T, Z and S)

2. Produce an equation to calculate for Ideal Heat Capacity (Cp0) by either using equations available at literature or doing regression analysis for Cp taken at different temperatures (I did the latter)

3.Do an entropy balance (specifically set delS=0 for adiabatic expansion) to calculate for new P and T. Of course this won't apply if you consider heat effects (I'll do this later on).

4. Make sure that you maintain mass balance for each time step. In short, you have to adjust your P to match the remaining inventory on your vessel (it took me a while to realize this and I almost gave up on the spreadsheet altogether) after doing #3.

 

:)



#6 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 03 May 2013 - 10:51 AM

So, why did you do all of this when you have HYSYS readily available?

Bobby



#7 Dacs

Dacs

    Gold Member

  • Members
  • 457 posts

Posted 05 May 2013 - 05:29 PM

I have my reasons, let's put it at that :)






Similar Topics