BioSTEAMDevelopmentGroup / thermosteam

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

Unlock chemical state #6

Closed yalinli2 closed 4 years ago

yalinli2 commented 4 years ago

In thermosteam, we can lock the phase of a chemical by using the at_state function. Assume that I first want to set the chemical Glucose at gas phase then liquid phase, looks like I can use at_state(phase, copy=True) to let me change the phase later, but since the default for copy is False, if I forgot to change it, I would have to redefine this chemical. There is a lock_phase function, is there a one for unlocking?

Thanks!

yalinli2 commented 4 years ago

Answering the question to myself after chatting:

  1. Currently cannot no "unlock" function, but can use the Chemical.load_chemical function to reload from database and erase ALL previous settings
  2. Can create a locked Chemical using copy=True, but that will be a new chemical. It's OK to have two Chemical with the same name