CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Newer Janaf Model (https://www.cfd-online.com/Forums/openfoam/76123-newer-janaf-model.html)

iyer.arvind May 14, 2010 13:50

Newer Janaf Model
 
1 Attachment(s)
The older janaf thermodynamic model is implemented in OpenFOAM. For my use i have implemented the newer Janaf model, which models Cp0 H0 S0 for most species from 200K to 20000K.

The current code is for OpenFOAM-1.5 ( :( ) but must not be too difficult to port to 1.6.x. (I will do that if i get some time for it). However if someone wants to use it, i am attaching the patch for thermophysicalModels.

I would like to know if people find it useful.

NOTE This code is hardly tested! I coded it just yesterday, and it seemed to work fine. Please test it for your purpose, and kindly let me know of any bugs.

NOTE 2: use bzip2 to unzip the patch file

iyer.arvind May 18, 2010 01:03

any problems?
 
If people are finding any difficulty in applying the patch, I would be glad to mention the procedure to do that. 70 views and no replies is slightly discouraging ! :(

Chris Lucas May 18, 2010 04:33

Hi,

Thank you for posting your work.

I tried to run the script but it didn't work. I'm using OpenFoam1.6.x.
Would it be possible to post the main files of the new Janaf Tables?

Regards
Christian

iyer.arvind May 18, 2010 07:00

Arvind Iyer
 
Thanks for reponding. The patch is for OpenFOAM-1.5 (sorry to say) but I guess if i could give you the files you should ot find it difficult in implementing in OpenFOAM-1.6. Also i will try to spare some time this weekend and try and get it up for 1.6. However, I am unable to upload all the files here because they are beyond 100kb. Could you please let me know a mode of transfer? I would be glad to share it with you.

Chris Lucas May 19, 2010 07:04

Openfoam Wiki
 
Hi,

you could upload the new Janaf Tables onto the Openfoam Wiki homepage. That way, everybody who wants to use them can download them.

Regards,
Christian

iyer.arvind May 19, 2010 07:19

I think it would be better if i could get the 1.6.x version, and push to the OpenFOAM-extend project. However i will see if i can put the files in the wiki for now.

CedricVH May 19, 2010 10:44

Thanks for your efforts Iyer! I have never used any Janaf model, but I have read on the forums that there are some problems with the current Janaf model in OpenFOAM so your contribution is appreciated!

chandramurthy May 19, 2010 11:09

good work arvind...when i go through this file, i found some things,
1) I guess it is trying to replace existing Janaf, can both(janaf-I and janf-II) simultaneously work?
2) any validation being done?

iyer.arvind May 20, 2010 00:14

The problem is that janaf (reader especially) is quite deeply coded. the reader appears in the same file which reads the chemkin data.

_____/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L

Also,

_____/thermophysicalModels/specie/reaction/reactions/makeReactionJanaf.H:
typedef sutherlandTransport<specieThermo<janafThermo<perfe ctGas> > > reactionThermo;

As you can see janaf is quite deep embedded in the code. If it were abstracted to a generic thermophysical model interface (abstract class), and janaf being a child class with its own reader, it would have been much better, and easily we could have either models to work with.

universez May 28, 2010 19:05

Great work.
 
Good work !

thekay May 29, 2010 11:56

Thank you Iyer, good piece of work. I will probably need to test it in a couple of weeks. Will let you know of my results.

skarnani July 16, 2010 01:09

Hello All.
I was curious about this new Janaf model. I'm currently running OpenFOAM 1.6.x. It would be an interesting exercise to try and port it over but, in all honesty, I wouldn't really be sure where to begin. To start, how would I go about applying a patch?

Thanks.
Sunny

iyer.arvind July 16, 2010 07:34

Patch is for 1.5
 
Sorry to say but the patch is only for 1.5. I am not getting the breathing space to implement for 1.7. I cannot comment on how easy it will be with 1.6x. If you are unlucky, you can at best take inspiration from it :);

