# Real Gas EOS - Departure Functions

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 15, 2017, 02:20 Real Gas EOS - Departure Functions #1 New Member   VinhNDX Join Date: Jul 2017 Posts: 5 Rep Power: 7 Dear all, I am implementing the real gas equation of state JWL into OpenFoam. According to the code structure of OF, the departure functions for enthalpy, entropy, Cp,... must be calculated. I used the formulas and followed the procedure for Peng Robinson EOS in the book "Introductory Chemical Engineering Thermodynamics" to compute the values in the JWL case. But the value for entropy departure function is infinity, so I think the formulas may not be general enough. Could you please give me some guidance or relating theory and experience in computing the departure functions for real gas EOS ? Thank you very much. Last edited by vegito87; September 15, 2017 at 04:10.

 September 18, 2017, 05:34 #2 New Member   VinhNDX Join Date: Jul 2017 Posts: 5 Rep Power: 7 Can anyone having experience in adding a new equation of state give me some advice ? I thought it is just easy as adding a new equation to calculate the pressure from density, temperature and other parameters, but it turns out in OF there are more things to do related to departure functions.

 September 19, 2017, 14:27 #3 Senior Member   Join Date: Oct 2013 Posts: 397 Rep Power: 17 I'm interested in this as well, but haven't looked much into it. Given arbitrary functions rho(p,T), h(p,T), what needs to be done?

September 19, 2017, 23:11
#4
New Member

VinhNDX
Join Date: Jul 2017
Posts: 5
Rep Power: 7
Quote:
 Originally Posted by chriss85 I'm interested in this as well, but haven't looked much into it. Given arbitrary functions rho(p,T), h(p,T), what needs to be done?
Hi Chriss,

Thanks for your comment. What I am trying to do is to get the departure functions which required in the OF code structure for enthalpy h(p,T), entropy s(p,T), specific heat constant Cp(p,T),... from equation of state p = p(rho, T).

Actually, the eos JWL is in the form p = p (rho, e) with e is the specific internal energy, but for simplicity, I am working with its simplified form p = p (rho, T). So, I need to know more about the general formula which can be used to calculate the departure functions.

May 12, 2019, 10:58
#5
Senior Member

A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 10
Quote:
 Originally Posted by vegito87 Hi Chriss, Thanks for your comment. What I am trying to do is to get the departure functions which required in the OF code structure for enthalpy h(p,T), entropy s(p,T), specific heat constant Cp(p,T),... from equation of state p = p(rho, T). Actually, the eos JWL is in the form p = p (rho, e) with e is the specific internal energy, but for simplicity, I am working with its simplified form p = p (rho, T). So, I need to know more about the general formula which can be used to calculate the departure functions.
Dear VinhNDX,

I want to do the same! (add JWL EOS). know I have the same problem:
I don't know how can I calculate h, s, cp, cpMcv, Z. could you please help me if you found the solution?

Do I have to change the "correct", "he", "pThermo", ... functions?

I'm really appreciate if you answer me.
Regards

May 14, 2019, 04:23
#6
New Member

VinhNDX
Join Date: Jul 2017
Posts: 5
Rep Power: 7
Quote:
 Originally Posted by alimea Dear VinhNDX, I want to do the same! (add JWL EOS). know I have the same problem: I don't know how can I calculate h, s, cp, cpMcv, Z. could you please help me if you found the solution? Do I have to change the "correct", "he", "pThermo", ... functions? I'm really appreciate if you answer me. Regards

Hi alimea,

At first, I have tried to develop the whole real gas model by deriving the departure functions for enthalpy, entropy,..., based on its formula. However, it is quite difficult for me. Therefore I decided to add JWL equation just for recalculating the pressure once we have solved for other parameters which also gave quite good results.

Regards,
Vinh

May 14, 2019, 04:27
#7
Senior Member

