|
[Sponsors] |
February 9, 2020, 00:34 |
chemkinToFoam parsing issues? (v19)
|
#1 |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Does anyone know of specific limitations of the chemkinToFoam parsing utility? It throws very unhelpful errors. This is the chemistry suite I'm trying to use:
https://combustion.llnl.gov/mechanis...-pah-formation The chemkin and thermo files are available. I was trying to troubleshoot this using the OF tutorial DLR_A_LTS which imports GRIMech 3.0 correctly. So it seems, at least in principle, that the chemkinToFoam utility should work. Is there any way to get support from OF on these types of issues? Thank You Very Much, Patricia |
|
February 9, 2020, 12:37 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Why not? OpenFOAM is open. It would even better if you come up with your own code with your own suggestions.
I would create a feature request in OpenFOAM's issue tracker.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 9, 2020, 12:48 |
|
#3 |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Thanks - I didn't know they had an issue tracker. I could try reading the C code, but I never learnt C.
|
|
February 9, 2020, 13:02 |
|
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Raise your concerns there then. Might the maintainers try to help you out?
As a side note, OpenFOAM is C++11. There is no C inside. Hope you find a solution.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 9, 2020, 13:33 |
|
#5 |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Thank you - I do also. There are very powerful chemical mechanisms which are unavailable to OpenFOAM at the present time, even though they are in chemkin format.
EDIT: issue tracker https://bugs.openfoam.org/view.php?id=3450 Last edited by pattim; February 9, 2020 at 17:12. Reason: added info |
|
February 10, 2020, 12:50 |
|
#6 | |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Quote:
Also in the spirit of that, I am taking some classes on c++ - it's not that different from other programming languages I've used. I was able to import OpenFOAM source tree into code::blocks - it searched the /opt/OpenFOAM directory tree for all the files. I'm not sure that's the best way to go, but at least I can search through all the related header and .C files and begin to understand the code hierarchy so I can begin to read through and look for whatever errors may be responsible for not importing chemkin mech/thermo files. EDIT: This is going to take a LONG time. :^( |
||
February 10, 2020, 15:11 |
|
#7 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
Please see if you can use these two files. They work with the chemkinToFoam utility in OpenFOAM 2.3.1.
The following changes were made to the original files downloaded from the link you provided: 1. The files are converted from lower to upper case. Fortran is case insensitive, whereas C++ is case sensitive. 2. I prefer to run dos2unix on these files before using them on Linux. 3. In the chem.inp file the elements, species, and reactions blocks are retained while the thermo block (which was empty) was removed. The blocks are also formatted in this way as shown for the elements block (notice the line breaks): Code:
ELEMENTS H O C AR N END Code:
THERMO Code:
THERMO ALL Code:
AR 120186AR 1 G 0300.00 5000.00 1000.00 1 0.02500000E+02 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2 -0.07453750E+04 0.04366001E+02 0.02500000E+02 0.00000000E+00 0.00000000E+00 3 0.00000000E+00 0.00000000E+00-0.07453750E+04 0.04366001E+02 4 Hope that helps a bit. |
|
February 10, 2020, 20:59 |
|
#8 |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Thank you very much! It's really remarkable you could figure that all out so easily. Many of the errors chemkinToFoam gives aren't very helpful, apparently.
I was feeling very overwhelmed trying to read and understand all the separate files that go into the chemkinToFoam parser - it's difficult to maintain as the code is in many different files. (Since it is *only* used once in the code suite to translate files, I don't understand why chemkinToFoam isn't just a single flat file - it would be more immune to version upgrades/changes.) I tried your files but received an error. Luckily, it was easy to guess a fix from that error - just by removing the first two species from the therm.dat file. You said v2.3.1 OpenFOAM was able to parse these two species? I guess they lost that capability during maintenance of OF. Error: Code:
bash@OpenFoam >>> chemkinToFoam chem.inp therm.dat transportProperties chem thermo /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1912 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : _e53419c0-20200203 OPENFOAM=1912 patch=200129 Arch : "LSB;label=32;scalar=64" Exec : chemkinToFoam chem.inp therm.dat transportProperties chem thermo Date : Feb 10 2020 Time : 17:43:30 Host : linux-lhkc PID : 14597 I/O : uncollated Case : /home/patti/OpenFOAM/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/chemkin nProcs : 1 trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // --> FOAM FATAL IO ERROR: Unexpected token encountered for CH2O - on line 10460: punctuation ')' file: input at line 10460. From function static bool Foam::entry::New(Foam::dictionary&, Foam::Istream&, Foam::entry::inputMode, int) in file db/dictionary/entry/entryIO.C at line 291. FOAM exiting bash@OpenFoam >>> Code:
(CH2O)3 70590C 3H 6O 3 G 0300.00 4000.00 1500.00 1 0.01913678E+03 0.08578044E-01-0.08882060E-05-0.03574819E-08 0.06605143E-12 2 -0.06560876E+06-0.08432507E+03-0.04662286E+02 0.06091547E+00-0.04710536E-03 3 0.01968843E-06-0.03563271E-10-0.05665404E+06 0.04525265E+03 4 (CH3)2SICH2 61991H 8C 3SI 1 G 0300.00 2500.00 1500.00 1 0.01547852E+03 0.01065700E+00-0.01234345E-05-0.01293352E-07 0.02528715E-11 2 -0.06693076E+04-0.05358884E+03 0.02027522E+02 0.04408673E+00-0.03370024E-03 3 0.01484466E-06-0.02830898E-10 0.03931454E+05 0.01815821E+03 4 I don't believe the LLNL mechanism uses those first two species - that thermo file is a very comprehensive file (all available species, including metals). There are comprehensive thermo files on Burcat's web page, containing all known species for which thermo data exists. I don't see why OpenFOAM doesn't just maintain a comprehensive thermo file in native OF format. If someone needed to add a couple of species, the OF format is easy to deal with - easier than a complex c++ code interpreter! I noticed also comments in the c++ code saying that bits of chemkinToFoam were "hacks" until someone could "figure out chemkin formatting." So it might be worthwhile to translate the LLNL mechanisms and keep them in OF (they already have several in v19.12). Maybe I'll make tutorials using LLNL and send to OF folks? I realized that the thermo files had odd 2-digit endings for many species - I had assumed that was chemkin-III formatting. But I didn't try fixing that. Also, I found a couple of lines in the chem mech file that didn't have "!" preceding a reaction's references/comments, but I guess the chemkinToFoam code is robust enough to not be fooled by random text at the end of mech file reaction lines. Also, thank you very much for the reminder about dos2unix - I had forgotten about that utility. Patricia PS: I meant to ask if the version of OF you're using has TDAC chemistry reduction built into it? I wonder if v19.12 is really that much better than v2.3.1? |
|
February 13, 2020, 13:48 |
|
#9 | ||||
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
Not easily my friend, years of frustration and yelling at the monitor.
Quote:
Quote:
Quote:
Quote:
https://github.com/fcontino/TDAC That I don't know, since I have never used version 19.12. But I think they are not part of the same series of OpenFOAM releases, so there may be differences because of that. |
|||||
February 15, 2020, 18:46 |
|
#10 |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Lots of time yelling at computers, yes!
About "(" - I agree it's a serious bug, but I've not received positive feedback any time I've contacted the developers (other than requests for funding), so I'm going to let this slide. About the "missing !'s" - I looked again at the original files but couldn't find the missing ones. Apparently I was mistaken - I was laboriously trying to remove all comments in case *that* was the problem with chemkinToFoam not working. I must have deleted them myself. I agree about the THERMO data. Now that I recall, I've seen publications where they modified that data as an integral part of their combustion suite. I see FreeFOAM has been disbanded. I guess CFD Online is now the repository of knowledge? I'm glad you uploaded those LLNL mechanism files. I want to try the other mechanisms on LLNL and see if I can upload them somewhere useful. |
|
February 15, 2020, 18:53 |
|
#11 | |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Quote:
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
||
February 20, 2020, 15:16 |
|
#12 |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Oh, is that the wrong place? I know they closed the issue I added. What's the right place to put that? EDIT: I found https://develop.openfoam.com/Development/openfoam/issues
EDIT2: Is there a tool for coordinating all the input species in OF? It seems like a GUI tool or even a script might help all species mass fractions to sum to 1.0. I wonder if Qt or Gambas or Python could do that. I don't know if c++ has a gui creator. |
|
February 20, 2020, 15:39 |
|
#13 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Oh no no nothing wrong with Mantis! Mantis is good! I just meant GitLab, that was it. Funding of maintenance of OpenFOAM is limited; OpenFOAM is free, but not its maintenance! They don't have time for the feature request there, I believe. That's why they had to close it I think. Try with GitLab as well.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
December 21, 2021, 05:17 |
|
#14 |
Member
Amirreza Niazmehr
Join Date: Nov 2018
Posts: 40
Rep Power: 8 |
Hi guys, I hope you are doing well
I'm going to use one of the tutorial of OpenFoam which is concerned with cumbustion (SandiaD_LTS), but I want to change the chemical mechanism of cumbustion in this tutorial. I changed these two files: "grimech30.dat" and "thermo30.dat" in the Chemkin folder according to my mechanism but after running OpenFoam, I undestood that my changes has not been compiled and OpenFoam did not notice my changes. Can you help me to resolve this problem? |
|
December 21, 2021, 11:39 |
|
#15 | |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Quote:
|
||
January 29, 2023, 12:26 |
density-based solvers?
|
#16 | |
Member
Patti Michelle Sheaffer
Join Date: Sep 2018
Posts: 55
Rep Power: 8 |
Quote:
Best Regards, PattiM |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
question about chemkinToFoam | asakusa | OpenFOAM | 15 | October 6, 2019 05:01 |
chtMultiRegionSimpleFoam issues - non-conformal meshes & residual handling... | manalis | OpenFOAM Running, Solving & CFD | 3 | October 10, 2018 19:53 |
Convergence issues for Flat plate with sharp edge | rajnarayang | FLUENT | 3 | June 20, 2017 13:02 |
[ANSYS Meshing] Multizone issues (on my project) | crenaudo | ANSYS Meshing & Geometry | 8 | April 13, 2016 03:59 |
Multigrid Stability Issues | ThomasHermann | SU2 | 1 | November 5, 2014 17:18 |