chbenz October 6, 2010 07:12

Can you give us the source code files for the new janaf model. I'm not able to extract them from the patch-file.

regards,
christof

bfisch90 April 2, 2011 06:10

Thank you for your work. How does the thermo.dat file look like? I tried to implement your new janaf model to OF-1.7.1 an would like to test it. Maybe you can post it. If it works I would post the updated files here.

Thomas

iyer.arvind April 2, 2011 06:42

Link
 
http://www.galcit.caltech.edu/EDL/pu...rmo/thermo.inp

iyer.arvind April 2, 2011 06:43

If you require the source code, please mail me, i will send you the source code too

bfisch90 April 14, 2011 21:36

Updated new janaf model
 
Hallo,

I have implemented Iyers newer janaf model to OpenFOAM 1.7.1. You can find and download it in the OpenFOAM wiki:
http://openfoamwiki.net/index.php/Janaf.
There you can also find a modificated test case, which should run if the installation was correct.

Thomas

yingkun June 24, 2011 04:32

Hi,Thomas
I try as you say,then Allwmake,and run my case,it seems doesn't work, it shows on the terminal:
--> FOAM FATAL ERROR:
attempt to use janafThermo<equationOfState> out of temperature range 0 -> 5000; T = 5014.46
why the temperature range doesn't change?
may be there're something I missing?

bfisch90 June 24, 2011 10:47

Quote:

Originally Posted by yingkun (Post 313370)
Hi,Thomas
I try as you say,then Allwmake,and run my case,it seems doesn't work, it shows on the terminal:
--> FOAM FATAL ERROR:
attempt to use janafThermo<equationOfState> out of temperature range 0 -> 5000; T = 5014.46
why the temperature range doesn't change?
may be there're something I missing?

Hallo Yingkun,

there must be at least one species in the janaf table, which has only a temperature range between 0 and 5000 K. A quick and dirty solution would be to find these species in the table and set the temperature limit from 5000 K to 6000 K and look what happens. Maybe (or better hopefully) these species have such a low concentration, that it does not have a negative effect on your calculation.

Hope this helps!
Thomas

yingkun June 24, 2011 21:03

Hi,Thomas
I chang the species temperature rangs in therm.dat file,it works,the only thing is that I need to know whether the result is correct,I'm going to check it...

bfisch90 June 26, 2011 01:05

Hallo Yingkun,

maybe you could try to find out, if the nasa database has new thermodynamic data for your species, which are valid for temperatures up to 6000 K.
http://www.grc.nasa.gov/WWW/CEAWeb/ceaThermoBuild.htm

Good luck
Thomas

yingkun June 26, 2011 07:27

it's good for me,thanks!

Rophys September 30, 2011 18:49

Hello all,

I tried to use the NASA web site but I didn't understand so much the output.
For example, I choose the element N (atomic nitrogen) and after this I choose N2 (molecular nitrogen). Next step, I choose the temperature range from 273 to 500 K, and I get the following output :

N2

OPTIONS: joules

TEMPERATURE SCHEDULE

273.000 283.000 293.000 298.150 303.000 313.000
323.000 333.000 343.000 353.000 363.000 373.000
383.000 393.000 400.000

NOTE: Thermodynamic properties calculated for temperatures outside the range of
the fitted data may have large errors. This program allows calculations only
for temperatures within 20% above or below the fitted temperature range.


COEFFICIENTS FOR FITTED THERMODYNAMIC FUNCTIONS


N2 Ref-Elm. Gurvich,1978 pt1 p280 pt2 p207.
3 tpis78 N 2.00 0.00 0.00 0.00 0.00 0 28.01340 0.000
200.000 1000.000 7 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 0.0 8670.104
2.210371497E+04-3.818461820E+02 6.082738360E+00-8.530914410E-03 1.384646189E-05
-9.625793620E-09 2.519705809E-12 0.000000000E+00 7.108460860E+02-1.076003744E+01
1000.000 6000.000 7 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 0.0 8670.104
5.877124060E+05-2.239249073E+03 6.066949220E+00-6.139685500E-04 1.491806679E-07
-1.923105485E-11 1.061954386E-15 0.000000000E+00 1.283210415E+04-1.586640027E+01
6000.000 20000.000 7 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 0.0 8670.104
8.310139160E+08-6.420733540E+05 2.020264635E+02-3.065092046E-02 2.486903333E-06
-9.705954110E-11 1.437538881E-15 0.000000000E+00 4.938707040E+06-1.672099740E+03

