Technical Blog | All posts with tag: any tag , RPA, Release Notes, cycle analysis, news, thermodynamics

How to add new species into thermodynamic data library

24-Jun-2014, 11:24 GMT | Tags: RPA, thermodynamics

RPA delivers the comprehensive thermodynamic data library out of the box. This library is mainly based on NASA Glenn thermodynamic database and contains data for both reaction products and reactants (propellant components) such as liquid hydrogen, RP-1, RG-1, Synthine, liquid methane, liquid propane, monomethyl hydrazine (MMH), unsymmetrical dimethyl hydrazine (UDMH), liquid oxygen, nitrogen tetroxide, hydrogen peroxide, and many other.

Still, the user may want to define custom propellant components or even reaction products to solve some special cases.


Table of contents

Standard Library

The standard library is maintained by the developer of RPA and shipped as a part of RPA distribution package. After installation of RPA, the standard library can be found at

<RPA installation directory>\resources\thermo.inp

For example, after installation of RPA Standard Edition v.2.2.x on Windows using default installation configuration, the path to the standard library is

C:\Program Files\RPA\2.2\standard\resources\thermo.inp

When the user downloads and installs an update of RPA, the standard library is automatically updated as well. Therefore, if the user modified the standard library (e.g. has added new species, or altered existing species) all modifications will be lost. To make persistent changes to the data library, new species, as well as modified species, have to be added into the user library.

User Library

User library is maintained by the end user. The library is located in the user data. On Windows 7, the file is located at

C:\Users\<user.name>\AppData\Local\RPA\resources\usr_thermo.inp

Because the user library is stored separately from the standard library, the content stays untouched after re-installation or update of RPA.

Format of library file

The library is stored as an ASCII file and may be modified by the end user either with an embedded thermodynamic database editor or using any text editor which is able to work with ASCII files. On MS Windows, we suggest to use Notepad++ which can, in general, be used as a complete replacement for standard Windows Notepad.

The format of the file is described in paper RP-1311-P2 by Gordon, S. and McBride, B.J. (Appendix A, p.73), as well as on the page NASA Glenn thermodynamic database:

Line
ContentsC scanf format
Columns
1

Species name or formula

%16s

1 to 16

Comments and data source

%62s

19 to 80

2

Number of T intervals

%2d

1 to 2

Reference data code

%6s

4 to 9

Chemical formula: symbols (all capitals) and numbers

5 times %2s%6.2f

11 to 50

Zero for gas; nonzero for condensed
Condensed phases are numbered in increasing order by temperature

%2d

51 to 52

Molecular weight

%13.7f

53 to 65

Heat of formation at 298.15 K, J/mol

%15.5f

66 to 80

3

Temperature range

2 times %11.3f

1 to 22

Number of coefficients for (always seven)

%1d

23

T exponents in empirical equation for (always –2, –1, 0, 1, 2, 3, 4)

8 times %5.1f

24 to 63

H0(298.15) – H0(0) J/mol, if available

%15.3f

66 to 80

4

First five coefficients for

5 times %16.9f

1 to 80

5

Last two coefficients for

2 times %16.9f

1 to 32

Integration constants b1 and b2

2 times %16.9f

49 to 80

Repeat lines 3, 4, and 5 for each T interval (see line 2)

Therefore, to add new propellant component, the user has to provide the following minimum information:

  • chemical formula
  • molecular weight
  • aggregate state at normal conditions (gaseous or liquid/solid)
  • heat of formation at standard conditions (J/mol)

For example, the following data describes the fuel Synthine

  • chemical formula: C10H16
  • molecular weight: 136.23404
  • aggregate state at normal conditions: liquid
  • heat of formation at standard conditions: 133509.36 J/mol

This information can be added into the library files in the following format:

# 1 2 3 4 5 6 7 8
#2345678901234567890123456789012345678901234567890123456789012345678901234567890
#
C10H16(L) Synthine (aka syntin or sintin). Synthetic hydrocarbon fuel 
 0 C 10.00H 16.0 0.00 0.00 0.00 1 136.23404 133509.36
  298.150 0.0000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000

