CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Real Gas EOS

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

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2012, 09:46
Default Real Gas EOS
  #1
Member
 
Francesco Capuano
Join Date: May 2010
Posts: 81
Rep Power: 15
francesco_capuano is on a distinguished road
Hi everybody,

I would like to implement a real-gas equation of state (e.g. Peng-Robinson).
In a very old thread,

http://www.cfd-online.com/Forums/ope...eal-gases.html

some general tips were given; however, any further suggestions (particularly for OpenFOAM 2.0.x or 2.1.x) would be greatly appreciated. Besides, I was wondering if there are any already implemented versions of real-gas EOS which are available on the web.

Thanks in advance.
Francesco
immortality likes this.
francesco_capuano is offline   Reply With Quote

Old   July 2, 2012, 04:17
Default
  #2
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

you can find a real gas implementation (redlich Kwong, Peng Robinson ...) for OpenFOAM in OpenFOAM ext. .

http://openfoam-extend.git.sourcefor...-ext;a=summary

Have a look at the branch feature/fullyIntegratedRealGasThermo.

Best Regards,
Christian
labyrinth01 likes this.
Chris Lucas is offline   Reply With Quote

Old   July 2, 2012, 07:00
Default
  #3
Member
 
Francesco Capuano
Join Date: May 2010
Posts: 81
Rep Power: 15
francesco_capuano is on a distinguished road
Dear Christian,

thank you very much, that is exactly what I am looking for. I cannot compile it, though. Is it possible to make the library compatible with OpenFOAM v. 2.x? I see that many files are missing in the newer versions (for instance all those in the reaction/reactions folder).

Thanks again,
Francesco
francesco_capuano is offline   Reply With Quote

Old   July 2, 2012, 08:01
Default
  #4
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

I have no version of the code for OpenFOAM 2.0 but you can rewrite the code yourself. Have you tried the code in OpenFOAM 1.6 ext.?

Best Regards,
Christian
Chris Lucas is offline   Reply With Quote

Old   July 2, 2012, 09:47
Default
  #5
Member
 
Francesco Capuano
Join Date: May 2010
Posts: 81
Rep Power: 15
francesco_capuano is on a distinguished road
Thanks for your reply. I haven't tried it yet, but I will soon and let you know.

Best regards,
Francesco
francesco_capuano is offline   Reply With Quote

Old   July 5, 2012, 09:30
Default
  #6
Member
 
Gitesh
Join Date: Jan 2010
Location: Finland
Posts: 73
Rep Power: 16
Gitesh P is on a distinguished road
Hello Christian,

Can you give some more detail for how to use these codes ?

Regards,
GP
Gitesh P is offline   Reply With Quote

Old   July 6, 2012, 04:19
Default
  #7
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

have a look at the pipe tutorial for rhoPisoFoam. All possible thermodynamic models are shown in the thermodynamicProperties dict. Additionally, have a look at the fvSolution of this case. The flag realFluid should be set to true (This changes the pressure equation a bit). For more infomation have a look at the solver code (rhoPisoFoam, pEqn). If you want to use a different solver, the pressure eqn. in this solver must be changed as well (as I did in rhoPisoFoam)

If you have further questions, please ask


By the way, I finished programming the steam tables and are testing them at the moment. Hope to upload them soon.

Christian

Last edited by Chris Lucas; July 6, 2012 at 04:46.
Chris Lucas is offline   Reply With Quote

Old   July 13, 2012, 09:37
Default
  #8
Member
 
Francesco Capuano
Join Date: May 2010
Posts: 81
Rep Power: 15
francesco_capuano is on a distinguished road
Hi Chris,

I have installed OpenFOAM 1.6-ext but still have some problems with the real-gas libraries. I am particularly interested in simulations involving reacting mixtures: are your libraries able to deal with those cases? Which packages do I have to install from the repository? It seems to me that "real gas EOS for mixtures" and "mixture version of real gas EOS" are not sufficient, aren't they?

Thank you very much, regards,
Francesco
francesco_capuano is offline   Reply With Quote

Old   July 13, 2012, 09:43
Default
  #9
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

"Which packages do I have to install from the repository?"

--> the latest one

"It seems to me that "real gas EOS for mixtures" and "mixture version of real gas EOS" are not sufficient, aren't they?"

your correct, at the moment the real gas classes are not connected to the reaction library. You have to connect them yourself. I'm not sure how difficult this is.



Regards,
Christian

Last edited by Chris Lucas; July 14, 2012 at 15:51.
Chris Lucas is offline   Reply With Quote

