CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

question about chemkinToFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By clapointe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 25, 2017, 03:02
Question question about chemkinToFoam
  #1
New Member
 
FengHaifeng
Join Date: May 2017
Posts: 4
Rep Power: 9
asakusa is on a distinguished road
I’m a beginner of OpenFOAM and I’m using OpenFOAM4.1. I’m using chemkinToFoam to import reaction from chemkin to OpenFOAM. The usage of chemkinToFoam in OpenFOAM4.1 is:

chemkinToFoam [OPTIONS] <CHEMKINFile> <CHEMKINThermodynamicsFile> <CHEMKINTransport> <FOAMChemistryFile> <FOAMThermodynamicsFile>

But an error occurred when I tried to import the CHEMKINTransport(tran.dat):

--> FOAM FATAL IO ERROR:
"ill defined primitiveEntry starting at keyword '!' on line 1 and ending at line 80"

file: trans.dat at line 80.

From function void Foam:rimitiveEntry::readEntry(const Foam::dictionary&, Foam::Istream&)
in file db/dictionary/primitiveEntry/primitiveEntryIO.C at line 189.

FOAM exiting

it seems that there are some problems with my CHEMKINTransport.
my CHEMKINTransport(tran.dat) looks like these:

! CURRAN, H. J., PITZ, W. J., AND WESTBROOK, C. K., 2002
! UCRL-WEB-204236
! REVIEW AND RELEASE DATE: MAY 19, 2004.
!
AR 0 136.500 3.330 0.000 0.000 0.000
RR 0 136.500 3.330 0.000 0.000 0.000
AS 0 1045.500 4.580 0.000 0.000 0.000 ! MEC
ASH 1 199.300 4.215 0.000 0.000 1.000 ! MEC
ASH2 2 229.600 4.180 0.000 0.000 1.000 ! MEC
C 0 71.400 3.298 0.000 0.000 0.000 ! *
C2 1 97.530 3.621 0.000 1.760 4.000
C2O 1 232.400 3.828 0.000 0.000 1.000 ! *
CN2 1 232.400 3.828 0.000 0.000 1.000 ! OIS
C2H 1 265.300 3.721 0.000 0.000 2.500 ! NMM
C2H2 1 265.300 3.721 0.000 0.000 2.500 ! NMM
C2H2OH 2 224.700 4.162 0.000 0.000 1.000 ! *


How should I modify it so that it can be imported correctly? Thank you in advance.
asakusa is offline   Reply With Quote

Old   June 12, 2017, 16:37
Default Same issue
  #2
New Member
 
Sid Nigam
Join Date: Feb 2016
Posts: 4
Rep Power: 10
spk363 is on a distinguished road
Hi,
Were you able to correct this? I'm working on a similar issue and my challenge is trying to figure out how to import the transport file correctly as well. It seems like in OpenFoam version 4+ you need the transport file. Previously, it wasn't required.
spk363 is offline   Reply With Quote

Old   June 13, 2017, 13:21
Default
  #3
rcr
New Member
 
Join Date: Jun 2017
Posts: 3
Rep Power: 9
rcr is on a distinguished road
It happened to me too. I was trying with GRI 3.0, perfectly clean transport data file. It is probably a bug in OpenFOAM. Above, my log:

--> FOAM FATAL IO ERROR:
"ill defined primitiveEntry starting at keyword 'AR' on line 1 and ending at line 112"

file: transport.dat at line 112.

From function void Foam:rimitiveEntry::readEntry(const Foam::dictionary&, Foam::Istream&)
in file db/dictionary/primitiveEntry/primitiveEntryIO.C at line 189.

FOAM exiting

And transport file begins with:

AR 0 136.500 3.330 0.000 0.000 0.000
C 0 71.400 3.298 0.000 0.000 0.000 ! *
C2 1 97.530 3.621 0.000 1.760 4.000
C2O 1 232.400 3.828 0.000 0.000 1.000 ! *
CN2 1 232.400 3.828 0.000 0.000 1.000 ! OIS
C2H 1 209.000 4.100 0.000 0.000 2.500

Another thing to notice: the transport file has only 110 lines, but OpenFOAM tells the problem is in line 112.

If someone has a fix, it would be gratefully wellcomed.
rcr is offline   Reply With Quote

Old   June 26, 2017, 04:00
Default
  #4
New Member
 
FengHaifeng
Join Date: May 2017
Posts: 4
Rep Power: 9
asakusa is on a distinguished road
Actually I gave up and installed the OpenFOAM3.0 which doesn't require the CHEMKINThermodynamicsFile.
asakusa is offline   Reply With Quote

Old   June 26, 2017, 06:02
Default
  #5
rcr
New Member
 
Join Date: Jun 2017
Posts: 3
Rep Power: 9
rcr is on a distinguished road
I have flagged it as a bug in OpenFoam.org, and they answered me saying they don't have the feature installed in OF. So, they depend on someone programming it for them, which is quite strange, considering their software pretends to provide the feature. I'll do the same (install OF3.0), unfortunately, this new version doesn't do what I need.
rcr is offline   Reply With Quote

Old   June 30, 2017, 15:57
Default
  #6
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 15
clapointe is on a distinguished road
You need to have the transport data in an Openfoam dictionary format. Check the files in the chemFoam tutorials.

Caelan
clapointe is offline   Reply With Quote

