@neutrium/thermo.eos.iapws97 2.0.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/base.ts CHANGED
@@ -1,49 +1,49 @@
1
1
 
2
2
  export const constants = {
3
- // Critical and Gas Constants
4
- 'R' : 0.461526, // kJ/kg.K
5
- //'Tc' : 647.096, // K
6
- 'Pc' : 22.064, // Mpa
7
- //'Rhoc' : 322, // kg/m3
8
-
9
- // Temperature and Pressure region limits
10
- 'MIN_P' : 0.000611213, // MPa
11
- 'MAX_P' : 100.0, // MPa
12
- 'MAX_T' : 2273.15, // K
13
- 'MIN_T' : 273.15, // K
14
- 'MIN_S' : -0.000154549592045, // kJ/kg
15
- 'MIN_H' : -0.041587825659104, // kJ/kg.K
16
-
17
- 'R2_MIN_T' : 623.15, // K
18
- 'R2_MAX_T' : 1073.15, // K
19
- 'R2_CRT_S' : 5.85, // kJ/kg.K
20
- 'R2_CRT_P' : 4.0, // MPa
21
-
22
- 'B23_MIN_P' : 16.5292, // MPa (The region 2-3 boundary pressure at R2_MIN_T)
23
- 'B23_MAX_T' : 863.15, // K (The region 2-3 boundary temperature at MAX_P)
24
-
25
- 'R5_MIN_T' : 1073.15, // K
26
- 'R5_MAX_P' : 50, // Mpa
27
- 'R5_MAX_T' : 2273.15, // K
28
-
29
- 'R3_MIN_T' : 623.15, // K
30
- 'R3_CRT_S' : 4.41202148223476, // kJ/kg.K
31
-
32
- 'B23_S_MIN' : 5.048096828,
33
- 'B23_S_MAX' : 5.260578707,
34
-
35
- 'B23_H_MIN' : 2563.592004,
36
- 'B23_H_MAX' : 2812.942061
3
+ // Critical and Gas Constants
4
+ 'R' : 0.461526, // kJ/kg.K
5
+ //'Tc' : 647.096, // K
6
+ 'Pc' : 22.064, // Mpa
7
+ //'Rhoc' : 322, // kg/m3
8
+
9
+ // Temperature and Pressure region limits
10
+ 'MIN_P' : 0.000611213, // MPa
11
+ 'MAX_P' : 100.0, // MPa
12
+ 'MAX_T' : 2273.15, // K
13
+ 'MIN_T' : 273.15, // K
14
+ 'MIN_S' : -0.000154549592045, // kJ/kg
15
+ 'MIN_H' : -0.041587825659104, // kJ/kg.K
16
+
17
+ 'R2_MIN_T' : 623.15, // K
18
+ 'R2_MAX_T' : 1073.15, // K
19
+ 'R2_CRT_S' : 5.85, // kJ/kg.K
20
+ 'R2_CRT_P' : 4.0, // MPa
21
+
22
+ 'B23_MIN_P' : 16.5292, // MPa (The region 2-3 boundary pressure at R2_MIN_T)
23
+ 'B23_MAX_T' : 863.15, // K (The region 2-3 boundary temperature at MAX_P)
24
+
25
+ 'R5_MIN_T' : 1073.15, // K
26
+ 'R5_MAX_P' : 50, // Mpa
27
+ 'R5_MAX_T' : 2273.15, // K
28
+
29
+ 'R3_MIN_T' : 623.15, // K
30
+ 'R3_CRT_S' : 4.41202148223476, // kJ/kg.K
31
+
32
+ 'B23_S_MIN' : 5.048096828,
33
+ 'B23_S_MAX' : 5.260578707,
34
+
35
+ 'B23_H_MIN' : 2563.592004,
36
+ 'B23_H_MAX' : 2812.942061
37
37
  }
38
38
 
39
39
  // This function is to help in porting to typescript
40
- export function CONST(key: string)
40
+ export function CONST(key: string) : number
41
41
  {
42
- return constants[key];
42
+ return constants[key];
43
43
  }
44
44
 