.
.
.

According to the User Guide (U-177) Cp is calculated as follow:
Cp=R((((a1T+a3)T+a2)T+a1)T+a0)
and we need 2 constants of integration a5 and a6.

My question is, which of this parameters corresponds to a0, a1, a2, a3, a4, a5 and a6 ? If this website is not properly to obtain this value, there is another reference ?
My apologise for this question, it is a bit long :rolleyes:

bfisch90 October 6, 2011 03:39

Hallo,

the output of the NASA-database is based on the newer Janaf model with 9 coefficients (a1-a7, b1, b2).

a1 a2 a3 a4
2.210371497E+04-3.818461820E+02 6.082738360E+00-8.530914410E-03
a5
1.384646189E-05
a6 a7 placeholder
-9.625793620E-09 2.519705809E-12 0.000000000E+00
b1 b2
7.108460860E+02-1.076003744E+01



Equations newer Janaf model
Cp(T) = R( a[1]/T^2 + a[2]/T+ a[3] + a[4]T + a[5]T^2 + a[6]T^3 + a[7]T^4 )
H(T) = R( -a[1]/T + a[2]lnT + a[3]T + (a[4]T^2)/2 + (a[5]T^3)/3 + (a[6]T^4)/4 + (a[7]T^5)/5 + b[1] )
S(T) = R( -a[1]/(2*T^2) - a[2]/T + a[3] lnT + a[4]T + (a[5]T^2)/2 + (a[6]T^3)/3 + (a[7]T^4)/4 + b[2] )

The official version of OpenFOAM has implemented only the old Janaf model.

So you have different choices e.g.:
- Convert the thermodata (from the NASA database) into the old format
- Implement the newer Janaf model to OpenFOAM
http://openfoamwiki.net/index.php/Janaf4
- use a thermodata file which is already in the old format and contains the species you need.
ftp://ftp.technion.ac.il/pub/support...mics/THERM.DAT

Thomas


Quote:

Originally Posted by Rophys (Post 326316)
Hello all,

I tried to use the NASA web site but I didn't understand so much the output.
For example, I choose the element N (atomic nitrogen) and after this I choose N2 (molecular nitrogen). Next step, I choose the temperature range from 273 to 500 K, and I get the following output :

N2

OPTIONS: joules

TEMPERATURE SCHEDULE

273.000 283.000 293.000 298.150 303.000 313.000
323.000 333.000 343.000 353.000 363.000 373.000
383.000 393.000 400.000

NOTE: Thermodynamic properties calculated for temperatures outside the range of
the fitted data may have large errors. This program allows calculations only
for temperatures within 20% above or below the fitted temperature range.


COEFFICIENTS FOR FITTED THERMODYNAMIC FUNCTIONS


N2 Ref-Elm. Gurvich,1978 pt1 p280 pt2 p207.
3 tpis78 N 2.00 0.00 0.00 0.00 0.00 0 28.01340 0.000
200.000 1000.000 7 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 0.0 8670.104
2.210371497E+04-3.818461820E+02 6.082738360E+00-8.530914410E-03 1.384646189E-05
-9.625793620E-09 2.519705809E-12 0.000000000E+00 7.108460860E+02-1.076003744E+01
1000.000 6000.000 7 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 0.0 8670.104
5.877124060E+05-2.239249073E+03 6.066949220E+00-6.139685500E-04 1.491806679E-07
-1.923105485E-11 1.061954386E-15 0.000000000E+00 1.283210415E+04-1.586640027E+01
6000.000 20000.000 7 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 0.0 8670.104
8.310139160E+08-6.420733540E+05 2.020264635E+02-3.065092046E-02 2.486903333E-06
-9.705954110E-11 1.437538881E-15 0.000000000E+00 4.938707040E+06-1.672099740E+03