Important note: the exact position and format of every piece of information is very important! Otherwise the species data won’t be parsed correctly.

Using embedded editor to add new or change existing species

Direct modification of data library file requires that the all pieces of information are entered exactly in proper position and proper format. This may be challenging, if user need to enter the data for several species, and especially challenging in case when user enters the data for reaction products which contains one or more temperature intervals (repeating lines 3-5).

To make it easier, RPA provides embedded thermodynamic database editor.

You can use the thermodynamic database editor both for adding new species and editing existing species. All modifications of species in Standard Library are stored in the User Library, so that modifications stay untouched after re-installation or update of RPA.

Import of species from PROPEP or CEA2 databases

You may import any component from PROPEP or CEA2 species databases, using function Import of embedded thermodynamic database editor. All imported species are stored in the User Library.

Preparing database entries using NASA utility PAC

Utility PAC (Properties and Coefficients) is written in Fortran IV programming lanuage and can be compiled with most of modern Fortran compilers. The source code of the utility is available within the CEA distribution package on the NASA GRC site.

The utility is used to calculate the polynomial coefficients from thermodynamic data available in tabular form. The output is the database records in the proper format which can be copied and pasted into the user library "as is".

Example of PAC input data for ZnO, ZnO(a) and ZnO(L) obtained from IVTANTHERMO thermodynamic database:

NAME  ZnO               Zinc oxide. IVTANTHERMO  database.
Zn1O1                   HF298 110424      JOULES
DATE  I 264                                  
OUTP  LOGK              JOULES            LSQS
METHODREADIN            H298H0 -1119                        JOULES
      T     298.15      CP    31.804      S     223.654     H-H0  8877
      T     300.00      CP    31.845      S     223.851     H-H0  8936
      T     400.00      CP    33.521      S     233.262     H-H0  12212
      T     500.00      CP    34.600      S     240.866     H-H0  15621
      T     600.00      CP    35.365      S     247.245     H-H0  19121
      T     700.00      CP    35.926      S     252.741     H-H0  22687
      T     800.00      CP    36.340      S     257.567     H-H0  26302
      T     900.00      CP    36.645      S     261.865     H-H0  29952
      T     1000.00     CP    36.870      S     265.739     H-H0  33628
      T     1100.00     CP    37.039      S     269.261     H-H0  37324
      T     1200.00     CP    37.176      S     272.490     H-H0  41035
      T     1300.00     CP    37.301      S     275.470     H-H0  44759
      T     1400.00     CP    37.436      S     278.240     H-H0  48495
      T     1500.00     CP    37.600      S     280.828     H-H0  52247
      T     1500.00     CP    37.940      S     280.843     H-H0  52270
      T     1600.00     CP    37.748      S     283.284     H-H0  56052
      T     1700.00     CP    37.722      S     285.571     H-H0  59825
      T     1800.00     CP    37.829      S     287.730     H-H0  63601
      T     1900.00     CP    38.044      S     289.780     H-H0  67394
      T     2000.00     CP    38.347      S     291.739     H-H0  71213
      T     2100.00     CP    38.725      S     293.619     H-H0  75066
      T     2200.00     CP    38.163      S     295.430     H-H0  78960
      T     2300.00     CP    39.653      S     297.182     H-H0  82900
      T     2400.00     CP    40.185      S     298.880     H-H0  86892
      T     2500.00     CP    40.753      S     300.532     H-H0  90939
      T     2600.00     CP    41.350      S     302.142     H-H0  95043
      T     2700.00     CP    41.970      S     303.714     H-H0  99209
      T     2800.00     CP    42.610      S     305.252     H-H0  103438
      T     2900.00     CP    43.263      S     306.759     H-H0  107732
      T     3000.00     CP    43.927      S     308.237     H-H0  112091
      T     3100.00     CP    44.598      S     309.688     H-H0  116517
      T     3200.00     CP    45.272      S     311.114     H-H0  121011
      T     3300.00     CP    45.946      S     312.518     H-H0  125572
      T     3400.00     CP    46.616      S     313.899     H-H0  130200
      T     3500.00     CP    47.281      S     315.260     H-H0  134895
      T     3600.00     CP    47.936      S     316.601     H-H0  139656
      T     3700.00     CP    48.580      S     317.924     H-H0  144482
      T     3800.00     CP    49.210      S     319.228     H-H0  149371
      T     3900.00     CP    49.823      S     320.514     H-H0  154323
      T     4000.00     CP    50.416      S     321.783     H-H0  159335
      T     4100.00     CP    50.988      S     323.035     H-H0  164406
      T     4200.00     CP    51.536      S     324.270     H-H0  169532
      T     4300.00     CP    52.057      S     325.489     H-H0  174712
      T     4400.00     CP    52.549      S     326.691     H-H0  179942
      T     4500.00     CP    53.011      S     327.878     H-H0  185221
      T     4600.00     CP    53.438      S     329.047     H-H0  190543
      T     4700.00     CP    53.830      S     330.201     H-H0  195907
      T     4800.00     CP    54.185      S     331.338     H-H0  201308
      T     4900.00     CP    54.499      S     332.459     H-H0  206743
      T     5000.00     CP    54.771      S     333.562     H-H0  212207
      T     5100.00     CP    54.998      S     334.649     H-H0  217695
      T     5200.00     CP    55.179      S     335.719     H-H0  223205
      T     5300.00     CP    55.311      S     336.771     H-H0  228730
      T     5400.00     CP    55.392      S     337.806     H-H0  234265
      T     5500.00     CP    55.420      S     338.823     H-H0  239806
      T     5600.00     CP    55.392      S     339.821     H-H0  245347
      T     5700.00     CP    55.307      S     340.801     H-H0  250883
      T     5800.00     CP    55.163      S     341.762     H-H0  256407
      T     5900.00     CP    54.957      S     342.703     H-H0  261913
      T     6000.00     CP    54.688      S     343.625     H-H0  267396