45
45
  //
46
- // Auxiliary Equation for additonal properties
46
+ // Auxiliary Equation for additional properties
47
47
  //
48
48
 
49
49
  //
@@ -54,65 +54,65 @@ export function CONST(key: string)
54
54
  //
55
55
  // @return Viscosity in Pa.s (P)
56
56
  //
57
- export function viscosity(T, ρ)
57
+ export function viscosity(T: number, ρ: number): number
58
58
  {
59
59
 
60
- let T_hat = T/647.096,
61
- ρ_hat = ρ/322,
62
- μ0_H = [1.67752, 2.20462, 0.6366564, -0.241605],
63
- μ0 = 100*Math.sqrt(T_hat),
64
- x = 0,
65
- y = 0;
66
-
67
- for (let i = 0; i < 4; i++)
68
- {
69
- x += μ0_H[i]/Math.pow(T_hat, i);
70
- }
71
-
72
- μ0 = μ0/x;
73
-
74
- let μ1 = 0,
75
- μ1_H = [5.20094E-1,8.50895E-2,-1.08374,-2.89555E-1,0,0,2.22531E-1,9.99115E-1,1.88797,1.26613,0,1.20573E-1,-2.81378E-1,-9.06851E-1,-7.72479E-1,-4.89837E-1,-2.5704E-1,0,1.61913E-1,2.57399E-1,0,0,0,0,-3.25372E-2,0,0,6.98452E-2,0,0,0,0,0,0,8.72102E-3,0,0,0,0,-4.35673E-3,0,-5.93264E-4];
76
-
77
- for (let j = 0; j < 6; j++)
78
- {
79
- x = Math.pow(1/T_hat - 1, j);
80
- y = 0;
81
-
82
- for (let z = 0; z < 7; z++)
83
- {
84
- y += μ1_H[z*6+j]*Math.pow(ρ_hat - 1, z);
85
- }
86
-
87
- μ1 += x*y;
88
- }
89
-
90
- μ1 = Math.exp(ρ_hat*μ1);
91
-
92
- // No correction at the subcritical region yet
93
- let μ2 = 1;
94
-
95
- /*
96
- // start of critcial enhancement
97
- let chi = rho_hat*(zetaX(T_hat, rho_hat) - zetaR(rho_hat)*1.5/T_hat),
98
- xi = 0.13*Math.pow(chi/0.06, 0.63/1.239),
99
- psi_d = Math.acos(Math.pow(1+xi*xi/1.21, -0.5)),
100
- w = Math.sqrt((xi/1.9-1)/(xi/1.9+1))*Math.tan(0.5*psi_d),
101
- Lw = xi/1.9 > 1 ? Math.log((1+w)/(1-w)) : 2*Math.atan(Math.abs(w)),
102
- qcxi = xi/1.9,
103
- qdxi = xi/1.1;
104
-
105
- if(xi > 0.3817016416)
106
- {
107
- y = (1/12)*Math.sin(3*psi_d) - (1/(4*qcxi))*Math.sin(2*psi_d) + 1/(qcxi*qcxi)*(1 - 5*qcxi*qcxi/4)*Math.sin(psi_d) - 1/Math.pow(qcxi, 3)*((1 - 1.5*qcxi*qcxi)*psi_d - Math.pow(Math.abs(qcxi*qcxi-1),1.5)*Lw);
108
- }
109
- else
110
- {
111
- y = (1/5)*qcxi*Math.pow(qdxi,5)*(1 - qcxi + qcxi*qcxi - 765*qdxi*qdxi/504);
112
- }
113
- */
114
-
115
- return μ0*μ1*μ2;
60
+ let T_hat = T/647.096,
61
+ ρ_hat = ρ/322,
62
+ μ0_H = [1.67752, 2.20462, 0.6366564, -0.241605],
63
+ μ0 = 100*Math.sqrt(T_hat),
64
+ x = 0,
65
+ y = 0;
66
+
67
+ for (let i = 0; i < 4; i++)
68
+ {
69
+ x += μ0_H[i]/Math.pow(T_hat, i);
70
+ }
71
+
72
+ μ0 = μ0/x;
73
+
74
+ let μ1 = 0,
75
+ μ1_H = [5.20094E-1,8.50895E-2,-1.08374,-2.89555E-1,0,0,2.22531E-1,9.99115E-1,1.88797,1.26613,0,1.20573E-1,-2.81378E-1,-9.06851E-1,-7.72479E-1,-4.89837E-1,-2.5704E-1,0,1.61913E-1,2.57399E-1,0,0,0,0,-3.25372E-2,0,0,6.98452E-2,0,0,0,0,0,0,8.72102E-3,0,0,0,0,-4.35673E-3,0,-5.93264E-4];
76
+
77
+ for (let j = 0; j < 6; j++)
78
+ {
79
+ x = Math.pow(1/T_hat - 1, j);
80
+ y = 0;
81
+
82
+ for (let z = 0; z < 7; z++)
83
+ {
84
+ y += μ1_H[z*6+j]*Math.pow(ρ_hat - 1, z);
85
+ }
86
+
87
+ μ1 += x*y;
88
+ }
89
+
90
+ μ1 = Math.exp(ρ_hat*μ1);
91
+
92
+ // No correction at the subcritical region yet
93
+ let μ2 = 1;
94
+
95
+ /*
96
+ // start of critcial enhancement
97
+ let chi = rho_hat*(zetaX(T_hat, rho_hat) - zetaR(rho_hat)*1.5/T_hat),
98
+ xi = 0.13*Math.pow(chi/0.06, 0.63/1.239),
99
+ psi_d = Math.acos(Math.pow(1+xi*xi/1.21, -0.5)),
100
+ w = Math.sqrt((xi/1.9-1)/(xi/1.9+1))*Math.tan(0.5*psi_d),
101
+ Lw = xi/1.9 > 1 ? Math.log((1+w)/(1-w)) : 2*Math.atan(Math.abs(w)),
102
+ qcxi = xi/1.9,
103
+ qdxi = xi/1.1;
104
+
105
+ if(xi > 0.3817016416)
106
+ {
107
+ y = (1/12)*Math.sin(3*psi_d) - (1/(4*qcxi))*Math.sin(2*psi_d) + 1/(qcxi*qcxi)*(1 - 5*qcxi*qcxi/4)*Math.sin(psi_d) - 1/Math.pow(qcxi, 3)*((1 - 1.5*qcxi*qcxi)*psi_d - Math.pow(Math.abs(qcxi*qcxi-1),1.5)*Lw);
108
+ }
109
+ else
110
+ {
111
+ y = (1/5)*qcxi*Math.pow(qdxi,5)*(1 - qcxi + qcxi*qcxi - 765*qdxi*qdxi/504);
112
+ }
113
+ */
114
+
115
+ return μ0*μ1*μ2;
116
116
  }