.
.
.

According to the User Guide (U-177) Cp is calculated as follow:
Cp=R((((a1T+a3)T+a2)T+a1)T+a0)
and we need 2 constants of integration a5 and a6.

My question is, which of this parameters corresponds to a0, a1, a2, a3, a4, a5 and a6 ? If this website is not properly to obtain this value, there is another reference ?
My apologise for this question, it is a bit long :rolleyes:


Rophys October 6, 2011 06:23

Hi Thomas,

Thanks for this. Again I have two more questions.

1) The file therm.dat only give me information about a0....a4. How can I calculate the a5 and a6 (constants of integration). ?

2) Taking in to account the air data, which line corresponds to high and low temperature coefficients ? And the common temperature ?

AIR L 9/95 WARNING! 0G 200.000 6000.000 1000. 1
3.08792717E+00 1.24597184E-03-4.23718945E-07 6.74774789E-1-3.97076972E-15 2
-9.95262755E+02 5.95960930E+00 3.56839620E+00-6.78729429E-04 55371476E-06 3
-3.29937060E-12-4.66395387E-13-1.06234659E+03 71582965E+00-1.50965000E+01 4

line 1
200.000 - lower temperature limit
6000.000 - upper temperature limit
1000 - common temperature

line 2
corresponds to low cp coeff ?

line 3
corresponds to high cp coeff ?

line 4
corresponds to common temperature cp coeff ?

Is it correct ?

Thanks very much

bfisch90 October 6, 2011 06:45

Hallo,

In the old janaf tables, you have only two temperature ranges (low and high). The first 7 parameters belong to the high temperature range. a5 and a6 are the constants of integration.
(You could test this by just plotting cp, h and s.)
The janaf table with 15 coefficients is an updated version:
The 7 term polynomials actually include 15 constants. The first set of 7 constants belongs to the 1000-6000 K polynomial, the second set of 7 constants belongs to the 200-1000 K polynomial, and the fifteenth constant is H298/R ≡ ΔfH298/R.

Thomas

high temperature range (1000K-6000K)
a0 a1 a2 a3 a4
3.08792717E+00 1.24597184E-03-4.23718945E-07 6.74774789E-1-3.97076972E-15 2
a5 a6 low temperature range (200K-1000K) a0 a1 a2
-9.95262755E+02 5.95960930E+00 3.56839620E+00-6.78729429E-04 55371476E-06 3
a3 a4 a5 a6 H298/R
-3.29937060E-12-4.66395387E-13-1.06234659E+03 71582965E+00-1.50965000E+01 4

Cp(T) = R( a[0] + a[1]T + a[2]T^2 + a[3]T^3 + a[4]T^4 )
H(T) = R( a[0]T + (a[1]T^2)/2 + (a[2]T^3)/3 + (a[3]T^4)/4 + (a[4]T^5)/5 + a[5] )
S(T) = R( a[0] lnT + a[1]T + (a[2]T^2)/2 + (a[3]T^3)/3 + (a[4]T^4)/4 + a[6] )


Quote:

Originally Posted by Rophys (Post 326887)
Hi Thomas,

Thanks for this. Again I have two more questions.

1) The file therm.dat only give me information about a0....a4. How can I calculate the a5 and a6 (constants of integration). ?

2) Taking in to account the air data, which line corresponds to high and low temperature coefficients ? And the common temperature ?

AIR L 9/95 WARNING! 0G 200.000 6000.000 1000. 1
3.08792717E+00 1.24597184E-03-4.23718945E-07 6.74774789E-1-3.97076972E-15 2
-9.95262755E+02 5.95960930E+00 3.56839620E+00-6.78729429E-04 55371476E-06 3
-3.29937060E-12-4.66395387E-13-1.06234659E+03 71582965E+00-1.50965000E+01 4