Old   July 5, 2017, 13:41
Default chemkinToFoam
  #7
Member
 
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 11
sahmed is on a distinguished road
Dear all
I am using OF version 2.3.1 and to convert mechanism from Chemkin to OF format, I dont need transport file. I just used the command-

chemkinToFoam <chemistry in CK format> <thermo in CK format> <chemistry in OF format> <themo in OF format>

It works fine. I dont know if anyone used in the format or not, but did you notice that there is an automatic mole to kmole conversion of all the A-factors during the conversion? I dont know if it is really a mole to kmole conversion or not but all the A-factors are decreased by factors of 3.

Could anyone explain if that conversion is really needed.
sahmed is offline   Reply With Quote

Old   July 5, 2017, 13:56
Default
  #8
Member
 
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 11
sahmed is on a distinguished road
Quote:
Originally Posted by clapointe View Post
You need to have the transport data in an Openfoam dictionary format. Check the files in the chemFoam tutorials.

Caelan
Hi Caelan
Could you explain what you meant by 'chemFoam tutorials'. By the way, I am an older version OF user, I use version 2.3.1.
thanks

~SFA
sahmed is offline   Reply With Quote

Old   July 5, 2017, 15:13
Default
  #9
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 15
clapointe is on a distinguished road
I've included a link to the chemFoam tutorials in the git repository for 2.3.x.

https://github.com/OpenFOAM/OpenFOAM...stion/chemFoam

Caelan
clapointe is offline   Reply With Quote

Old   July 5, 2017, 17:33
Default
  #10
Member
 
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 11
sahmed is on a distinguished road
Thanks Caelan.
That means you dont need any conversion there and you also have the A-factors as those in chemkin file.
If possible, could you share your thoughts on that mole-kmole issue. By the way, where are those transport parameters in that solver?
sahmed is offline   Reply With Quote

Old   July 5, 2017, 18:01
Default
  #11
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 15
clapointe is on a distinguished road
I'd mentioned the solver originally as a source with an example (empty) transport properties dictionary. Unfortunately I do not have much experience with the solver itself.

As far as the conversion from mol to kmol goes, it is included in the chemkin chemistry reader code:

Code:
    // Calculate the unit conversion factor for the A coefficient
    // for the change from mol/cm^3 to kmol/m^3 concentraction units
    const scalar concFactor = 0.001;
    scalar sumExp = 0.0;
    forAll(lhs, i)
    {
        sumExp += lhs[i].exponent;
    }
    scalar Afactor = pow(concFactor, sumExp - 1.0);

    scalar AfactorRev = Afactor;
Caelan
clapointe is offline   Reply With Quote

Old   July 6, 2017, 12:39
Default
  #12
Member
 
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 11
sahmed is on a distinguished road
Quote:
Originally Posted by asakusa View Post
Actually I gave up and installed the OpenFOAM3.0 which doesn't require the CHEMKINThermodynamicsFile.
Hello Feng
Are you still using version 2.3.x? If so, when you convert the mechanism from CK to OF, did you find the A-factor lowered by factor of 3? Could you PLEASE give me an idea of the rationale there?
sahmed is offline   Reply With Quote

Old   March 4, 2018, 15:46
Default
  #13
New Member
 
Omair
Join Date: May 2017
Posts: 9
Rep Power: 9
m.omair is on a distinguished road
Can we convert the chemkin files with OF 2.3.x and use them in OF 4.1?
Can we install both on a single machine?
m.omair is offline   Reply With Quote

Old   March 5, 2018, 12:39
Default
  #14
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 15
clapointe is on a distinguished road
There was a change from 2.3 to 4 -- version 4 also uses transport properties. I'd be surprised if files produced with version 2.3 worked with version 4. However, you can install multiple versions -- just make sure to source the correct (eg) bashrc file.

Caelan
m.omair likes this.
clapointe is offline   Reply With Quote

Old   March 9, 2018, 16:00
Default
  #15
New Member
 
Omair
Join Date: May 2017
Posts: 9
Rep Power: 9
m.omair is on a distinguished road
ChemkinToFoam reader of OF 4.1 is working without producing any errors now. However, its using constant values for transport data of all species. I just deleted the comments in chemkin files and corrected the format plus some 'intentional' errors in the ethanol mechanism. I was using files from https://combustion.llnl.gov/archived-mechanisms/ethanol
m.omair is offline   Reply With Quote

Old   October 6, 2019, 05:01
Default
  #16
New Member
 
Stefano Doddo
Join Date: Mar 2019
Posts: 7
Rep Power: 7
Stefano.Doddo is on a distinguished road
HI Omair,
Sorry, I tried to run ChemkintoFoam in OF 4.1, with chemkin files of ethanol, but errors appear. Can you post the files after your corrections, please?
Thank you.
Stefano.Doddo is offline   Reply With Quote

Reply

Tags
openfoam4.1 chemkintofoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
question about chemkinToFoam skarnani OpenFOAM 11 September 11, 2013 09:07
small question about the functionalities of topological changes in OpenFoam ngj OpenFOAM Running, Solving & CFD 2 February 28, 2013 11:02
Question Re Engineering Data Source imnull ANSYS 0 March 5, 2012 14:51
internal field question - PitzDaily Case atareen64 OpenFOAM Running, Solving & CFD 2 January 26, 2011 16:26
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 05:37


All times are GMT -4. The time now is 13:18.