BioSTEAMDevelopmentGroup / thermosteam

BioSTEAM's Premier Thermodynamic Engine
Other
57 stars 12 forks source link

<Chemical>._other_names seems to be an obsolete attribute but still included in the .__slots__ #40

Closed joyxyz1994 closed 3 years ago

joyxyz1994 commented 3 years ago

import thermosteam as tmo tmo.Chemical('H2O').__slots__

('_ID', '_locked_state', '_other_names', '_phase_ref', '_eos', '_eos_1atm', '_synonyms', '_CAS', '_InChI', '_InChI_key', '_common_name', '_iupac_name', '_pubchemid', '_smiles', '_formula', '_Dortmund', '_UNIFAC', '_PSRK', '_NIST', '_Psat', '_Hvap', '_sigma', '_epsilon', '_kappa', '_V', '_Cn', '_mu', '_S_excess', '_H_excess', '_S', '_H', '_MW', '_Tm', '_Tb', '_Tt', '_Tc', '_Pt', '_Pc', '_Vc', '_Hf', '_S0', '_LHV', '_HHV', '_Hfus', '_Sfus', '_omega', '_dipole', '_similarity_variable', '_iscyclic_aliphatic', '_combustion', '_N_solutes')

tmo.Chemical('H2O')._other_names

Traceback (most recent call last):

File "", line 1, in tmo.Chemical('H2O')._other_names

AttributeError: _other_names

yoelcortes commented 3 years ago

Fixed, thanks for reporting!

Commit cd36aba closes #40

yalinli2 commented 3 years ago

Piggybacking this for a related questions, looks like the _N_solutes attribute is not initiated in the __new__ function (but it does exist in __slots__)?

So now:

Screen Shot 2021-03-16 at 5 11 34 PM

Is this a reserved slot for future enhancement? Thanks!

yoelcortes commented 3 years ago

Hi Yalin,

Yes, it is a reserved slot for more accurate VLE. Particularly for dissolved sugars (e.g. glucose, sucrose) and salts (e.g. NaCl) which would increase the bubble point by acting as solutes. As an example for NaCl, N_solutes should be 2.

When a Chemicals object is compiled, N_solutes default to 0. A value of 0 is better for chemicals modeling large molecular weight stuff (e.g. glucose oligomers) but have a monomeric MW value for modeling simplicity.

Thanks!

yalinli2 commented 3 years ago

Oh I see, thanks for the explanation!