Old   July 17, 2013, 06:36
Default records
  #10
New Member
 
Sergey
Join Date: Jul 2013
Posts: 1
Rep Power: 0
Servalun is on a distinguished road
Dear Christian,
I downloaded your real gas implementation code for OpenFoam. I have successfully modified it and now I'm using it for my needs. First of all thanks - great job. I want now to summarize my efforts. Do you have some documentation or records of what you did, that you can share?

Best regards,
Sergey
Servalun is offline   Reply With Quote

Old   July 23, 2013, 06:15
Default Real gas implementation code for OpenFoam
  #11
Member
 
Gitesh
Join Date: Jan 2010
Location: Finland
Posts: 73
Rep Power: 16
Gitesh P is on a distinguished road
Hello Sergey,

Nice to know that!

Could you tell me in which version of OpenFOAM you are using for Christian's real gas implementation?

With regards,
GP
Gitesh P is offline   Reply With Quote

Old   July 25, 2013, 04:21
Default
  #12
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

he is using OpenFOAM 2.1. I also have a real gas version for OF 2.1 and might release it soon (problem at the moment is to find the best way to do it). Sergey, you can add your stuff afterwards ( if you like )

Regards,
Christian
PeterBishop likes this.
Chris Lucas is offline   Reply With Quote

Old   August 14, 2013, 12:32
Default
  #13
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
HI,

I finally finished the work. You can download the real gas library for OF 2.1 here:

git clone https://github.com/morgoth541/of_realFluid.git

Christian
Chris Lucas is offline   Reply With Quote

Old   August 26, 2013, 12:18
Default
  #14
New Member
 
Peter Bishop
Join Date: Jan 2012
Posts: 20
Rep Power: 14
PeterBishop is on a distinguished road
Hi,
I downloaded your library from git repository and tried to compile on my exisiting installation of OF2.1, but when I try to compile thermophysicalModels/basic I get the following error

psiThermo/realGasEThermo/realGasEThermos.C(61): error: argument list for class template "Foam::realGasEThermo" is missing

I'm using Intel compiler 13.0.1.

Moreover the following include appears in basicMixtures.C

#include "binaryMixture.H"

it seems this file does not exist anywhere.

Thanks in advance for your reply and for sharing your work.
PeterBishop is offline   Reply With Quote

Old   August 26, 2013, 14:25
Default
  #15
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Hi
how can download it in GitHub?
is it applicable for 2.2.0 version?
and which model is suitable for air in pressures in the range of:200000pa-1.8Mpa
and temperatures of :300-1300K?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 27, 2013, 04:08
Default
  #16
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi Peter,

thank you for your response. I found the error (forgot to add one file) and I will push the update after work.

@immortality

it a git repository, use the command in the consol

git clone https://github.com/morgoth541/of_realFluid.git

Christian
Chris Lucas is offline   Reply With Quote

Old   August 27, 2013, 06:46
Default
  #17
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Hi dear Christian which model you have used in the code?Van Der Waals or what?
is it appropriate to my case in ranges of p and T I told before?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 29, 2013, 03:59
Default
  #18
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi

have a look at the repository README file. The new models are explained there.

Christian
Chris Lucas is offline   Reply With Quote

Old   September 20, 2013, 06:19
Default
  #19
New Member
 
Peter Bishop
Join Date: Jan 2012
Posts: 20
Rep Power: 14
PeterBishop is on a distinguished road
Hi Chris,
I downloaded your real gas implementation from your repository and successfully compiled it on my existing of 2.1 installation. Everything works like a charm

At the moment I'm trying to make some validation of realFluidPISOSolver, simulating transcritical injection of nitrogen jets, for which there are in literature some experimetal data. In this regard should be very useful to let the solver write the specific heat field, have you any suggestion?
PeterBishop is offline   Reply With Quote

Old   September 20, 2013, 09:18
Default
  #20
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

have a look at createFields:

copy and rename "volScalarField rho". Change thermo.rho() to thermo.Cp(). Then, update the new field each time step.

Christian
Chris Lucas is offline   Reply With Quote

Reply

Tags
high pressure injection, openfoam 2.1.x, real gas

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
error: uninitialized local variable 't' used MASOUD Fluent UDF and Scheme Programming 5 October 17, 2016 05:24
error message cuteapathy CFX 14 March 20, 2012 07:45
defining a term for a domain using DEFINE_ADJUST MASOUD Fluent UDF and Scheme Programming 1 September 24, 2010 06:08
Constant velocity of the material Sas CFX 15 July 13, 2010 09:56


All times are GMT -4. The time now is 03:43.