CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   question about chemkinToFoam (http://www.cfd-online.com/Forums/openfoam/90598-question-about-chemkintofoam.html)

skarnani July 14, 2011 20:58

question about chemkinToFoam
 
Hi.
I recently upgraded to OpenFOAM 2.0 and I've run in to a small issue using the chemkinToFoam utility. Instead of getting something that looks like


OH
{
specie
{
nMoles 1;
molWeight 17.0074;
}
thermodynamics
{
Tlow 200;
Thigh 3500;
Tcommon 1000;
highCpCoeffs ( 3.09289 0.00054843 1.26505e-07 -8.79462e-11 1.17412e-14 3858.66 4.4767 );
lowCpCoeffs ( 3.99202 -0.00240132 4.61794e-06 -3.88113e-09 1.36411e-12 3615.08 -0.103925 );
}
transport
{
As 1.67212e-06;
Ts 170.672;
}
}


I get something like the following:

CN
{

{
nMoles 1;
molWeight 26.0179;
}

{
Tlow 200;
Thigh 6000;
Tcommon 1000;
highCpCoeffs ( 3.74598 4.34508e-05 2.9706e-07 -6.86518e-11 4.41342e-15 51536.2 2.78676 );
lowCpCoeffs ( 3.61294 -0.000955513 2.1443e-06 -3.15163e-10 -4.64304e-13 51708.3 3.9805 );
}

{
As 1.67212e-06;
Ts 170.672;
}
}

Without those tags before each grouping, I get an error that reads,

Selecting psiChemistryModel ODEChemistryModel<gasThermoPhysics>
Selecting thermodynamics package hsPsiMixtureThermo<reactingMixture<gasThermoPhysic s>>
Selecting chemistryReader foamChemistryReader
--> FOAM Warning :
From function entry::getKeyword(keyType&, Istream&)
in file db/dictionary/entry/entryIO.C at line 77
Reading /home/sunny/OpenFOAM/sunny-2.0.0/run/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/chemistry/test2
found on line 25 the punctuation token '{'
expected either } or EOF


--> FOAM FATAL IO ERROR:
keyword specie is undefined in dictionary "/home/sunny/OpenFOAM/sunny-2.0.0/run/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/chemistry/test2::CN"

file: /home/sunny/OpenFOAM/sunny-2.0.0/run/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/chemistry/test2::CN

From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 461.

FOAM exiting


I can't be sure, but I imagine this is a straightforward fix. The problem is, I don't know where to begin.

Any suggestions?

Thanks.
Sunny


l_r_mcglashan July 15, 2011 04:14

Interesting, I also have an issue with reading the thermo file, with an error

Quote:

--> FOAM FATAL ERROR:
while reading thermodynamic data specie formula on line 2
expected <word><label><word><label><word><label><word><labe l> (4(2A1,I3)) but found '"."00'

From function chemkinReader::lex()
in file chemistryReaders/chemkinReader/chemkinLexer.L at line 1497.

If you post up your chem.inp and therm.dat files I can take a look.

skarnani July 15, 2011 12:40

3 Attachment(s)
Thanks for your willingness to assist. I attached three files:

1 & 2 are the original CHEMKIN mechanism and thermo file. The third file is the FOAM converted thermo file. You will notice in the FOAM thermo file that the first specie -- OH -- has the required tags that I mentioned in the previous post. I had put those in to test if that was the source of the error.

BTW, which version of OpenFOAM and solver are you using? Your error looks like a similar issue, but the output is different.

Thanks again.
Sunny

l_r_mcglashan July 15, 2011 12:48

I've posted a bug report:

http://www.openfoam.com/mantisbt/view.php?id=251

Keep track of that and I'm sure it will be fixed reasonably soon.

l_r_mcglashan July 20, 2011 04:12

This has been fixed in OF-2.0.x:

https://github.com/OpenCFD/OpenFOAM-...716d3ed0dcef41

skarnani July 20, 2011 12:20