117
117
 
118
118
  //
@@ -123,92 +123,92 @@ export function viscosity(T, ρ)
123
123
  //
124
124
  // @return The thermal conductivity in mW/m.K
125
125
  //
126
- export function thermal_conductivity(T, ρ)
126
+ export function thermal_conductivity(T: number, ρ: number): number
127
127
  {
128
- let T_hat = T/647.096,
129
- ρ_hat = ρ/322,
130
- k0_L = [2.443221E-3, 1.323095E-2, 6.770357E-3, -3.454586E-3, 4.096266E-4],
131
- k0 = 0;
132
-
133
- for (let i = 0; i < 5; i++)
134
- {
135
- k0 += k0_L[i]/Math.pow(T_hat, i);
136
- }
137
-
138
- k0 = Math.sqrt(T_hat)/k0;
139
-
140
- let k1 = 0,
141
- k1_L = [1.60397357, -0.646013523, 0.111443906, 0.102997357, -0.0504123634, 0.00609859258, 2.33771842, -2.78843778, 1.53616167, -0.463045512, 0.0832827019, -0.00719201245, 2.19650529, -4.54580785, 3.55777244, -1.40944978, 0.275418278, -0.0205938816, -1.21051378, 1.60812989, -0.621178141, 0.0716373224, 0, 0, -2.720337, 4.57586331, -3.18369245, 1.1168348, -0.19268305, 0.012913842],
142
- x = 0,
143
- y = 0;
144
-
145
- for (let j = 0; j < 5; j++)
146
- {
147
- x = Math.pow(1/T_hat - 1, j);
148
- y = 0;
149
-
150
- for(let z = 0; z < 6; z++)
151
- {
152
- y += k1_L[j*6 + z]*Math.pow(ρ_hat - 1, z);
153
- }
154
-
155
- k1 += x*y;
156
- }
157
-
158
- k1 = Math.exp(ρ_hat*k1);
159
-
160
- // The critical enhancement not implemented yet
161
- let k2 = 0;
162
-
163
- /*
164
- To be included once zeta(T_hat, rho_hat) function found
165
-
166
- let mu_hat = mu/1E-6, // need mu
167
- cp_hat = cp/R,
168
- chi = rho_hat*(zeta(T_hat, rho_hat) - 1.5*zetaR(rho_hat)/T-hat),
169
- xi = 0.13*Math.pow(chi/0.06, 0.63/1.239),
170
- y = (xi/0.4),
171
- kappa = cp/cv, // get this from previous calculations
172
- Z = 2/(Math.PI*y)*(((1 - 1/kappa)*Math.atan(y) + y/kappa) - (1 - Math.exp(-1/(1/y + y*y/(3*rho_hat*rho_hat))))),
173
- k2 = 177.8514*rho_hat*cp_hat*T_hat*Z/mu_hat;
174
-
175
- function zetaR(rho_hat)
176
- {
177
- let a = [6.53786807199516, 6.52717759281799, 5.35500529896124, 1.55225959906681, 1.11999926419994, -5.61149954923348, -6.30816983387575, -3.96415689925446, 0.464621290821181, 0.595748562571649, 3.39624167361325, 8.08379285492595, 8.91990208918795, 8.93237374861479, 9.88952565078920, -2.27492629730878, -9.82240510197603, -12.0338729505790, -11.0321960061126, -10.3255051147040, 10.2631854662709, 12.1358413791395, 9.19494865194302, 6.16780999933360, 4.66861294457414, 1.97815050331519, -5.54349664571295, -2.16866274479712, -0.965458722086812, -0.503243546373828];
178
- j = 0,
179
- z = 0;
180
-
181
- if(rho_hat <= 0.310559006)
182
- {
183
- j = 0;
184
- }
185
- else if(rho_hat <= 0.776397516)
186
- {
187
- j = 1;
188
- }
189
- else if(rho_hat <= 1.242236025)
190
- {
191
- j = 2;
192
- }
193
- else if(rho_hat <= 1.863354037)
194
- {
195
- j = 3;
196
- }
197
- else
198
- {
199
- j = 4;
200
- }
201
-
202
- for(let i = 0; i < 6; i++)
203
- {
204
- z += A[i*5 + j]*Math.pow(rho_hat, i);
205
- }
206
-
207
- return 1/z;
208
- }
209
- */
210
-
211
- return k0*k1 + k2;
128
+ let T_hat = T/647.096,
129
+ ρ_hat = ρ/322,
130
+ k0_L = [2.443221E-3, 1.323095E-2, 6.770357E-3, -3.454586E-3, 4.096266E-4],
131
+ k0 = 0;
132
+
133
+ for (let i = 0; i < 5; i++)
134
+ {
135
+ k0 += k0_L[i]/Math.pow(T_hat, i);
136
+ }
137
+
138
+ k0 = Math.sqrt(T_hat)/k0;
139
+
140
+ let k1 = 0,
141
+ k1_L = [1.60397357, -0.646013523, 0.111443906, 0.102997357, -0.0504123634, 0.00609859258, 2.33771842, -2.78843778, 1.53616167, -0.463045512, 0.0832827019, -0.00719201245, 2.19650529, -4.54580785, 3.55777244, -1.40944978, 0.275418278, -0.0205938816, -1.21051378, 1.60812989, -0.621178141, 0.0716373224, 0, 0, -2.720337, 4.57586331, -3.18369245, 1.1168348, -0.19268305, 0.012913842],
142
+ x = 0,
143
+ y = 0;
144
+
145
+ for (let j = 0; j < 5; j++)
146
+ {
147
+ x = Math.pow(1/T_hat - 1, j);
148
+ y = 0;
149
+
150
+ for(let z = 0; z < 6; z++)
151
+ {
152
+ y += k1_L[j*6 + z]*Math.pow(ρ_hat - 1, z);
153
+ }
154
+
155
+ k1 += x*y;
156
+ }
157
+
158
+ k1 = Math.exp(ρ_hat*k1);
159
+
160
+ // The critical enhancement not implemented yet
161
+ let k2 = 0;
162
+
163
+ /*
164
+ To be included once zeta(T_hat, rho_hat) function found
165
+
166
+ let mu_hat = mu/1E-6, // need mu
167
+ cp_hat = cp/R,
168
+ chi = rho_hat*(zeta(T_hat, rho_hat) - 1.5*zetaR(rho_hat)/T-hat),
169
+ xi = 0.13*Math.pow(chi/0.06, 0.63/1.239),
170
+ y = (xi/0.4),
171
+ kappa = cp/cv, // get this from previous calculations
172
+ Z = 2/(Math.PI*y)*(((1 - 1/kappa)*Math.atan(y) + y/kappa) - (1 - Math.exp(-1/(1/y + y*y/(3*rho_hat*rho_hat))))),
173
+ k2 = 177.8514*rho_hat*cp_hat*T_hat*Z/mu_hat;
174
+
175
+ function zetaR(rho_hat)
176
+ {
177
+ let a = [6.53786807199516, 6.52717759281799, 5.35500529896124, 1.55225959906681, 1.11999926419994, -5.61149954923348, -6.30816983387575, -3.96415689925446, 0.464621290821181, 0.595748562571649, 3.39624167361325, 8.08379285492595, 8.91990208918795, 8.93237374861479, 9.88952565078920, -2.27492629730878, -9.82240510197603, -12.0338729505790, -11.0321960061126, -10.3255051147040, 10.2631854662709, 12.1358413791395, 9.19494865194302, 6.16780999933360, 4.66861294457414, 1.97815050331519, -5.54349664571295, -2.16866274479712, -0.965458722086812, -0.503243546373828];
178
+ j = 0,
179
+ z = 0;
180
+
181
+ if(rho_hat <= 0.310559006)
182
+ {
183
+ j = 0;
184
+ }
185
+ else if(rho_hat <= 0.776397516)
186
+ {
187
+ j = 1;
188
+ }
189
+ else if(rho_hat <= 1.242236025)
190
+ {
191
+ j = 2;
192
+ }
193
+ else if(rho_hat <= 1.863354037)
194
+ {
195
+ j = 3;
196
+ }
197
+ else
198
+ {
199
+ j = 4;
200
+ }
201
+
202
+ for(let i = 0; i < 6; i++)
203
+ {
204
+ z += A[i*5 + j]*Math.pow(rho_hat, i);
205
+ }
206
+
207
+ return 1/z;
208
+ }
209
+ */
210
+
211
+ return k0*k1 + k2;
212
212
  }
