Problem:Converting Chemkin-format files for n-Heptane(Reduced Mechanism)

229 views
Skip to first unread message

c.ronal sithu

unread,
Aug 30, 2021, 9:49:26 AM8/30/21
to Cantera Users' Group
Hello,

There is a file below I'm now trying to do but I don't know how to convert the n-Heptane(Reduced Mechanism) Chemkin-format files to cti files but there is a problem to install ck2cti. Chemkin-format files for n-Heptane(Reduced Mechanism) links are below:
Please let me know it has something to do with the location where the file is saved. If the file save location is different is any chance the software cannot read.

Best regard,
Sithu

n-Heptane Cantera Command File.txt

Bryan Weber

unread,
Aug 30, 2021, 10:15:38 AM8/30/21
to Cantera Users' Group
Hi Sithu,

If you're having a problem to install ck2cti, can you please paste the error message into a message?

Thanks,
Bryan

c.ronal sithu

unread,
Sep 2, 2021, 9:50:18 PM9/2/21
to canter...@googlegroups.com
Hi Bryan,

Thanks for your reply!
I try the other way and I thought I can convert it to cti file.
image.png
 Sithu


--
You received this message because you are subscribed to a topic in the Google Groups "Cantera Users' Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cantera-users/5h3PcMwOM2I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cantera-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cantera-users/4e8803f9-d8b4-43a4-9924-8b08db936388n%40googlegroups.com.
Screenshot (461).png

c.ronal sithu

unread,
Sep 3, 2021, 2:49:13 AM9/3/21
to canter...@googlegroups.com
Hello
I use the ’chem.cti' file and run it on spyder but some errors are come out. 
Some suggestions on how can I overcome these problems?
image.png

Many thanks in advance!
Sithu
n-Heptane Cantera Command File.txt
chem.cti

Steven DeCaluwe

unread,
Sep 3, 2021, 7:55:53 AM9/3/21
to Cantera Users' Group
Hi Sithu,

1. In the future, if possible, can you please avoid pasting screenshots into messages?  Copying and pasting the text from error messages directly into your post, for example, is preferred.  This way, those messages can be searched by others searching the User Group messages to solve a similar problem.  Also, screenshots cannot be read by screen readers used to help the visually impaired.  Thanks!

2. Best I can tell, the error message indicates an access problem.  Do you have Cantera (or anaconda) installed somewhere on your computer with restricted access?  What happens if you run this from IDLE or a command line?

Best,
Steven


On Sep 3, 2021, at 12:48 AM, c.ronal sithu <csi...@gmail.com> wrote:

Hello
I use the ’chem.cti' file and run it on spyder but some errors are come out. 
Some suggestions on how can I overcome these problems?
<image.png>

Many thanks in advance!
Sithu
On Fri, Sep 3, 2021 at 10:49 AM c.ronal sithu <csi...@gmail.com> wrote:
Hi Bryan,

Thanks for your reply!
I try the other way and I thought I can convert it to cti file.
<image.png>
 Sithu


On Mon, Aug 30, 2021 at 11:15 PM Bryan Weber <bryan....@gmail.com> wrote:
Hi Sithu,

If you're having a problem to install ck2cti, can you please paste the error message into a message?

Thanks,
Bryan

On Monday, August 30, 2021 at 9:49:26 AM UTC-4 csi...@gmail.com wrote:
Hello,

There is a file below I'm now trying to do but I don't know how to convert the n-Heptane(Reduced Mechanism) Chemkin-format files to cti files but there is a problem to install ck2cti. Chemkin-format files for n-Heptane(Reduced Mechanism) links are below:
Please let me know it has something to do with the location where the file is saved. If the file save location is different is any chance the software cannot read.

Best regard,
Sithu


--
You received this message because you are subscribed to a topic in the Google Groups "Cantera Users' Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cantera-users/5h3PcMwOM2I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cantera-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cantera-users/4e8803f9-d8b4-43a4-9924-8b08db936388n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cantera-users/CA%2B9kz%2BZGkgoKjQHHJjiALp%2BmAsQL1FZysBd2vpVXpUncm%3DKTaQ%40mail.gmail.com.
<n-Heptane Cantera Command File.txt><chem.cti>

Thamarai Kannan

unread,
Dec 30, 2021, 8:58:30 AM12/30/21
to Cantera Users' Group
Hi All,

I am facing the same Issue . As, I am trying to run the code which is already shared in our group https://groups.google.com/u/2/g/cantera-users/c/2v_IA9XLpZE/m/RYCC0im1BQAJ  (HCCI.py)  but getting the following error. I guess the error is in my Chem.inp file to cti file conversion. I also learnt that ck2cti.py should be used instead of ctmlwritter.py.  As both my files in the same location don't know how to use it. Can anyone guide me. I am running my Anaconda(Spyder) in ubuntu OS. I also attached my snapshot of file location for your reference. 

CanteraPath.png

canteraError:
***********************************************************************
CanteraError thrown by call_ctml_writer:
Error converting input file "/home/lab427/anaconda3/share/cantera/data/chem.cti" to CTML.
Python command was: '/home/lab427/anaconda3/bin/python'
The exit code was: 3
-------------- start of converter log --------------
/home/lab427/anaconda3/lib/python3.8/site-packages/cantera/ctml_writer.py:2711: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/lab427/anaconda3/share/cantera/data/chem.cti' mode='r' encoding='UTF-8'>
  text = open(filename, open_mode).readlines()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
SyntaxError in "/home/lab427/anaconda3/share/cantera/data/chem.cti" on line 2:

|  Line |
|     1 | ELEMENTS
|     2 | C  H  N  O  AR HE
             ^
|     3 | END
|     4 | SPECIES
|     5 | N2               O2               H2O              H2O2             CO               CO2              CH2O
--------------- end of converter log ---------------
***********************************************************************

Thank you,
Regards,
Thamarai kannan M

Ray Speth

unread,
Jan 6, 2022, 9:19:35 AM1/6/22
to Cantera Users' Group
Hi Thamarai kannan M,

The file that you've apparently named "chem.cti" is a Chemkin format mechanism, not one of Cantera's formats (CTI, XML, or YAML). That file should be converted to the Cantera YAML format first using the "ck2yaml.py" script. You should be able to run this from a command prompt within Spyder, assuming you have activated your Cantera conda environment first. There is a tutorial on how to use ck2yaml on the Cantera website, which I hope you will find helpful. I don't use Spyder, so I can't really provide any help with the specifics there.

Regards,
Ray
Reply all
Reply to author
Forward
0 new messages