line 1
200.000 - lower temperature limit
6000.000 - upper temperature limit
1000 - common temperature

line 2
corresponds to low cp coeff ?

line 3
corresponds to high cp coeff ?

line 4
corresponds to common temperature cp coeff ?

Is it correct ?

Thanks very much


Rophys October 6, 2011 07:09

Hi Thomas,

Thanks for this.

Now is very clear to me the janaf table.

MPJ December 6, 2011 08:08

download link is not avaible
 
hello everyone,
it seems that the download link for the new janaf table in the openfoamwikiis not avaible now.
The URL of openfoamwiki is:
http://openfoamwiki.net/index.php/Janaf
can somebody send me a copy of these file?
my email address is oliver.pasqual@gmail.com
Thanks
oliver P

Rophys December 6, 2011 09:08

MPJ,

The new JANAF table is not implemented in the OpenFoam. In your simulation you need to use the values from the old table. The link that you sent in your post there contains both tables (old and new JANAF).

old JANAF: ftp://ftp.technion.ac.il/pub/support...mics/THERM.DAT

new JANAF: http://www.galcit.caltech.edu/EDL/pu...rmo/thermo.inp

Regards,

Rodrigo

MPJ December 7, 2011 09:06

Quote:

Originally Posted by Rophys (Post 334863)
MPJ,

The new JANAF table is not implemented in the OpenFoam. In your simulation you need to use the values from the old table. The link that you sent in your post there contains both tables (old and new JANAF).

old JANAF: ftp://ftp.technion.ac.il/pub/support...mics/THERM.DAT

new JANAF: http://www.galcit.caltech.edu/EDL/pu...rmo/thermo.inp

Regards,

Rodrigo



Hi Rodrigo,
thanks for your kindly reply.
sorry for the undetailed description.
The janaf table can be obtained, but the URL for new janaf model is not avaible.
it's the message from the developer that the link will be updated soon(Thx, Thomas)

Have a nice day
Oliver

MPJ May 2, 2012 09:33

hello everyone,
The downloading URL for new janaf model in the wiki is not avaiable for a long time.
I want to obtain these files, so it will be highly appreciated if someone send me a copy of these file or tell me where I can get them.
oliver

Rophys May 2, 2012 18:45

Dear Oliver,

Just download the new Janaf using the following link:

new JANAF: http://www.galcit.caltech.edu/EDL/pu...rmo/thermo.inp

open the website, copy all the data (ctrl+a) and paste it in .txt file (you can create a .txt using a text editor like notepad).

Cheers.

MPJ May 7, 2012 09:33

Quote:

Originally Posted by Rophys (Post 358974)
Dear Oliver,

Just download the new Janaf using the following link:

new JANAF: http://www.galcit.caltech.edu/EDL/pu...rmo/thermo.inp

open the website, copy all the data (ctrl+a) and paste it in .txt file (you can create a .txt using a text editor like notepad).

Cheers.


