Skip to content

Commit

Permalink
finishing touches
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelcortes committed Jan 28, 2024
1 parent 84add4c commit ce79be9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
6 changes: 2 additions & 4 deletions thermosteam/_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ class ProcessSettings:
>>> settings.thermo.show()
Thermo(
chemicals=CompiledChemicals([Water]),
mixture=Mixture(
rule='ideal', ...
mixture=IdealMixture(...
include_excess_energies=False
),
Gamma=DortmundActivityCoefficients,
Expand All @@ -80,8 +79,7 @@ class ProcessSettings:
Access defined mixture property algorithm:
>>> settings.mixture.show()
Mixture(
rule='ideal', ...
IdealMixture(...
include_excess_energies=False
)
Expand Down
8 changes: 4 additions & 4 deletions thermosteam/_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Thermo:
>>> thermo.show()
Thermo(
chemicals=CompiledChemicals([Ethanol, Water]),
mixture=IdealMixture(
mixture=IdealMixture(...
include_excess_energies=False
),
Gamma=DortmundActivityCoefficients,
Expand All @@ -65,7 +65,7 @@ class Thermo:
>>> ideal.show()
IdealThermo(
chemicals=CompiledChemicals([Ethanol, Water]),
mixture=IdealMixture(
mixture=IdealMixture(...
include_excess_energies=False
),
)
Expand All @@ -75,7 +75,7 @@ class Thermo:
>>> # Ideal
>>> tmo.settings.set_thermo(ideal)
>>> stream = tmo.Stream('stream', Water=100, Ethanol=100)
>>> stream.vle(T=360, P=101325)
>>> stream.vle(T=361, P=101325)
>>> stream.show()
MultiStream: stream
phases: ('g', 'l'), T: 361 K, P: 101325 Pa
Expand All @@ -100,7 +100,7 @@ class Thermo:
>>> thermo.show()
Thermo(
chemicals=CompiledChemicals([Ethanol, Water]),
mixture=IdealMixture(
mixture=IdealMixture(...
include_excess_energies=False
),
Gamma=DortmundActivityCoefficients,
Expand Down
24 changes: 10 additions & 14 deletions thermosteam/mixture/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,12 @@ def xkappa(self, phase_mol, T, P):
"""Multi-phase mixture thermal conductivity [W/m/K]."""
return sum([self.kappa(phase, mol, T, P) for phase, mol in phase_mol])


def __repr__(self):
return f"{type(self).__name__}(..., include_excess_energies={self.include_excess_energies})"
return f"{type(self).__name__}(...)"

def _info(self):
return (f"{type(self).__name__}(\n"
f" rule={repr(self.rule)}, ...\n"
f" include_excess_energies={self.include_excess_energies}\n"
")")
return (f"{type(self).__name__}(...)")

def show(self):
print(self._info())
Expand Down Expand Up @@ -445,15 +443,15 @@ def from_chemicals(cls, chemicals,
--------
Calculate enthalpy of evaporation for a water and ethanol mixture:
>>> from thermosteam import Mixture
>>> mixture = Mixture.from_chemicals(['Water', 'Ethanol'])
>>> from thermosteam import IdealMixture
>>> mixture = IdealMixture.from_chemicals(['Water', 'Ethanol'])
>>> mixture.Hvap([0.2, 0.8], 350)
39750.62
Calculate density for a water and ethanol mixture in g/L:
>>> from thermosteam import Mixture
>>> mixture = Mixture.from_chemicals(['Water', 'Ethanol'])
>>> mixture = IdealMixture.from_chemicals(['Water', 'Ethanol'])
>>> mixture.get_property('rho', 'g/L', 'l', [0.2, 0.8], 350, 101325)
754.23
Expand Down Expand Up @@ -481,14 +479,12 @@ def from_chemicals(cls, chemicals,
mu, V, kappa, Hvap, sigma, epsilon, MWs, include_excess_energies)

def __repr__(self):
return f"{type(self).__name__}(...)"
return f"{type(self).__name__}(..., include_excess_energies={self.include_excess_energies})"

def _info(self):
return (f"{type(self).__name__}(...)")

def show(self):
print(self._info())
_ipython_display_ = show
return (f"{type(self).__name__}(...\n"
f" include_excess_energies={self.include_excess_energies}\n"
")")


# %% Thermo mixture
Expand Down

0 comments on commit ce79be9

Please sign in to comment.