213
213
 
214
214
  //
@@ -218,12 +218,12 @@ export function thermal_conductivity(T, ρ)
218
218
  //
219
219
  // @return The surface tension in mN/m
220
220
  //
221
- export function surface_tension(T)
221
+ export function surface_tension(T : number) : number
222
222
  {
223
- let τ = 1 - T/647.096,
224
- σ = 235.8*Math.pow(τ,1.256)*(1 - 0.625*τ);
223
+ let τ = 1 - T/647.096,
224
+ σ = 235.8*Math.pow(τ,1.256)*(1 - 0.625*τ);
225
225
 
226
- return σ;
226
+ return σ;
227
227
  }
228
228
 
229
229
  //
@@ -234,35 +234,35 @@ export function surface_tension(T)
234
234
  //
235
235
  // @return The surface tension in mN/m
236
236
  //
237
- export function dielectric_constant(T, ρ)
237
+ export function dielectric_constant(T: number, ρ: number): number
238
238
  {
239
- let MW = 0.018015268,
240
- ρm = ρ/MW, // Molecular density (mol . m^-3)
241
- ρρc = ρm/(322/MW),
242
- α = 1.636E-40, // Mean molecular polarizability (C^2 . J^-1 . m^2)
243
- N_a = 6.0221367E23, // Avogadro's number (mol^-1)
244
- μ = 6.138E-30, // Molecular dipole moment (C . m)
245
- ε_0 = 1/(4E-7*Math.PI*Math.pow(299792458,2)), // Permittivity of free space (C^2 . J^-1 . m^-1)
246
- k = 1.380658E-23, // Boltzmann's constant (J . K^-1)
247
- Nh = [0.978224486826, -0.957771379375, 0.237511794148, 0.714692244396, -0.298217036956, -0.108863472196, 0.0949327488264, -0.00980469816509, 0.16516763497E-4, 0.937359795772E-4, -0.12317921872E-9],
248
- //Nh = [0.978224486826,-0.957771379375,0.237511794148,0.714692244396,-0.298217036956,-0.108863472196,0.0949327488264,-0.00980469816509,0.000016516763497,0.0000937359795772,-1.23179218720E-10],
249
- Ih = [1, 1, 1, 2, 3, 3, 4, 5, 6, 7, 10],
250
- Jh = [0.25, 1, 2.5, 1.5, 1.5, 2.5, 2, 2, 5, 0.5, 10],
251
- g = 0;
252
-
253
- for (let i = 0; i < 11; i++)
254
- {
255
- g += Nh[i]*Math.pow(ρρc, Ih[i])*Math.pow(647.096/T, Jh[i]);
256
- }
257
-
258
- g = 1 + g + 0.00196096504426*(ρρc)*Math.pow(T/228 - 1, -1.2);
259
-
260
-
261
- let A = N_a*μ*μ*ρm*g/(ε_0*k*T),
262
- B = N_a*α*ρm/(3*ε_0),
263
- ε = (1 + A + 5*B + Math.sqrt(9 + 2*A + 18*B + A*A + 10*A*B + 9*B*B))/(4 - 4*B);
264
-
265
- return ε;
239
+ let MW = 0.018015268,
240
+ ρm = ρ/MW, // Molecular density (mol . m^-3)
241
+ ρρc = ρm/(322/MW),
242
+ α = 1.636E-40, // Mean molecular polarizability (C^2 . J^-1 . m^2)
243
+ N_a = 6.0221367E23, // Avogadro's number (mol^-1)
244
+ μ = 6.138E-30, // Molecular dipole moment (C . m)
245
+ ε_0 = 1/(4E-7*Math.PI*Math.pow(299792458,2)), // Permittivity of free space (C^2 . J^-1 . m^-1)
246
+ k = 1.380658E-23, // Boltzmann's constant (J . K^-1)
247
+ Nh = [0.978224486826, -0.957771379375, 0.237511794148, 0.714692244396, -0.298217036956, -0.108863472196, 0.0949327488264, -0.00980469816509, 0.16516763497E-4, 0.937359795772E-4, -0.12317921872E-9],
248
+ //Nh = [0.978224486826,-0.957771379375,0.237511794148,0.714692244396,-0.298217036956,-0.108863472196,0.0949327488264,-0.00980469816509,0.000016516763497,0.0000937359795772,-1.23179218720E-10],
249
+ Ih = [1, 1, 1, 2, 3, 3, 4, 5, 6, 7, 10],
250
+ Jh = [0.25, 1, 2.5, 1.5, 1.5, 2.5, 2, 2, 5, 0.5, 10],
251
+ g = 0;
252
+
253
+ for (let i = 0; i < 11; i++)
254
+ {
255
+ g += Nh[i]*Math.pow(ρρc, Ih[i])*Math.pow(647.096/T, Jh[i]);
256
+ }
257
+
258
+ g = 1 + g + 0.00196096504426*(ρρc)*Math.pow(T/228 - 1, -1.2);
259
+
260
+
261
+ let A = N_a*μ*μ*ρm*g/(ε_0*k*T),
262
+ B = N_a*α*ρm/(3*ε_0),
263
+ ε = (1 + A + 5*B + Math.sqrt(9 + 2*A + 18*B + A*A + 10*A*B + 9*B*B))/(4 - 4*B);
264
+
265
+ return ε;
266
266
  }
