CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Real Gas EOS (https://www.cfd-online.com/Forums/openfoam-programming-development/103937-real-gas-eos.html)

francesco_capuano June 29, 2012 08:46

Real Gas EOS
 
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

Chris Lucas July 2, 2012 03:17

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

francesco_capuano July 2, 2012 06:00

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

Chris Lucas July 2, 2012 07:01

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

francesco_capuano July 2, 2012 08:47

Thanks for your reply. I haven't tried it yet, but I will soon and let you know.

Best regards,
Francesco

Gitesh P July 5, 2012 08:30

Hello Christian,

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

Regards,
GP

Chris Lucas July 6, 2012 03:19

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

francesco_capuano July 13, 2012 08:37

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

Chris Lucas July 13, 2012 08:43

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

Servalun July 17, 2013 05:36

records
 
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

Gitesh P July 23, 2013 05:15

Real gas implementation code for OpenFoam
 
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

Chris Lucas July 25, 2013 03:21

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

Chris Lucas August 14, 2013 11:32

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

PeterBishop August 26, 2013 11:18

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.

immortality August 26, 2013 13:25

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?

Chris Lucas August 27, 2013 03:08

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

immortality August 27, 2013 05:46

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?

Chris Lucas August 29, 2013 02:59

Hi

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

Christian

PeterBishop September 20, 2013 05:19

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?

Chris Lucas September 20, 2013 08:18

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


All times are GMT -4. The time now is 16:50.