Example #1
0
                                 T_high=800.,
                                 statmech_model=ethane_ref.statmech_model,
                                 elements=ethane_ref.elements,
                                 references=refs)
propane_nasa = Nasa.from_statmech(name='propane',
                                  phase='G',
                                  T_low=298.,
                                  T_high=800.,
                                  statmech_model=propane_ref.statmech_model,
                                  elements=propane_ref.elements,
                                  references=refs)
nasa_species = [ethane_nasa, propane_nasa, butane_nasa]

# Determine the output path and write the thermdat file
thermdat_path = os.path.join(notebook_folder, 'thermdat')
write_thermdat(filename=thermdat_path, nasa_species=nasa_species)

THERMO ALL
       100       500      1500
ethane          20190122C   2H   6          G298.0     800.0     502.9         1
-6.84729317E-01 2.54150584E-02-1.02900193E-05-1.15304090E-09 1.73800327E-12    2
-1.08866341E+04 2.42655635E+01 6.77655563E+00-3.31037518E-02 1.63456769E-04    3
-2.32569163E-07 1.18361103E-10-1.16548936E+04-6.74224205E+00                   4
propane         20190122C   3H   8          G298.0     800.0     502.9         1
-2.54716915E+00 4.36640749E-02-2.65978975E-05 6.89956646E-09 7.68567634E-14    2
-1.35353831E+04 3.50227651E+01 8.09253651E+00-4.01657054E-02 2.23439464E-04    3
-3.27632587E-07 1.69405578E-10-1.46259783E+04-9.14554121E+00                   4
butane          20190122C   4H  10          G298.0     800.0     502.9         1
-1.98482876E+00 5.99910769E-02-4.67983727E-05 2.14853318E-08-4.31005098E-12    2
-8.15415828E+05 3.48691129E+01 9.98107805E+00-3.50556935E-02 2.38938732E-04    3
-3.63709779E-07 1.92062158E-10-8.16632302E+05-1.47065846E+01                   4
Example #2
0
    G = single_nasa_species.get_G(units='kcal/mol', T=298.)
    print('{:12}       {:10.1f}       {:15.1f}       {:15.1f}'.format(
        name, H, S, G))

# <a id='section_9_2'></a>

# ## 9.2. Output via Thermdat
# The thermdat format uses NASA polynomials to represent several species. It has a very particular format so doing it manually is error-prone. You can write a list of ``Nasa`` objects to thermdat format using [``pmutt.io.thermdat.write_thermdat``](https://vlachosgroup.github.io/pmutt/io.html#pmutt.io.thermdat.write_thermdat).
#
# Below, we write a thermdat file using the species imported from the spreadsheet.

# In[13]:

from pmutt.io.thermdat import write_thermdat

write_thermdat(filename='./output/thermdat', nasa_species=nasa_species)

# Similarly, a list of ``Nasa`` objects can be read from a thermdat using [``pmutt.io.thermdat.read_thermdat``](https://vlachosgroup.github.io/pMuTT/io.html#pmutt.io.thermdat.read_thermdat).

# In[14]:

from pmutt.io.thermdat import read_thermdat

nasa_species = read_thermdat('./output/thermdat')

# <a id='section_10'></a>

# # 10. Reactions
#
# <img src="images/reaction.png" width=800>
#
Example #3
0
    reaction = ChemkinReaction.from_string(species=species_dict, **reaction_data)
    reactions_list.append(reaction)
reactions = Reactions(reactions=reactions_list)


# ## Writing Chemkin files
# Now that we have all the required objects, we can write the output files. All outputs can be found in the [./outputs folder](https://github.com/VlachosGroup/pmutt/blob/master/docs/source/examples_jupyter/chemkin_io/outputs).

# ### Writing thermdat

# In[11]:


from pmutt.io.thermdat import write_thermdat

write_thermdat(filename='./outputs/thermdat', nasa_species=species)


# The thermdat file can be return as a string by omitting ``filename``.

# In[12]:


thermdat_str = write_thermdat(nasa_species=species)
print(thermdat_str)


# ### Writing gas.inp and surf.inp

# In[13]:
Example #4
0
    G = single_nasa_species.get_G(units='kcal/mol', T=298.)
    print('{:12}       {:10.1f}       {:15.1f}       {:15.1f}'.format(
        name, H, S, G))

# <a id='section_9_2'></a>

# ## 9.2. Output via Thermdat
# The thermdat format uses NASA polynomials to represent several species. It has a very particular format so doing it manually is error-prone. You can write a list of ``Nasa`` objects to thermdat format using [``pmutt.io.thermdat.write_thermdat``](https://vlachosgroup.github.io/pmutt/io.html#pmutt.io.thermdat.write_thermdat).
#
# Below, we write a thermdat file using the species imported from the spreadsheet.

# In[13]:

from pmutt.io.thermdat import write_thermdat

write_thermdat('./output/thermdat', nasa_species)

# Similarly, a list of ``Nasa`` objects can be read from a thermdat using [``pmutt.io.thermdat.read_thermdat``](https://vlachosgroup.github.io/pMuTT/io.html#pmutt.io.thermdat.read_thermdat).

# In[14]:

from pmutt.io.thermdat import read_thermdat

nasa_species = read_thermdat('./output/thermdat')

# <a id='section_10'></a>

# # 10. Reactions
#
# <img src="images/reaction.png" width=800>
#
Example #5
0
T_high = 1100. # K

species = [Nasa.from_statmech(references=refs, T_low=T_low, T_high=T_high, 
                              **specie_data) for specie_data in species_data]
# Printing an example of a Nasa species
print(species[0])


# ## Writing Nasa objects to a Thermdat file

# In[5]:


from pmutt.io.thermdat import write_thermdat

write_thermdat(nasa_species=species, filename='thermdat',
               write_date=True)


# ```
# THERMO ALL
#        100       500      1500
# H2_cus(S)       20181106H   2               S300.0     1100.0    610.2         1
# -1.32355622E-01 1.17210568E-02-1.21067695E-05 6.77414609E-09-1.56703390E-12    2
# -1.96714519E+03-1.13778416E+00-2.37252750E+00 2.60714871E-02-4.73583826E-05    3
#  4.61096590E-08-1.83624246E-11-1.68126562E+03 8.63949434E+00                   4
# H2Obr(S)        20181106H   2O   1          S300.0     1100.0    561.2         1
#  3.33914632E+00 8.65676156E-03-1.03441245E-05 7.11690970E-09-1.91112739E-12    2
# -3.65073462E+04-1.59589792E+01 3.68293150E-01 3.06585581E-02-7.30019576E-05    3
#  8.80731362E-08-4.17597362E-11-3.61771342E+04-3.41520582E+00                   4
# H2Ocus(S)       20181106H   2O   1          S300.0     1100.0    561.2         1
#  3.33914632E+00 8.65676156E-03-1.03441245E-05 7.11690970E-09-1.91112739E-12    2