Skip to content

Commit 3a47254

Browse files
committed
0.52.15 release; correct Cp estimate
1 parent 0140e70 commit 3a47254

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
name='thermosteam',
1212
packages=['thermosteam'],
1313
license='MIT',
14-
version='0.52.14',
14+
version='0.52.15',
1515
description="BioSTEAM's Premier Thermodynamic Engine",
1616
long_description=open('README.rst', encoding='utf-8').read(),
1717
author='Yoel Cortes-Pena',

thermosteam/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# update_module(chemicals, numba)
3232
# use_numba_chemicals()
3333
# del use_numba_chemicals
34-
__version__ = "0.52.14"
34+
__version__ = "0.52.15"
3535

3636
from . import thermo
3737
del thermo

thermosteam/_thermo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def __init__(self, chemicals, mixture=None,
141141
if not isinstance(chemicals, Chemicals):
142142
chemicals = Chemicals(chemicals, cache, db=db)
143143
chemicals.compile(skip_checks=skip_checks)
144-
if mixture is not None and isinstance(mixture, Mixture):
144+
if mixture is not None and not isinstance(mixture, Mixture):
145145
raise ValueError(f"mixture must be a '{Mixture.__name__}' object")
146146
if PCF is None: PCF = eq.MockPoyintingCorrectionFactors
147147
match pkg:

thermosteam/mixture/__init__.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,12 +689,20 @@ def Cn(self, phase, mol, T, P=101325):
689689
Cn = self.Cn_ideal(phase, mol, T, P)
690690
if phase == 's': return Cn
691691
if phase in self.active_eos:
692-
eos, _, _, eos_mol = self.active_eos[phase]
692+
eos, index, eos_index, eos_mol = self.active_eos[phase]
693693
else:
694-
eos, _, _, eos_mol = self.eos_args(
694+
eos, index, eos_index, eos_mol = self.eos_args(
695695
phase, mol, T, P
696696
)
697-
Cn += get_excess_property(eos, 'Cp', phase) * eos_mol
697+
excess_ref = sum([
698+
mol[eos_index[i]] * get_excess_property(
699+
eos.to_TPV_pure(T=T, P=101325, V=None, i=i),
700+
'Cp',
701+
phase
702+
)
703+
for i in range(eos.N)
704+
])
705+
Cn += get_excess_property(eos, 'Cp', phase) * eos_mol - excess_ref
698706
return Cn
699707

700708
def H(self, phase, mol, T, P):

0 commit comments

Comments
 (0)