11use super :: { Contributions , Derivative :: * , PartialDerivative , State } ;
2- use crate :: equation_of_state:: { IdealGas , Residual } ;
2+ use crate :: equation_of_state:: { IdealGas , Molarweight , Residual } ;
33use crate :: ReferenceSystem ;
44use ndarray:: Array1 ;
55use quantity:: * ;
@@ -74,14 +74,6 @@ impl<E: Residual + IdealGas> State<E> {
7474 self . temperature * self . ds_dt ( contributions) / self . total_moles
7575 }
7676
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-
8577 /// Partial derivative of the molar isochoric heat capacity w.r.t. temperature: $\left(\frac{\partial c_V}{\partial T}\right)_{V,N_i}$
8678 pub fn dc_v_dt (
8779 & self ,
@@ -103,11 +95,6 @@ impl<E: Residual + IdealGas> State<E> {
10395 }
10496 }
10597
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-
11198 /// Entropy: $S=-\left(\frac{\partial A}{\partial T}\right)_{V,N_i}$
11299 pub fn entropy ( & self , contributions : Contributions ) -> Entropy {
113100 Entropy :: from_reduced (
@@ -120,11 +107,6 @@ impl<E: Residual + IdealGas> State<E> {
120107 self . entropy ( contributions) / self . total_moles
121108 }
122109
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-
128110 /// Partial molar entropy: $s_i=\left(\frac{\partial S}{\partial N_i}\right)_{T,p,N_j}$
129111 pub fn partial_molar_entropy ( & self ) -> MolarEntropy < Array1 < f64 > > {
130112 let c = Contributions :: Total ;
@@ -160,11 +142,6 @@ impl<E: Residual + IdealGas> State<E> {
160142 self . enthalpy ( contributions) / self . total_moles
161143 }
162144
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-
168145 /// Partial molar enthalpy: $h_i=\left(\frac{\partial H}{\partial N_i}\right)_{T,p,N_j}$
169146 pub fn partial_molar_enthalpy ( & self ) -> MolarEnergy < Array1 < f64 > > {
170147 let s = self . partial_molar_entropy ( ) ;
@@ -184,11 +161,6 @@ impl<E: Residual + IdealGas> State<E> {
184161 self . helmholtz_energy ( contributions) / self . total_moles
185162 }
186163
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-
192164 /// Internal energy: $U=A+TS$
193165 pub fn internal_energy ( & self , contributions : Contributions ) -> Energy {
194166 self . temperature * self . entropy ( contributions) + self . helmholtz_energy ( contributions)
@@ -199,11 +171,6 @@ impl<E: Residual + IdealGas> State<E> {
199171 self . internal_energy ( contributions) / self . total_moles
200172 }
201173
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-
207174 /// Gibbs energy: $G=A+pV$
208175 pub fn gibbs_energy ( & self , contributions : Contributions ) -> Energy {
209176 self . pressure ( contributions) * self . volume + self . helmholtz_energy ( contributions)
@@ -214,11 +181,6 @@ impl<E: Residual + IdealGas> State<E> {
214181 self . gibbs_energy ( contributions) / self . total_moles
215182 }
216183
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-
222184 /// Joule Thomson coefficient: $\mu_{JT}=\left(\frac{\partial T}{\partial p}\right)_{H,N_i}$
223185 pub fn joule_thomson ( & self ) -> <Temperature as Div < Pressure > >:: Output {
224186 let c = Contributions :: Total ;
@@ -278,6 +240,46 @@ impl<E: Residual + IdealGas> State<E> {
278240 }
279241 res
280242 }
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+ }
281283
282284 /// Speed of sound: $c=\sqrt{\left(\frac{\partial p}{\partial\rho^{(m)}}\right)_{S,N_i}}$
283285 pub fn speed_of_sound ( & self ) -> Velocity {
0 commit comments