1
1
use super :: { Contributions , Derivative :: * , PartialDerivative , State } ;
2
- use crate :: equation_of_state:: { IdealGas , Residual } ;
2
+ use crate :: equation_of_state:: { IdealGas , Molarweight , Residual } ;
3
3
use crate :: ReferenceSystem ;
4
4
use ndarray:: Array1 ;
5
5
use quantity:: * ;
@@ -74,14 +74,6 @@ impl<E: Residual + IdealGas> State<E> {
74
74
self . temperature * self . ds_dt ( contributions) / self . total_moles
75
75
}
76
76
77
- /// Specific isochoric heat capacity: $c_v^{(m)}=\frac{C_v}{m}$
78
- pub fn specific_isochoric_heat_capacity (
79
- & self ,
80
- contributions : Contributions ,
81
- ) -> SpecificEntropy {
82
- self . molar_isochoric_heat_capacity ( contributions) / self . total_molar_weight ( )
83
- }
84
-
85
77
/// Partial derivative of the molar isochoric heat capacity w.r.t. temperature: $\left(\frac{\partial c_V}{\partial T}\right)_{V,N_i}$
86
78
pub fn dc_v_dt (
87
79
& self ,
@@ -103,11 +95,6 @@ impl<E: Residual + IdealGas> State<E> {
103
95
}
104
96
}
105
97
106
- /// Specific isobaric heat capacity: $c_p^{(m)}=\frac{C_p}{m}$
107
- pub fn specific_isobaric_heat_capacity ( & self , contributions : Contributions ) -> SpecificEntropy {
108
- self . molar_isobaric_heat_capacity ( contributions) / self . total_molar_weight ( )
109
- }
110
-
111
98
/// Entropy: $S=-\left(\frac{\partial A}{\partial T}\right)_{V,N_i}$
112
99
pub fn entropy ( & self , contributions : Contributions ) -> Entropy {
113
100
Entropy :: from_reduced (
@@ -120,11 +107,6 @@ impl<E: Residual + IdealGas> State<E> {
120
107
self . entropy ( contributions) / self . total_moles
121
108
}
122
109
123
- /// Specific entropy: $s^{(m)}=\frac{S}{m}$
124
- pub fn specific_entropy ( & self , contributions : Contributions ) -> SpecificEntropy {
125
- self . molar_entropy ( contributions) / self . total_molar_weight ( )
126
- }
127
-
128
110
/// Partial molar entropy: $s_i=\left(\frac{\partial S}{\partial N_i}\right)_{T,p,N_j}$
129
111
pub fn partial_molar_entropy ( & self ) -> MolarEntropy < Array1 < f64 > > {
130
112
let c = Contributions :: Total ;
@@ -160,11 +142,6 @@ impl<E: Residual + IdealGas> State<E> {
160
142
self . enthalpy ( contributions) / self . total_moles
161
143
}
162
144
163
- /// Specific enthalpy: $h^{(m)}=\frac{H}{m}$
164
- pub fn specific_enthalpy ( & self , contributions : Contributions ) -> SpecificEnergy {
165
- self . molar_enthalpy ( contributions) / self . total_molar_weight ( )
166
- }
167
-
168
145
/// Partial molar enthalpy: $h_i=\left(\frac{\partial H}{\partial N_i}\right)_{T,p,N_j}$
169
146
pub fn partial_molar_enthalpy ( & self ) -> MolarEnergy < Array1 < f64 > > {
170
147
let s = self . partial_molar_entropy ( ) ;
@@ -184,11 +161,6 @@ impl<E: Residual + IdealGas> State<E> {
184
161
self . helmholtz_energy ( contributions) / self . total_moles
185
162
}
186
163
187
- /// Specific Helmholtz energy: $a^{(m)}=\frac{A}{m}$
188
- pub fn specific_helmholtz_energy ( & self , contributions : Contributions ) -> SpecificEnergy {
189
- self . molar_helmholtz_energy ( contributions) / self . total_molar_weight ( )
190
- }
191
-
192
164
/// Internal energy: $U=A+TS$
193
165
pub fn internal_energy ( & self , contributions : Contributions ) -> Energy {
194
166
self . temperature * self . entropy ( contributions) + self . helmholtz_energy ( contributions)
@@ -199,11 +171,6 @@ impl<E: Residual + IdealGas> State<E> {
199
171
self . internal_energy ( contributions) / self . total_moles
200
172
}
201
173
202
- /// Specific internal energy: $u^{(m)}=\frac{U}{m}$
203
- pub fn specific_internal_energy ( & self , contributions : Contributions ) -> SpecificEnergy {
204
- self . molar_internal_energy ( contributions) / self . total_molar_weight ( )
205
- }
206
-
207
174
/// Gibbs energy: $G=A+pV$
208
175
pub fn gibbs_energy ( & self , contributions : Contributions ) -> Energy {
209
176
self . pressure ( contributions) * self . volume + self . helmholtz_energy ( contributions)
@@ -214,11 +181,6 @@ impl<E: Residual + IdealGas> State<E> {
214
181
self . gibbs_energy ( contributions) / self . total_moles
215
182
}
216
183
217
- /// Specific Gibbs energy: $g^{(m)}=\frac{G}{m}$
218
- pub fn specific_gibbs_energy ( & self , contributions : Contributions ) -> SpecificEnergy {
219
- self . molar_gibbs_energy ( contributions) / self . total_molar_weight ( )
220
- }
221
-
222
184
/// Joule Thomson coefficient: $\mu_{JT}=\left(\frac{\partial T}{\partial p}\right)_{H,N_i}$
223
185
pub fn joule_thomson ( & self ) -> <Temperature as Div < Pressure > >:: Output {
224
186
let c = Contributions :: Total ;
@@ -278,6 +240,46 @@ impl<E: Residual + IdealGas> State<E> {
278
240
}
279
241
res
280
242
}
243
+ }
244
+
245
+ impl < E : Residual + Molarweight + IdealGas > State < E > {
246
+ /// Specific isochoric heat capacity: $c_v^{(m)}=\frac{C_v}{m}$
247
+ pub fn specific_isochoric_heat_capacity (
248
+ & self ,
249
+ contributions : Contributions ,
250
+ ) -> SpecificEntropy {
251
+ self . molar_isochoric_heat_capacity ( contributions) / self . total_molar_weight ( )
252
+ }
253
+
254
+ /// Specific isobaric heat capacity: $c_p^{(m)}=\frac{C_p}{m}$
255
+ pub fn specific_isobaric_heat_capacity ( & self , contributions : Contributions ) -> SpecificEntropy {
256
+ self . molar_isobaric_heat_capacity ( contributions) / self . total_molar_weight ( )
257
+ }
258
+
259
+ /// Specific entropy: $s^{(m)}=\frac{S}{m}$
260
+ pub fn specific_entropy ( & self , contributions : Contributions ) -> SpecificEntropy {
261
+ self . molar_entropy ( contributions) / self . total_molar_weight ( )
262
+ }
263
+
264
+ /// Specific enthalpy: $h^{(m)}=\frac{H}{m}$
265
+ pub fn specific_enthalpy ( & self , contributions : Contributions ) -> SpecificEnergy {
266
+ self . molar_enthalpy ( contributions) / self . total_molar_weight ( )
267
+ }
268
+
269
+ /// Specific Helmholtz energy: $a^{(m)}=\frac{A}{m}$
270
+ pub fn specific_helmholtz_energy ( & self , contributions : Contributions ) -> SpecificEnergy {
271
+ self . molar_helmholtz_energy ( contributions) / self . total_molar_weight ( )
272
+ }
273
+
274
+ /// Specific internal energy: $u^{(m)}=\frac{U}{m}$
275
+ pub fn specific_internal_energy ( & self , contributions : Contributions ) -> SpecificEnergy {
276
+ self . molar_internal_energy ( contributions) / self . total_molar_weight ( )
277
+ }
278
+
279
+ /// Specific Gibbs energy: $g^{(m)}=\frac{G}{m}$
280
+ pub fn specific_gibbs_energy ( & self , contributions : Contributions ) -> SpecificEnergy {
281
+ self . molar_gibbs_energy ( contributions) / self . total_molar_weight ( )
282
+ }
281
283
282
284
/// Speed of sound: $c=\sqrt{\left(\frac{\partial p}{\partial\rho^{(m)}}\right)_{S,N_i}}$
283
285
pub fn speed_of_sound ( & self ) -> Velocity {
0 commit comments