Dear Rophys,
Thanks for you kindly reply and your patient help.
yes the janaf table can be obtained from URL your given.
From the openfoamwiki
( http://openfoamwiki.net/index.php/Janaf ),
we got:
The old janaf tables uses 7 coefficients and 2 polynomials for a lower and a higher temperature range,and the old janaf tables are valid for temperatures up to 6000 K.
The newer janaf model can be used to handle a larger temperature range up to 30000 K.
But the temperature dependent values of Cp, H and S are calculated with 3 polynomials using 9 coefficients.
so only obtain the new janaf tables has none effect on solving the problem. firstly we should replace the older janaf model source code files, and then compile to refresh the library.
but the source code URL describeds in the install section of wiki is not avaible for a long time.
that is :
------------------------------------------------------
2.2.1 How to install

1.Download and unzip the following folders:
http://www.daten.media-agentur-hof.d...land150411.zip
http://www.daten.media-agentur-hof.d...lich/janaf.zip
http://www.daten.media-agentur-hof.d...ader160411.zip
------------------------------------------------------

also the test case can't be download now.

so if you have the source code file and the test case files, could you send me a copy of them.
My email address is: oliver.pasqual@gmail.com
Great thanks!
oliver

Alish1984 July 13, 2012 08:52

Quote:

Originally Posted by MPJ (Post 359737)
Dear Rophys,
Thanks for you kindly reply and your patient help.
yes the janaf table can be obtained from URL your given.
From the openfoamwiki
( http://openfoamwiki.net/index.php/Janaf ),
we got:
The old janaf tables uses 7 coefficients and 2 polynomials for a lower and a higher temperature range,and the old janaf tables are valid for temperatures up to 6000 K.
The newer janaf model can be used to handle a larger temperature range up to 30000 K.
But the temperature dependent values of Cp, H and S are calculated with 3 polynomials using 9 coefficients.
so only obtain the new janaf tables has none effect on solving the problem. firstly we should replace the older janaf model source code files, and then compile to refresh the library.
but the source code URL describeds in the install section of wiki is not avaible for a long time.
that is :
------------------------------------------------------
2.2.1 How to install

1.Download and unzip the following folders:
http://www.daten.media-agentur-hof.d...land150411.zip
http://www.daten.media-agentur-hof.d...lich/janaf.zip
http://www.daten.media-agentur-hof.d...ader160411.zip
------------------------------------------------------

also the test case can't be download now.

so if you have the source code file and the test case files, could you send me a copy of them.
My email address is: oliver.pasqual@gmail.com
Great thanks!
oliver



I have the same problem. the link to .zip source files is down. any one can help???

Punit Walia October 23, 2013 07:22

Using Newer Janaf Model in OpenFOAM -2.2.0
 
Hello,
I am working on a temperature range of 1000-15000K. So i need to use newer janaf tables which have temperature range till 20000K. I have worked using the old janaf tables.. but near 4000 initial temperature, it goes out of range. Please help me to implement the new janaf model with 9 coefficients. I am using openFOAM version 2.2.0.
Thank you,

Punit Walia

Punit Walia October 24, 2013 07:12

Hi Arvind,
I have to use Newer Janaf model in OpenFOAM-2.2.0. Please can you send me the source code files and the procedure to follow to implement it in 2.2.0 version of openfoam.
My email id is punit.iitb@gmail.com

Thank You

Regards,
Punit Walia

dancfd May 5, 2014 22:13

Hello all,

Thank you for the data reference. Can anyone identify a technical document reference for the JANAF data for air? I cannot seem to find it and I am uncomfortable citing a website in my paper.

Thanks in advance,

Daniel

ziemowitzima May 14, 2015 07:13

how to caclculate/find the integration constants ?
 
It seems that this question was not answered (but asked several times in the upper discussion).

Is anyone of you aware how the constants of integration are calculated ?

I know that:

H(T) = \int  Cp(T) \, dT + C1

S(T) = \int  \frac{Cp(T)}{T} \, dT + C2

but what is the value of C1 and C2, which is needed for JANAF as a6 and a7 ?

thanks
ZMM

Momo1805 February 4, 2016 11:25

janaf explotes sprayfoam
 
1 Attachment(s)
Hello Foamers,

I am dealing with a similiar Problem concerning janafThermo out of Temp.-Range. I am injecting Propan at 1bar with T=300K with the sprayFoam solver. Mesh and boundaries are all the same as the tutorial. The first few timesteps run without problems but than my min temperature decreases within 2-3 timesteps resulting in values way underneath of 200K so my janafmodel explodes. Also I am using a boiling evaporation model as propan boils at around 240K.

Has anyone experienced the same or has any idea what I could change? Would be grateful for any help since I have no idea left. I enclose my log.file of the calculation.

Cheers Moritz


All times are GMT -4. The time now is 01:23.