def test_hydrocarbon_consistency(self):
     # Basic consistency of hydrocarbon text mixture
     mdl = PengRobinson()
     mix = Mixture(hydrocarbon_testmix)
     mix.temperature = 298
     mix.pressure = 101325
     mix.normalize()
     mix = mdl(mix)
     self.consistency(mix)
Пример #2
0
 def test_hydrocarbon_consistency(self):
     # Basic consistency of hydrocarbon text mixture
     mdl = SoaveRedlichKwong()
     mix = Mixture(hydrocarbon_testmix)
     mix.temperature = 298
     mix.pressure = 101325
     mix.normalize()
     mix = mdl(mix)
     self.consistency(mix)
 def test_nitrogen_mix(self):
     # Consistency and fugacity coefficients for nitrogen-methane test mixture
     test_K = np.array([[1.88991096, 0.10729978]])
     mdl = PengRobinson()
     mix = Mixture(nitrogen_testmix)
     mix.temperature = 100
     mix.pressure = 0.428 * 1e6
     mix.normalize()
     mix = mdl(mix)
     self.consistency(mix)
     logK = mix.departure['logfugacity']['liquid'] - mix.departure['logfugacity']['vapor']
     assert_allclose(test_K, np.exp(logK))
Пример #4
0
 def test_nitrogen_mix(self):
     # Consistency and fugacity coefficients for nitrogen-methane test mixture
     test_K = np.array([[1.92193888, 0.10129771]])
     mdl = SoaveRedlichKwong()
     mix = Mixture(nitrogen_testmix)
     mix.temperature = 100
     mix.pressure = 0.428 * 1e6
     mix.normalize()
     mix = mdl(mix)
     self.consistency(mix)
     logK = mix.departure['logfugacity']['liquid'] - mix.departure['logfugacity']['vapor']
     assert_allclose(test_K, np.exp(logK))