A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 10
Quote:
 Originally Posted by vegito87 Hi alimea, At first, I have tried to develop the whole real gas equation by deriving the departure functions for enthalpy, entropy,..., based on its formula. However, it is quite difficult for me. Therefore I decided to add JWL equation just for recalculating the pressure once we have solved for other parameters which also gave quite good results. Regards, Vinh
Dear Vinh,
How can I find the formula of departure functions for enthalpy, entropy,...?
can you introduce a web page, paper, etc?

I didn't get this sentence: "Therefore I decided to add JWL equation just for recalculating the pressure once we have solved for other parameters which also gave quite good results."

Regards,
Alimea

May 14, 2019, 04:42
#8
New Member

VinhNDX
Join Date: Jul 2017
Posts: 5
Rep Power: 7
Quote:
 Originally Posted by alimea Dear Vinh, Thanks for your reply. How can I find the formula of departure functions for enthalpy, entropy,...? can you introduce a web page, paper, etc? I didn't get this sentence: "Therefore I decided to add JWL equation just for recalculating the pressure once we have solved for other parameters which also gave quite good results." Regards, Alimea

Hi Alimea,

The formula for departure functions could be found in some documents/books related to real gas model. They are the difference between perfect and real gas parameters. Please google it. Or you can read the implementation of other real gas models for reference in OF source code of Thermophysical Models, such as Peng-Robinson.

I modified OF solver by adding a seperate JWL equation for recalculating pressure after solving other parameters. The procedure is similar to "How to add temperature to icoFoam":

HTML Code:
`https://openfoamwiki.net/index.php/How_to_add_temperature_to_icoFoam`

My work was not good enough, so good luck for your work.

Regards,
Vinh

May 14, 2019, 04:44
#9
Senior Member

A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 10
Quote:
 Originally Posted by vegito87 Hi Alimea, The formula for departure functions could be found in some documents/books related to real gas model. They are the difference between perfect and real gas parameters. Please google it. Or you can read the implementation of other real gas models for reference in OF source code of Thermophysical Models, such as Peng-Robinson. I modified OF solver by adding a seperate JWL equation for recalculating pressure after solving other parameters. The procedure is similar to "How to add temperature to icoFoam": HTML Code: `https://openfoamwiki.net/index.php/How_to_add_temperature_to_icoFoam` My work was not good enough, so good luck for your work. Regards, Vinh

Ok, Thank you.

 October 30, 2019, 12:30 JWL implementation | blastFoam solver release #10 Member   Peter Join Date: Feb 2015 Location: New York Posts: 73 Rep Power: 9 Hi, Yes, we have just released a new solver (blastFoam) which includes the JWL equation of state (an extensions to model afterburn), as well as several other useful and interoperable equations of state (e.g. ideal gas, stiffened gas, tait, cochran-chan, van der waals, JWL), flux schemes (HLLC, AUSM+, Kurganov/Tadmor), and multiple examples/tutorial cases. You can get the code/source here: https://github.com/synthetik-technologies/blastfoam Hope this helps! Peter Vonk Synthetik Applied Technologies

November 2, 2019, 05:40
#11
Senior Member

A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 10
Quote:
 Originally Posted by opedrofunk Hi, Yes, we have just released a new solver (blastFoam) which includes the JWL equation of state (an extensions to model afterburn), as well as several other useful and interoperable equations of state (e.g. ideal gas, stiffened gas, tait, cochran-chan, van der waals, JWL), flux schemes (HLLC, AUSM+, Kurganov/Tadmor), and multiple examples/tutorial cases. You can get the code/source here: https://github.com/synthetik-technologies/blastfoam Hope this helps! Peter Vonk Synthetik Applied Technologies

Dear Peter,

Thank you for sharing your solver. I will compile it, and test it for my case, and give you a feedback.
It is mentioned that it works with OF v7. Can I compile it on OF V4 or V2.3.1?

regards,
Ali

 Tags jwl, real gas model