Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelcortes committed Jan 18, 2024
1 parent fa8ad41 commit 777a6ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
8 changes: 6 additions & 2 deletions thermosteam/_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -1266,11 +1266,15 @@ def alpha(self) -> float:
@property
def rho(self) -> float:
"""Density [kg/m^3]."""
return fn.V_to_rho(self.V, self.MW)
V = self.V
if V is None: return V
return fn.V_to_rho(V, self.MW)
@property
def nu(self) -> float:
"""Kinematic viscosity [m^2/s]."""
return fn.mu_to_nu(self.mu, self.rho)
mu = self.mu
if mu is None: return mu
return fn.mu_to_nu(mu, self.rho)
@property
def Pr(self) -> float:
"""Prandtl number [-]."""
Expand Down
2 changes: 1 addition & 1 deletion thermosteam/equilibrium/lle.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def __call__(self, T, P=None, top_chemical=None, update=True, use_cache=True):
self._phi = phi = phase_fraction(z_mol, K, self._phi)
if phi >= 1.:
mol_l = mol
mol_L = 0.
mol_L = 0. * mol
else:
y = z_mol * K / (phi * K + (1 - phi))
mol_l = y * phi
Expand Down
7 changes: 0 additions & 7 deletions thermosteam/separations.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,13 +642,6 @@ def lle(feed, top, bottom, top_chemical=None, efficiency=1.0, multi_stream=None)
ms = feed.copy()
ms.lle(feed.T, top_chemical=top_chemical)
top_phase, bottom_phase = ms.phases
if not top_chemical:
rho_l = ms['l'].rho
rho_L = ms['L'].rho
top_l = rho_l < rho_L
if top_l:
top_phase = 'l'
bottom_phase = 'L'
top.mol[:] = ms.imol[top_phase]
bottom.mol[:] = ms.imol[bottom_phase]
top.T = bottom.T = feed.T
Expand Down

0 comments on commit 777a6ff

Please sign in to comment.