CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   How to define multiple ranges for JANAF coefficients? (OF5/OF6) (https://www.cfd-online.com/Forums/openfoam-pre-processing/213952-how-define-multiple-ranges-janaf-coefficients-of5-of6.html)

deepbandivadekar January 14, 2019 10:20

How to define multiple ranges for JANAF coefficients? (OF5/OF6)
 
1 Attachment(s)
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 );
    }


raumpolizei January 14, 2019 15:20

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.

deepbandivadekar January 15, 2019 06:33

Quote:

Originally Posted by raumpolizei (Post 721942)
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 );
 }

Right? I'll read more and update if I have more questions/updates.
Thanks!

raumpolizei January 16, 2019 07:35

Yes, something like this is a good starting point, even though the final version will depend on how you implement it.


All times are GMT -4. The time now is 06:36.