FINISH
NAME  ZnO(a)            Zinc oxide. IVTANTHERMO  database.
NAME  ZnO(L)            Zinc oxide, liquid. IVTANTHERMO  database.
Zn1O1(S)                HF298 -350460     JOULES
DATE  I 263                                  
OUTP  BAR
OUTP  LOGK              JOULES            LSQS
METHODREADIN            H298H0 -3065      MELTPT  2248.00   JOULES
      T     298.15      CP    41.089      S     43.640      H-H0  6970
      T     300.00      CP    41.182      S     43.894      H-H0  7046
      T     400.00      CP    44.683      S     56.278      H-H0  11359
      T     500.00      CP    46.697      S     66.481      H-H0  15935
      T     600.00      CP    48.124      S     75.127      H-H0  20679
      T     700.00      CP    49.274      S     82.634      H-H0  25551
      T     800.00      CP    50.277      S     89.281      H-H0  30529
      T     900.00      CP    51.195      S     95.256      H-H0  35604
      T     1000.00     CP    52.059      S     100.695     H-H0  40767
      T     1100.00     CP    52.888      S     105.696     H-H0  46014
      T     1200.00     CP    53.694      S     110.333     H-H0  51344
      T     1300.00     CP    54.483      S     114.662     H-H0  56753
      T     1400.00     CP    55.260      S     118.728     H-H0  62240
      T     1500.00     CP    56.028      S     122.566     H-H0  67804
      T     1600.00     CP    56.789      S     126.207     H-H0  73445
      T     1700.00     CP    57.545      S     129.672     H-H0  79162
      T     1800.00     CP    58.296      S     132.983     H-H0  84954
      T     1900.00     CP    59.045      S     136.155     H-H0  90821
      T     2000.00     CP    59.790      S     139.202     H-H0  96763
      T     2100.00     CP    60.534      S     142.137     H-H0  102779
      T     2200.00     CP    61.276      S     144.971     H-H0  108869
      T     2248.00     CP    61.632      S     146.297     H-H0  111819
      T     2248.00     CP    67.000      S     163.201     H-H0  149820
      T     2300.00     CP    67.000      S     164.733     H-H0  153304
      T     2400.00     CP    67.000      S     167.585     H-H0  160004
      T     2500.00     CP    67.000      S     170.320     H-H0  166704
      T     2600.00     CP    67.000      S     172.947     H-H0  173404
      T     2700.00     CP    67.000      S     175.476     H-H0  180104
      T     2800.00     CP    67.000      S     177.913     H-H0  186804
      T     2900.00     CP    67.000      S     180.264     H-H0  193504
      T     3000.00     CP    67.000      S     182.535     H-H0  200204
      T     3100.00     CP    67.000      S     184.732     H-H0  206904
      T     3200.00     CP    67.000      S     186.859     H-H0  213604
      T     3300.00     CP    67.000      S     188.921     H-H0  220304
      T     3400.00     CP    67.000      S     190.921     H-H0  227004
      T     3500.00     CP    67.000      S     192.863     H-H0  233704
      T     3600.00     CP    67.000      S     194.751     H-H0  240404
      T     3700.00     CP    67.000      S     196.586     H-H0  247104
      T     3800.00     CP    67.000      S     198.373     H-H0  253804
      T     3900.00     CP    67.000      S     200.114     H-H0  260504
      T     4000.00     CP    67.000      S     201.810     H-H0  267204
