@@ -243,6 +243,11 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
243243 self . evaluate_property ( Self :: dp_dv_, contributions, true )
244244 }
245245
246+ /// Partial derivative of pressure w.r.t. density: $\left(\frac{\partial p}{\partial \rho}\right)_{T,N_i}$
247+ pub fn dp_drho ( & self , contributions : Contributions ) -> QuantityScalar < U > {
248+ -self . volume / self . density * self . dp_dv ( contributions)
249+ }
250+
246251 /// Partial derivative of pressure w.r.t. temperature: $\left(\frac{\partial p}{\partial T}\right)_{V,N_i}$
247252 pub fn dp_dt ( & self , contributions : Contributions ) -> QuantityScalar < U > {
248253 self . evaluate_property ( Self :: dp_dt_, contributions, true )
@@ -258,6 +263,12 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
258263 self . evaluate_property ( Self :: d2p_dv2_, contributions, true )
259264 }
260265
266+ /// Second partial derivative of pressure w.r.t. density: $\left(\frac{\partial^2 p}{\partial \rho^2}\right)_{T,N_j}$
267+ pub fn d2p_drho2 ( & self , contributions : Contributions ) -> QuantityScalar < U > {
268+ self . volume / ( self . density * self . density )
269+ * ( self . volume * self . d2p_dv2 ( contributions) + 2.0 * self . dp_dv ( contributions) )
270+ }
271+
261272 /// Partial molar volume: $v_i=\left(\frac{\partial V}{\partial N_i}\right)_{T,p,N_j}$
262273 pub fn molar_volume ( & self , contributions : Contributions ) -> QuantityArray1 < U > {
263274 let func = |s : & Self , evaluate : Evaluate | -s. dp_dni_ ( evaluate) / s. dp_dv_ ( evaluate) ;
@@ -444,6 +455,12 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
444455 -self . c_v ( c) / ( self . c_p ( c) * self . dp_dv ( c) * self . volume )
445456 }
446457
458+ /// Isothermal compressibility: $\kappa_T=-\frac{1}{V}\left(\frac{\partial V}{\partial p}\right)_{T,N_i}$
459+ pub fn isothermal_compressibility ( & self ) -> QuantityScalar < U > {
460+ let c = Contributions :: Total ;
461+ -1.0 / ( self . dp_dv ( c) * self . volume )
462+ }
463+
447464 /// Structure factor: $S(0)=k_BT\left(\frac{\partial\rho}{\partial p}\right)_{T,N_i}$
448465 pub fn structure_factor ( & self ) -> f64 {
449466 -( U :: gas_constant ( ) * self . temperature * self . density )
0 commit comments