Very cool. Thanks for the update.

RyanJohnson September 2, 2011 17:39

error message after changes made
 
Hello,
I get this error message after running chemkinToFoam

#0 Foam::error::printStack(Foam::Ostream&) in "/home/rfj2c/OF/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libOpenFOAM.so"
#1 Foam::sigSegv::sigHandler(int) in "/home/rfj2c/OF/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
Segmentation fault

after making the changes to the code I recompiled using ./Allwmake in the /src/ directory

thanks in advance!

l_r_mcglashan September 3, 2011 04:49

What changes to the code did you make? What input files are you running chemkinToFoam on? Where did it fail? You need to give more information.

RyanJohnson September 5, 2011 16:59

Problems with ChemToFoam
 
2 Attachment(s)
I changed files by doing the bug fixes exactly as the link above isntructed to do (changed the 10 files as listed above)

I then recompiled the entire directory in the /src/ to make sure that any refrences to these headers would be recompiled.

I then tried again to run the chemkinToFoam and get the segmentation fault error exactly as shown above. I use chemkinToFoam on the attached files.

ChemkinToFoam worked with these two files in the OpenFoam 1.7 release that I am currently using.

Thanks for your help, and sorry about the brevity earlier,
Ryan

##EDIT##
I was able to get it to work when I did ./Allwmake for the entire OpenFOAM environment, some clarification on why this would be needed and not just needed in the /src/ directory would be quite imformative
thanks for your help again!

l_r_mcglashan September 6, 2011 04:01

Hmm, you'll probably find you only needed to recompile applications/utilities/thermophysical/chemkinToFoam. Did you change anything else in between the above? Glad to hear it worked in any case.

ayhan515 November 30, 2011 07:22

1 Attachment(s)
Dear Foamers,

Firstly, i ran chemFoam at /home/ayhan/OpenFOAM/ayhan-2.0.1/run/tutorials/combustion/chemFoam/gri case

It works without fail.
And it draws graph. ok.

http://ressim.net/8/out.php/i5268925_11.png-k

------------------------

Then i used
Code:

chemkinToFoam chem.inp therm.dat reactions thermo
command and i put reactions and thermo files to constant folder.

And i changed to thermophysicalProperties file.
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType      hsPsiMixtureThermo<reactingMixture<gasThermoPhysics>>;

//inertSpecie N2;

chemistryReader foamChemistryReader;

foamChemistryFile "$FOAM_CASE/constant/reactions";

foamChemistryThermoFile "$FOAM_CASE/constant/thermo";



// ************************************************************************* //

Then i use ./Allrun command
It works without fail.
And it draws graph. but..
this time got that picture.

http://ressim.net/8/out.php/i5268926_22.png-k

Is there something wrong arrangement? How can i fix that?

and h2 case
without modification
http://ressim.net/8/out.php/i5269014_h2-11.png-k

chemkinToFoam & foamChemistryReader
http://ressim.net/8/out.php/i5269015_h2-22.png-k

yash.aesi September 11, 2013 08:07

help regarding reactionFoam solver .
 
2 Attachment(s)
greeting oll ,

i am relatively new to OF. nowadays i am trying to simulate my case of different species with the reactingFoam solver and m using openFoam 2.2-x . fist i solved the tutorial of counterFlow Flame after that nw i tried to run my case . but in starting one thing which is paining me is what to write in in thermophysical properties file . shown below :

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            hePsiThermo;
    mixture        reactingMixture;
    transport      sutherland;
    thermo          janaf;
    energy          sensibleEnthalpy;
    equationOfState perfectGas;
    specie          specie;
}

inertSpecie N2;

chemistryReader foamChemistryReader;

foamChemistryFile "$FOAM_CASE/constant/reactions";

foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";


reaction and thermo.compressible file is there in constant folder of my case .
so can anybody guide me what should i change in the above file marked bold ?


thanks in advance ,

Regards ,
sonu


All times are GMT -4. The time now is 12:19.