FINISH

Output database entries for ZnO, ZnO(a) and ZnO(L):

ZnO               Zinc oxide. IVTANTHERMO  database.                      
  3 I 264  Zn  1.00O   1.00    0.00    0.00    0.00 0   15.9994000     110424.000
     298.150  1000.000 7 -2.0 -1.0  0.0  1.0  2.0  3.0  4.0  0.0         8877.000
 -2.369001283D+04 3.979603870D+01 3.426733720D+00 2.292162352D-03-1.904711476D-06
  6.743120360D-10-7.018528000D-14 0.000000000D+00 1.186664882D+04 6.770751650D+00
    1000.000  1500.000 6 -2.0 -1.0  0.0  1.0  2.0  3.0  0.0  0.0         8877.000
  2.242963041D+06-9.260787130D+03 1.868681074D+01-1.032529653D-02 3.494106010D-06
 -4.033787740D-10 0.000000000D+00 0.000000000D+00 6.788388660D+04-9.654964850D+01
    1500.000  6000.000 7 -2.0 -1.0  0.0  1.0  2.0  3.0  4.0  0.0         8877.000
 -1.228456857D+07 3.062290075D+04-2.305495674D+01 1.127739552D-02-2.251901115D-06
  2.622424691D-10-1.417859308D-14 0.000000000D+00-1.895235800D+05 2.054090663D+02

ZnO(a)            Zinc oxide. IVTANTHERMO  database.                      
  1 I 263  Zn  1.00O   1.00    0.00    0.00    0.00 1   15.9994000    -350460.000
     298.150  2248.000 7 -2.0 -1.0  0.0  1.0  2.0  3.0  4.0  0.0         6970.000
 -6.800850490D+04-4.929954250D+00 5.467477100D+00 8.531084130D-04 2.028765743D-08
 -7.914355850D-12 1.188215582D-15 0.000000000D+00-4.401863240D+04-2.655707580D+01

ZnO(L)            Zinc oxide, liquid. IVTANTHERMO  database.              
  1 I 263  Zn  1.00O   1.00    0.00    0.00    0.00 2   15.9994000    -350460.000
    2248.000  4000.000 7 -2.0 -1.0  0.0  1.0  2.0  3.0  4.0  0.0         6970.000
  2.114407780D+06-4.128956490D+03 1.139338179D+01-1.426601113D-03 3.408349010D-07
 -4.312790050D-11 2.258364368D-15 0.000000000D+00-1.521144212D+04-6.743612890D+01



Copyright © 2009 - 2017 Alexander Ponomarenko