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 |
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 |
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 |
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 |
Thanks for your reply. I haven't tried it yet, but I will soon and let you know.
Best regards, Francesco |
Hello Christian,
Can you give some more detail for how to use these codes ? Regards, GP |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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. |
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? |
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 |
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? |
Hi
have a look at the repository README file. The new models are explained there. Christian |
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? |
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 |
I downloaded Chris's of_realFluid from github, but do not know how to compile this on my machine. My experience is limited to making simple modifications to solvers and just using wmake. I'm not sure what I should be doing to ensure the thermophysical property modifications are also included.
|
Hi,
you downloaded OpenFOAM 2.1 with my modifications. Simply compile the code (as you would compile the "normal" OpenFOAM version). The water properties (external media) must be compiled by hand (not included in script) Christian |
Hi Chris,
I added the following lines to createfields.H, compiled the solver correctly but when I try to run the realFluidPISOSolver, it is not able to write the Cp field. Code:
volScalarField Cp Code:
rho = thermo.rho(); |
Hi,
1. in here is a typo rho = thermo.rho(); Cp = themro.Cp(); runTime.write(); is this correct im code? 2. Please try volScalarField Cp2 ( IOobject ( "Cp2", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), thermo.Cp() ); 3. Add an Info line in the Cp() function of realgasThermo.C to see if the function is called. Christian |
Thanks for the response Chris. I'm still very new to this, so my apologies if these are very basic questions.
As a test I tried the Allmake shell script for my openfoam211 install (not the of_realFluid) to see how it works, but got a whole bunch of error messages. I moved into /opt/openfoam211 and executed Allmake by Code:
./Allmake Code:
make[1]: *** [multiphaseInterFoam] Error 1 Code:
aaron:/opt/openfoam211$ sudo ./Allwmake The (limited) experience I have compiling with OpenFOAM requires a Make folder, and files + options with that Make folder. Compiling everything else as you are suggesting isn't like that (at least I don't think so) so I'm getting confused. I've also tried the Allmake shell script in src folder, but get similar error messages |
Hi,
you are trying to compile OF under root without being a superuser. Have a look through the forum you will definitely find some theads about how to compile OF Christian |
Hi Chris,
Quote:
Quote:
Thank you very much for your kind support! |
Hi,
the problem is that in realGasHThermo, a field called Cp is constructed in the Cp() function. So you have to fields with the same name and the last field (which is the one in realGasHThermo) is used. Christian |
I may be missing something obvious, but when attempting to compile realFluidPISOSolver I get the following error message.
Code:
In file included from realFluidPISOSolver.C:45:0: Code:
const volScalarField& drhodh = thermo.drhodh(); Thanks for your for your patience. I am learning (albeit slowly!) |
Hi,
you have not compiled my thermo code, so the solver calls a function unknown to him. Christian |
Quote:
Code:
EXE_INC = \ Can you possibly provide a more detailed description of how to compile everything correctly? |
1 Attachment(s)
Hi Chris,
I'm using realFluidPISOSolver to simulate transcritical injenction of Nitrogen according to the article below with very good result. In the attached image the experimental data for axial density are compared to the simulation results. The solver seems to work correctly and it is very reliable! Tae Seon Park, LES and RANS simulations of cryogenic liquid nitrogen jets, J. Of Superciritical Fluids 72 (2012) 232-247 Since you coded real gas formulation for mixtures also I'm wondering how difficult would be to link your library to reactingFoam solver. Regards |
HI,
depends on your goal. If you simply want to mix inert gases, that should be easy. Christian |
Hi Chris,
Sorry to continue bothering you with this, but I am still not able to compile your real gas solver on my computer. I really want to get this working and haven't been able to figure out my problems over the last few days. Peter, perhaps you can help me out also? Chris, you mentioned that I need to compile the thermo code. I haven't been able to do that. I have the of_realFluid from your git saved to my home folder: Code:
aaron:~/OpenFOAM/aaron-2.1.1/of_realFluid/ Code:
aaron:~/OpenFOAM/aaron-2.1.1/of_realFluid/src/thermophysicalModels/basic$ Code:
In file included from mixtures/basicMixture/basicMixture.C:26:0: Within the Make folder, I changed "files" at the very end to have LIB = $(FOAM_USER_LIBBIN)/libbasicThermophysicalModels and this is my "options" file: Code:
EXE_INC = \ Regards, Aaron |
Hi,
change the installation path in OpenFOAM/etc/bashrc and compile OpenFOAM (all of it) using Allwmake (the installed OF version must not be loaded) or compile the thermo library as a FOAM_USER_LIBBIN. Rename it dynamic library (e.g. /libbasicThermophysicalModels2). Make sure the install OpenFOAM version on your machine is compatible to the OF version I used. The environment variables of the installed OF version must be loaded. Then, change the path to the new thermo library in the solver and compile the solver Christian PS: have a look at http://openfoamwiki.net/index.php/In...OpenFOAM-2.1.1 or http://openfoamwiki.net/index.php/In...M-2.2.0/Ubuntu |
Quote:
mixing inert gases should be a good starting point! My real goal is to have a real gas capable version of reactingFoam. |
Problem with IAPWS package
Hi Chris,
The real gas package is working, but when I tried to use the IAPWS package, the following error appears: Code:
--> FOAM FATAL ERROR: Code:
cluster@node0:/opt/OpenFOAM/OpenFOAM-2.1.0/src/thermophysicalModels/externalMedia/IAPWS_Waterproperties$ wmake libso Thanks in advanced, Felipe Magazoni |
Hi,
do you use my github code or have you included the new code in your OF version? Christian |
Hi,
the problem seems to be related to the macro in basicPsiThermo. Have a look if the code is copied correctly. Christian |
All times are GMT -4. The time now is 23:30. |