267
267
 
268
268
  //
@@ -273,17 +273,17 @@ export function dielectric_constant(T, ρ)
273
273
  //
274
274
  // @return The ionization constant in (dimensionless)
275
275
  //
276
- export function ionization_constant(T, ρ)
276
+ export function ionization_constant(T: number, ρ: number): number
277
277
  {
278
- let pK_wg = 0.61415 + 48251.33/T - 67707.93/(T*T) + 10102100/(T*T*T),
279
- Q = ρ*Math.exp(-0.864671 + 8659.19/T - 22786.2*Math.pow(ρ, 2/3)/(T*T)),
280
- pK_w = -12*(log10(1+Q) - Q/(Q+1)*ρ*(0.642044 -56.8534/T -0.375754*ρ)) + pK_wg + 2*log10(0.018015268);
278
+ let pK_wg = 0.61415 + 48251.33/T - 67707.93/(T*T) + 10102100/(T*T*T),
279
+ Q = ρ*Math.exp(-0.864671 + 8659.19/T - 22786.2*Math.pow(ρ, 2/3)/(T*T)),
280
+ pK_w = -12*(log10(1+Q) - Q/(Q+1)*ρ*(0.642044 -56.8534/T -0.375754*ρ)) + pK_wg + 2*log10(0.018015268);
281
281
 
282
- return pK_w;
282
+ return pK_w;
283
283
  }
