Peng Robinson EOS

Peng Robinson EOS - Messages

#21 Posted: 5/29/2016 2:25:37 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote

But this is in some of your new files. Please re-download what you've posted here.

In the last screenshot, where you do re-define T and P as vectors after defining T.air and P.air, the T:=0 and P:=0 are redundant.



You're right, uploaded file have T.air P.air duplicated, and not the couples T, T.air P, P.air. That's my bug. Another one, I go to win a big server.

Alvaro.
#22 Posted: 5/29/2016 2:38:24 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

There are not "not yet implementing" or bug in CoolProp. If can't work in this region is because is very difficult to solve the inversion: For each enthalpy there are two valid temperatures in the phase line. Which make unstables (when not imposible) some algorithms. For this case the system can't be determined with the usual two intensive or extensive properties states, and need 3 or, inside the region, one intensive an the quality. See the attached diagram.

Or here, the diagrams for PR in mathcad: https://www.ptcusercommunity.com/message/424574#424574

Best regards.

Alvaro.

ait_T-s.gif
#23 Posted: 5/29/2016 3:00:15 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

scrH49.png

MassAndEnergyInCV_Mike.sm (20 KiB) downloaded 35 time(s).

Edit: I see that the air flows outside the tubes; however, the said holds true: the pressure drop across the starting and ending points cause air flow; this pressure drop may be ignored for the task. The losses that are ignored here, constitute much higher indeterminacy.
С уважением, Михаил Каганский
1 users liked this post
Alvaro Diaz Falconi 5/29/2016 4:43:00 AM
#24 Posted: 5/29/2016 4:44:48 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Yes, thanks, that's correct. Can be obtained also with mixing models: IG for air, steam props for water.

Best regards.

Alvaro.

air_ig.gif
#25 Posted: 5/29/2016 4:57:09 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

scrH50.png

Edit: I'm sorry, uploaded some utter garbage. Updated file.
Air in piston-cylinder with stops.sm (16 KiB) downloaded 49 time(s).
С уважением, Михаил Каганский
#26 Posted: 5/29/2016 11:47:57 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

... read a bit more in the work sheet.

Forum PR_EOS.gif


PR EOS.sm (44 KiB) downloaded 45 time(s).

#27 Posted: 5/30/2016 5:27:27 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

PR_work_Mike.sm (41 KiB) downloaded 53 time(s).

Please notice that you had some errors, particularily in calculation of L.
С уважением, Михаил Каганский
#28 Posted: 5/30/2016 6:11:01 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Thanks Mike. I go to check. In my version (0.98 5935) there are some "Sintaxis incorrecta" errors from your attach.

Best regards.

Alvaro.
#29 Posted: 5/30/2016 6:16:04 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Oh, I suppose these are assignments of variables in vectors:
http://en.smath.info/forum/yaf_postst7476_SMath-Studio-0-98-5953--19-April-2016.aspx
С уважением, Михаил Каганский
#30 Posted: 5/30/2016 11:56:58 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Please notice that you had some errors, particularily in calculation of L.



Too much for a monday morning, but most interesting the global collection.
Sure L ia a problem: denominator is complex. That kind of gigantic project
must be first constructed modular and sanity checked to extremas.

Why zillions of gyzmas #####... If they do nothing, why should they do ?

Jean

PR_comments.sm (25 KiB) downloaded 43 time(s).

#31 Posted: 5/30/2016 6:36:22 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

PR_work_Mike2.sm (48 KiB) downloaded 48 time(s).

Take into account ref point's h and s non-zero values.
+Some refactoring

This is meant to be some framework.
To test, the specific reference to Peng-Robertson formulation used is required, because there are quite a number of those in literature.
С уважением, Михаил Каганский
#32 Posted: 5/30/2016 7:22:33 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote

PR_work_Mike2.sm (48 KiB) downloaded 48 time(s).

Take into account ref point's h and s non-zero values.
+Some refactoring

This is meant to be some framework.
To test, the specific reference to Peng-Robertson formulation used is required, because there are quite a number of those in literature.



Hi Mike. For this is put images from RefProp about the ref states. Hysys use another method, and have H(T), gibss free energy and vapor pressure constants which uses in conjuntion with the PR EOS.

Attached, a table with some other values for critical values and Cp of ideal gas.

Righ now have not to much time to analyze your file (and probably need to install other version, because give me errors).PR.zip (35 KiB) downloaded 34 time(s).

Best regards.

Alvaro.

PR.zip (35 KiB) downloaded 34 time(s).
#33 Posted: 5/30/2016 7:37:19 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Alvaro,

I didn't meant numbers, I meant formulas.
Literature gives a number of various flavours of Peng Robinson's. They differ slightly in their coefficients, and organization of calculations (although give similar results). I don't mean "enhanced" versions. So, to truly check your implementation (which mine is based upon), I asked for source of your formulas.
С уважением, Михаил Каганский
#34 Posted: 5/30/2016 10:47:32 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote

Alvaro,

I didn't meant numbers, I meant formulas.
Literature gives a number of various flavours of Peng Robinson's. They differ slightly in their coefficients, and organization of calculations (although give similar results). I don't mean "enhanced" versions. So, to truly check your implementation (which mine is based upon), I asked for source of your formulas.



Ah. I provide that for set some others compounds for check. Sources are: my version in mathcad: https://www.ptcusercommunity.com/message/424574#424574 , Carl Lira excel's http://www.egr.msu.edu/~lira/computer/EXCEL/PREOS.XLS , ascend4: http://ascend4.org/PengRobinson_EOS_in_FPROPS hysys documentation (from version 2 to 8) and Cengel book: Thermodynamics.

Hysys folloy they own rules, ASHRAE are hard to implement. RefProp documentation have some information about the ref states: http://www.nist.gov/srd/nist23.cfm

Best regards.

Alvaro.

hysys_propane.gif
#35 Posted: 5/30/2016 11:29:16 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Some notes: what in the literature is alpha^2, in my ws is alpha. Phi isn't the fugacity, which is evaluated as f=P*exp(L). Is the conclusion of take the phrase "minimun fugacity provide most stable z", i.e. the manipulation for obtain the simplest expression which minimize f (hope errorless). Remember that in the mixture phase region, T,P are not independent variables, this is, with T,P only can't determine the thermodymamic state. You must to provide another information, like other state variable or the quality (x). For this reason is why I output only one z: which minimize the fugacity. If for any state you output two z I guess that is useless, that´s only for mixture phases region and in that case can´t use T and P, must to use (in the practice) x.

In my mathcad ws (not implemented yet in smath) I output also for vf, hf, uf, sf, vg, ... etc (f liquid phase, g vapor, in german). This is equivalent to f for x=0, g for x=1. I use Lee-Kesler eq for get the aproximate point in the change phase line, and root for the value, but I'm not convinced of this.

Best regards.

Alvaro.
#36 Posted: 5/31/2016 1:21:30 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Oh ! Alvaro: you are "grand savant" in that stuff.
Can't help, just good at making maths work in Smath.
In the attached, is as far as I can go [primer Edu.]

Jean

PR EOS.sm (125 KiB) downloaded 54 time(s).


1 users liked this post
Alvaro Diaz Falconi 5/31/2016 3:38:00 AM
#37 Posted: 5/31/2016 3:39:21 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

vf, hf, sf added.
Regards.
Alvaro.PR2.sm (138 KiB) downloaded 71 time(s).
  • New Posts New Posts
  • No New Posts No New Posts