How to define multiple ranges for JANAF coefficients? (OF5/OF6)

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

January 14, 2019, 11:20
How to define multiple ranges for JANAF coefficients? (OF5/OF6)
#1
Senior Member

Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 7
Hello,

I am accessing the CEA database of NASA for JANAF coefficients beyond the typical range of 200-6000 K. CEA data is expressed in 3 different ranges 200-1000, 1000-6000, 6000-20000 (see attached image for H2).

How do I incorporate three ranges in thermodynamics subdictionary? Is there any way? If not is there any alternative?

Does something like this work?
Code:
```thermodynamics
{
Tlow1            200;
Thigh1           1000;
Tcommon         1000;
highCpCoeffs    ( 2.5000 0.0000000 0.00000 0.0000 0.0000 -745.37 4.37 );
lowCpCoeffs     ( 2.5000 0.0000000 0.00000 0.0000 0.0000 -745.37 4.37 );

Tlow2            1000;
Thigh2           6000;
Tcommon         1000;
highCpCoeffs    ( 2.5000 0.0000000 0.00000 0.0000 0.0000 -745.37 4.37 );
lowCpCoeffs     ( 2.5000 0.0000000 0.00000 0.0000 0.0000 -745.37 4.37 );

Tlow3            6000;
Thigh3           20000;
Tcommon         1000;
highCpCoeffs    ( 2.5000 0.0000000 0.00000 0.0000 0.0000 -745.37 4.37 );
lowCpCoeffs     ( 2.5000 0.0000000 0.00000 0.0000 0.0000 -745.37 4.37 );
}```
Attached Images
 Screenshot from 2019-01-14 12-12-19.png (77.8 KB, 12 views)

Last edited by deepbandivadekar; January 15, 2019 at 13:41.

 January 14, 2019, 16:20 #2 Member   Join Date: Dec 2018 Location: Darmstadt, Germany Posts: 87 Rep Power: 6 hey deepbandivadekar, Bad news first: I quickly checked the OFv6 implementation of the Janaf polynomials (https://cpp.openfoam.org/v6/janafThermo_8H_source.html) and it doesn't seem compatible. Now the good news: It shouldn't be too complicated to implement this functionality in an extra class (ThreeRangeJanafThermo - this is the one you need to implement, basically like janafThermo but with some more if-statements and of course one coeffArray more for the mid range). This class and the mandatory myPsiThermos.C-file* (including your new class into the makeThermo-macros) should be compiled into a new library, which can then be linked to your application through your controlDict. I know it is quite vague (I'm super tired) but I think you can make it work by searching a bit through the forums and digging into the code. I wish you good luck! Cheers RP *myPsiThermos.C or myRhoThermos.C, refering to the type of thermodynamics used in your application.

January 15, 2019, 07:33
#3
Senior Member

Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 7
Quote:
 Originally Posted by raumpolizei hey deepbandivadekar, Bad news first: I quickly checked the OFv6 implementation of the Janaf polynomials (https://cpp.openfoam.org/v6/janafThermo_8H_source.html) and it doesn't seem compatible. Now the good news: It shouldn't be too complicated to implement this functionality in an extra class (ThreeRangeJanafThermo - this is the one you need to implement, basically like janafThermo but with some more if-statements and of course one coeffArray more for the mid range). This class and the mandatory myPsiThermos.C-file* (including your new class into the makeThermo-macros) should be compiled into a new library, which can then be linked to your application through your controlDict. I know it is quite vague (I'm super tired) but I think you can make it work by searching a bit through the forums and digging into the code. I wish you good luck! Cheers RP *myPsiThermos.C or myRhoThermos.C, refering to the type of thermodynamics used in your application.
Ok, this gives me some hints.
So it'd rather be like this:
Code:
```thermodynamics
{
Tlow                   200;
Tcommon1          1000;
Tcommon2          6000;
Thigh                  20000;

highCpCoeffs    ( Coefficients corresponding to 6000 to 20000 );
midCpCoeffs    ( Coefficients corresponding to 1000 to 6000 );
lowCpCoeffs     ( Coefficients corresponding to 200 to 1000 );
}```
Thanks!

 January 16, 2019, 08:35 #4 Member   Join Date: Dec 2018 Location: Darmstadt, Germany Posts: 87 Rep Power: 6 Yes, something like this is a good starting point, even though the final version will depend on how you implement it.

 Tags janaf, openfoam 5, openfoam 6, thermophysicalproperties