Athena++/Atmosphere
Planetary Atmosphere Simulator
jupiter_real_gas_cp.cpp
Go to the documentation of this file.
1 // Table of realistic cp of Jupiter's atmosphere
2 // Generated by Cheng Li (cli@gps.caltech.edu) for Juno MWR using Armada-3.0 model output
3 // Includes temperature dependent cp from H2, He and CH4
4 // Shomate equations are used for T > 300, assuming normal H2.
5 // Rotational lines are used for T < 300.
6 // Data file if mwr_PJ01_p01.8_2.7x2.7.atm
7 // California Institute of Technology
8 // Aug 11, 2019
9 
10 #include "../athena.hpp"
11 #include "../math/interpolation.h"
12 
13 Real cp[400] = { // J/(mol K)
14  21.24, 21.26, 21.29, 21.31, 21.34, 21.37, 21.39, 21.42, 21.45, 21.48,
15  21.52, 21.55, 21.59, 21.62, 21.66, 21.69, 21.73, 21.77, 21.81, 21.85,
16  21.90, 21.94, 21.98, 22.03, 22.08, 22.12, 22.17, 22.22, 22.27, 22.32,
17  22.37, 22.42, 22.48, 22.53, 22.59, 22.64, 22.70, 22.75, 22.81, 22.87,
18  22.92, 22.98, 23.04, 23.10, 23.16, 23.22, 23.28, 23.34, 23.40, 23.46,
19  23.52, 23.58, 23.64, 23.70, 23.76, 23.83, 23.89, 23.95, 24.01, 24.07,
20  24.13, 24.19, 24.25, 24.31, 24.37, 24.43, 24.49, 24.55, 24.61, 24.66,
21  24.72, 24.78, 24.83, 24.89, 24.94, 25.00, 25.06, 25.11, 25.17, 25.22,
22  25.28, 25.33, 25.39, 25.44, 25.49, 25.55, 25.60, 25.65, 25.70, 25.75,
23  25.80, 25.85, 25.90, 25.95, 25.99, 26.04, 26.09, 26.14, 26.18, 26.23,
24  26.27, 26.31, 26.36, 26.40, 26.44, 26.49, 26.53, 26.57, 26.61, 26.65,
25  26.69, 26.73, 26.76, 26.80, 26.84, 26.87, 26.91, 26.94, 26.98, 27.01,
26  27.04, 27.08, 27.11, 27.14, 27.17, 27.20, 27.23, 27.26, 27.28, 27.31,
27  27.34, 27.36, 27.39, 27.41, 27.44, 27.46, 27.48, 27.50, 27.53, 27.55,
28  27.57, 27.59, 27.60, 27.62, 27.64, 27.66, 27.68, 27.69, 27.71, 27.73,
29  27.74, 27.76, 27.77, 27.79, 27.80, 27.81, 27.83, 27.84, 27.85, 27.86,
30  27.88, 27.89, 27.90, 27.91, 27.92, 27.93, 27.94, 27.95, 27.95, 27.96,
31  27.97, 27.98, 27.99, 27.99, 28.00, 28.01, 28.01, 28.02, 28.03, 28.03,
32  28.04, 28.04, 28.05, 28.05, 28.06, 28.06, 28.07, 28.07, 28.08, 28.08,
33  28.08, 28.09, 28.09, 28.10, 28.10, 28.10, 28.10, 28.11, 28.11, 28.11,
34  28.12, 28.12, 28.12, 28.12, 28.12, 28.13, 28.13, 28.13, 28.13, 28.13,
35  28.14, 28.14, 28.14, 28.14, 28.14, 28.15, 28.15, 28.15, 28.15, 28.15,
36  28.16, 28.16, 28.16, 28.16, 28.16, 28.17, 28.17, 28.17, 28.17, 28.18,
37  28.18, 28.18, 28.18, 28.19, 28.19, 28.19, 28.19, 28.20, 28.20, 28.21,
38  28.21, 28.21, 28.22, 28.22, 28.23, 28.23, 28.23, 28.24, 28.24, 28.25,
39  28.26, 28.26, 28.27, 28.27, 28.28, 28.29, 28.29, 28.30, 28.31, 28.32,
40  28.32, 28.33, 28.34, 28.35, 28.36, 28.37, 28.38, 28.39, 28.40, 28.41,
41  28.42, 28.43, 28.44, 28.46, 28.47, 28.48, 28.50, 28.51, 28.52, 28.54,
42  28.55, 28.57, 28.58, 28.60, 28.61, 28.63, 28.65, 28.67, 28.68, 28.70,
43  28.72, 28.74, 28.76, 28.78, 28.80, 28.82, 28.84, 28.86, 28.89, 28.91,
44  28.93, 28.96, 28.98, 29.01, 29.03, 29.06, 29.08, 29.11, 29.14, 29.16,
45  29.19, 29.22, 29.25, 29.28, 29.31, 29.34, 29.37, 29.40, 29.43, 29.46,
46  29.49, 29.53, 29.56, 29.59, 29.63, 29.66, 29.70, 29.73, 29.77, 29.80,
47  29.84, 29.87, 29.91, 29.95, 29.99, 30.02, 30.06, 30.10, 30.14, 30.18,
48  30.22, 30.25, 30.29, 30.33, 30.37, 30.41, 30.45, 30.49, 30.53, 30.58,
49  30.62, 30.66, 30.70, 30.74, 30.78, 30.82, 30.87, 30.91, 30.95, 30.99,
50  31.04, 31.08, 31.12, 31.16, 31.21, 31.25, 31.29, 31.34, 31.38, 31.42,
51  31.47, 31.51, 31.55, 31.60, 31.64, 31.68, 31.73, 31.77, 31.81, 31.86,
52  31.90, 31.94, 31.99, 32.03, 32.08, 32.12, 32.16, 32.21, 32.25, 32.29,
53  32.34, 32.38, 32.42, 32.47, 32.51, 32.55, 32.60, 32.64, 32.68, 32.72};
54 
55 Real temp[400] = { // K;
56  73.04, 73.84, 74.64, 75.45, 76.27, 77.10, 77.93, 78.78, 79.63, 80.49,
57  81.35, 82.23, 83.11, 84.00, 84.90, 85.81, 86.72, 87.65, 88.58, 89.52,
58  90.47, 91.42, 92.39, 93.36, 94.34, 95.33, 96.32, 97.33, 98.34, 99.36,
59  100.39, 101.43, 102.48, 103.53, 104.59, 105.66, 106.74, 107.83, 108.93, 110.03,
60  111.14, 112.27, 113.39, 114.53, 115.68, 116.83, 118.00, 119.17, 120.35, 121.54,
61  122.73, 123.94, 125.16, 126.38, 127.61, 128.85, 130.10, 131.35, 132.62, 133.89,
62  135.17, 136.46, 137.75, 139.06, 140.37, 141.68, 143.00, 144.33, 145.66, 147.00,
63  148.33, 149.67, 151.00, 152.34, 153.70, 155.13, 156.56, 158.01, 159.46, 160.93,
64  162.40, 163.89, 165.38, 166.89, 168.40, 169.93, 171.47, 173.02, 174.58, 176.15,
65  177.73, 179.32, 180.92, 182.54, 184.16, 185.80, 187.45, 189.11, 190.79, 192.47,
66  194.17, 195.88, 197.59, 199.33, 201.07, 202.83, 204.60, 206.38, 208.18, 209.98,
67  211.80, 213.64, 215.48, 217.34, 219.21, 221.10, 222.99, 224.90, 226.82, 228.76,
68  230.70, 232.66, 234.63, 236.61, 238.60, 240.60, 242.62, 244.63, 246.66, 248.70,
69  250.74, 252.78, 254.83, 256.87, 258.92, 260.97, 263.01, 265.04, 267.07, 269.08,
70  271.08, 273.07, 275.09, 277.12, 279.15, 281.16, 283.16, 285.15, 287.12, 289.14,
71  291.55, 293.99, 296.43, 298.90, 301.39, 303.90, 306.42, 308.97, 311.54, 314.12,
72  316.73, 319.36, 322.01, 324.68, 327.37, 330.08, 332.81, 335.57, 338.34, 341.14,
73  343.96, 346.81, 349.68, 352.56, 355.48, 358.41, 361.37, 364.36, 367.36, 370.39,
74  373.45, 376.53, 379.64, 382.77, 385.92, 389.10, 392.31, 395.54, 398.80, 402.09,
75  405.40, 408.74, 412.10, 415.50, 418.92, 422.36, 425.84, 429.35, 432.88, 436.44,
76  440.03, 443.65, 447.30, 450.98, 454.69, 458.43, 462.20, 466.00, 469.83, 473.69,
77  477.59, 481.51, 485.47, 489.46, 493.48, 497.54, 501.63, 505.75, 509.90, 514.09,
78  518.32, 522.58, 526.87, 531.20, 535.56, 539.96, 544.39, 548.86, 553.37, 557.91,
79  562.49, 567.11, 571.76, 576.45, 581.18, 585.95, 590.76, 595.61, 600.49, 605.41,
80  610.38, 615.38, 620.43, 625.51, 630.64, 635.81, 641.02, 646.27, 651.56, 656.90,
81  662.27, 667.69, 673.16, 678.67, 684.22, 689.81, 695.45, 701.14, 706.87, 712.64,
82  718.46, 724.33, 730.24, 736.20, 742.20, 748.25, 754.35, 760.50, 766.70, 772.94,
83  779.23, 785.57, 791.96, 798.40, 804.88, 811.42, 818.01, 824.65, 831.34, 838.08,
84  844.87, 851.71, 858.60, 865.55, 872.55, 879.60, 886.70, 893.86, 901.07, 908.33,
85  915.65, 923.02, 930.44, 937.92, 945.46, 953.05, 960.69, 968.39, 976.15, 983.96,
86  991.83, 999.75, 1007.74, 1015.77, 1023.87, 1032.02, 1040.23, 1048.50, 1056.83, 1065.21,
87  1073.66, 1082.16, 1090.72, 1099.34, 1108.02, 1116.76, 1125.56, 1134.41, 1143.33, 1152.31,
88  1161.36, 1170.46, 1179.62, 1188.84, 1198.13, 1207.48, 1216.88, 1226.36, 1235.89, 1245.48,
89  1255.14, 1264.86, 1274.65, 1284.48, 1294.40, 1304.38, 1314.42, 1324.53, 1334.70, 1344.93,
90  1355.23, 1365.60, 1376.03, 1386.52, 1397.09, 1407.72, 1418.41, 1429.17, 1440.00, 1450.90,
91  1461.86, 1472.90, 1484.00, 1495.17, 1506.40, 1517.71, 1529.07, 1540.52, 1552.04, 1563.63,
92  1575.29, 1587.02, 1598.82, 1610.69, 1622.64, 1634.65, 1646.74, 1658.90, 1671.13, 1683.43,
93  1695.81, 1708.26, 1720.79, 1733.39, 1746.06, 1758.81, 1771.63, 1784.53, 1797.51, 1810.56,
94  1823.69, 1836.90, 1850.18, 1863.55, 1876.99, 1890.51, 1904.10, 1917.78, 1931.54, 1945.37,
95  1959.26, 1973.27, 1987.35, 2001.52, 2015.77, 2030.10, 2044.51, 2059.00, 2073.58, 2088.24};
96 
97 Real const Rgas = 8.314462;
98 
99 void update_gamma(Real& gamma, Real rcp[], Real const prim[]) {
100  Real cp_real = interp1(prim[IDN], cp, temp, 400);
101  gamma = cp_real/(cp_real - Rgas);
102 }
double Real
Definition: athena.hpp:29
@ IDN
Definition: athena.hpp:135
double interp1(double x, double const *data, double const *axis, int len)
Definition: interpn.c:61
void update_gamma(Real &gamma, Real rcp[], Real const prim[])
Real cp[400]
Real const Rgas
Real temp[400]