284
284
 
285
285
  // Not all browsers support log10 (IE)
286
- function log10(x)
286
+ function log10(x: number): number
287
287
  {
288
288
  return Math.log(x) / Math.LN10;
289
289
  }
package/src/index.ts CHANGED
@@ -9,4 +9,4 @@
9
9
  // http://creativecommons.org/licenses/by/4.0/legalcode
10
10
  //
11
11
 
12
- export {IAPWS97_EoS} from './IAPWS97'
12
+ export { IAPWS97_EoS } from './IAPWS97'
package/tsconfig.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es5",
5
- "moduleResolution": "node",
6
- "noImplicitAny": false,
7
- "sourceMap": false,
8
- "declaration": true,
9
- "outDir": "dist/"
10
- },
11
- "files": [
12
- "./src/index.ts"
13
- ]
2
+ "compilerOptions": {
3
+ "module": "nodenext",
4
+ "target": "es2015",
5
+ "moduleResolution": "nodenext",
6
+ "noImplicitAny": false,
7
+ "sourceMap": true,
8
+ "declaration": true,
9
+ "strict": true,
10
+ "rootDir": "src/",
11
+ "outDir": "dist/",
12
+ "forceConsistentCasingInFileNames": true
13
+ },
14
+ "include": ["src/**/*.ts"],
15
+ "exclude": ["node_modules", "dist"]
14
16
  }
package/.npmignore DELETED
@@ -1,9 +0,0 @@
1
- .DS_STORE
2
-
3
- #################
4
- ## npm
5
- #################
6
-
7
- npm-debug.log
8
- node_modules/
9
- bower_components/
@@ -1,18 +0,0 @@
1
- {
2
- "version": "0.1.0",
3
- "command": "npm",
4
- "isShellCommand": true,
5
- "showOutput": "always",
6
- "args": ["run"],
7
- "tasks": [
8
- {
9
- // Build task, Ctrl+Shift+B
10
- "taskName": "build",
11
- "isBuildCommand": true
12
- },
13
- {
14
- // Build task, Ctrl+Shift+B
15
- "taskName": "clean"
16
- }
17
- ]
18
- }
File without changes