BioSTEAMDevelopmentGroup / Bioindustrial-Park

BioSTEAM's Premier Repository for Biorefinery Models and Results
MIT License
36 stars 17 forks source link

Consultation on physical properties #85

Closed zasddsgg closed 8 months ago

zasddsgg commented 9 months ago

Hello, I learn the source code in https://biosteam.readthedocs.io/en/latest/_modules/thermosteam/_chemical.html, while I have some questions about physical properties, could I consult you for the following questions? Thanks for your help. Wish you a good day.

a)For “LookupError: a valid CAS number was recognized, but its not in the database” returned by bst.Chemical(CAS), is there other solutions except the way defining cellulose in https://biosteam.readthedocs.io/en/latest/tutorial/Building_a_biorefinery.html#Thermodynamic-property-package:~:text=bst.Chemical(%27Cellulose,formula%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Hf%3D%2D975708.8)?

b)For missing properties ['mu', 'Psat', 'Hvap', 'sigma', 'epsilon', 'Hf', 'LHV', 'HHV', 'combustion', 'Sfus', 'Tm', 'Tb', 'Pc', 'Pt', 'Vc', 'Tt', 'atoms', 'similarity_variable', 'iscyclic_aliphatic', 'omega', 'dipole', 'Tc', 'Hfus'] returned by chemical.get_missing_properties(), do I need to provide all the values manually? Are there any properties that, even if missing, have little effect on the results? The above missing properties and the information returned by chemical.water ([Names], [Groups], [Data]: Mw, Tm, Tb, Tt, Tc, Pt, Pc, Vc, Hf, S0, LHV, HHV, Hfus, Sfus, omega, dipole, similarity_variable, iscyclic_aliphatic, combustion), which ones are more important to the result (i.e. must have and be accurate), or which ones are that, even if missing, have little effect on the process result?

c)How to judge whether the physical properties of chemicals are missing? If chemical.get_missing_properties() returns a null value, does that indicate that the properties are complete?

d)For bst.Chemical('Penicillin', Hf=Hf, Tb=Tb, ...) in case #83, does this mean that I need to provide specific value from other sources (such as paper) for Hf and Tb ?

e)If one or more properties of a chemical are missing in BioSTEAM, will the error be reported when running? Or can only check through chemical.get missing properties?

f)Can the missing properties of chemicals (or which missing properties can be ) in BioSTEAM be completed or estimated by BioSTEAM itself? Is there any code in BioSTEAM that I can call to automatically complete or estimate the missing properties of chemicals? For example, if the enthalpy of formation is not given, can Biosteam automatically estimate it? For example, can HHV be estimated according to dulong formula and then the enthalpy of formation be calculated according to HHV that is obtained by dulong formula?

g)Why is the return by chemical.default() and chemical.get_missing_properties() different (https://biosteam.readthedocs.io/en/latest/API/thermosteam/Chemical.html#:~:text=default(properties%3DNone)), what is the difference between the two? For chemical.default() and chemical.get_missing_properties(), which missing properties are automatically estimated and completed, and how to achieve the estimation of the missing properties? For “Note that missing properties does not include essential properties volume, heat capacity, and conductivity in” https://biosteam.readthedocs.io/en/latest/API/thermosteam/Chemical.html#:~:text=Note%20that%20missing%20properties%20does%20not%20include%20essential%20properties%20volume%2C%20heat%20capacity%2C%20and%20conductivity, what does that mean, does mean that these missing properties are automatically estimated? If so, how to achieve it? For “Whether to default any missing chemical properties such as molar volume, heat capacity, surface tension, thermal conductivity, and molecular weight to that of water (on a weight basis)” in https://biosteam.readthedocs.io/en/latest/API/thermosteam/Chemical.html#:~:text=Whether%20to%20default%20any%20missing%20chemical%20properties%20such%20as%20molar%20volume%2C%20heat%20capacity%2C%20surface%20tension%2C%20thermal%20conductivity%2C%20and%20molecular%20weight%20to%20that%20of%20water%20(on%20a%20weight%20basis), how the physical properties of chemicals relate to the physical properties of water?

h)For chemicals with incomplete properties in the Thermosteam database (e.g. 'Penicillin') or my own newly built chemical like cellulose (only enthalpy and formula defined), how does BioSTEAM obtain Cn in different phase states of above chemicals?

i)When I build the chemical in the way as cellulose (i.e. bst.Chemical('Cellulose')), which properties must be given for two cases: the chemical participating in gas-liquid equilibrium or not participating in gas-liquid equilibrium?

g)For “you will need to make sure there is a valid Psat model” in case #83, what does it mean to have a valid Psat model, does it refer to Tb, Tc, Pc, omega that are needed to compute the Psat (self._Psat = Psat = VaporPressure(CASRN=CAS, Tb=Tb, Tc=Tc, Pc=Pc, omega=omega) in https://biosteam.readthedocs.io/en/latest/_modules/thermosteam/_chemical.html#Chemical.get_property:~:text=self._Psat%20%3D%20Psat%20%3D%20VaporPressure(CASRN%3DCAS%2C%20Tb%3DTb%2C%20Tc%3DTc%2C%20Pc%3DPc%2C%20omega%3Domega)?

yoelcortes commented 8 months ago

@zasddsgg,

Here are answers to your questions:

a) You can model cellulose however you see fit. b) I'll leave that up to your chemical engineering knowledge. We do not provide free consulting services. c) If nothing is returned, it means the most important properties are available. d) yes e) If the property is needed, but not available, biosteam will raise an error (but sometimes you will need to figure out which property is missing). f) Data that is not available that can be estimated in BioSTEAM are automatically estimated. Otherwise, biosteam cannot estimate it. g) default defaults essential properties like heat capacity and volume to that of water on a mass basis. get_missing_properties does not do this. h) BioSTEAM estimates Cn (and any property) based on available data. To view the model used by a T-dependent property, please read the documentation: https://biosteam.readthedocs.io/en/latest/tutorial/ThermoSTEAM_101.html i) If a phase (e.g., Chemical(name, phase='l')) is not given, you must have Psat (in addition to all properties you use in the gas and liquid phase). You may also want to pass Dortmund UNIFAC groups (otherwise it assumes an activity coefficient of 1). j) It means that Psat (a VaporPressure object) must have a method that works. There are many methods available and different data/coefficients are needed for each method. You will need to read the documentation/code on the VaporPressure object to explore details on the methods to know what data is needed: https://thermo.readthedocs.io/_modules/thermo/vapor_pressure.html#VaporPressure

zasddsgg commented 8 months ago

Thanks for your answer. I have learned the two websites you recommended. Based on your answer, may I ask you the following questions again? Thanks for your help. Wish you a good day.

a) When creating a chemical in BioSTEAM myself through bst.Chemical(name, phase=l) or bst.Chemical(name, not set the phase state), what properties or information must be given, or what information is missing that has little impact on the results? Because there seems to be a lot of information need to be provided when creating chemicals in class Chemical (https://biosteam.readthedocs.io/en/latest/API/thermosteam/Chemical.html#:~:text=Chemical-,class%20Chemical,-(ID%2C) b) Do all properties returned by chemical.get_missing_properties() need to be manually completed? c) If the missing property (the property returned by chemical.get_missing_properties()) is not used in the simulation, will it be OK even if it is missing? Or if no errors are reported when simulation, will it be OK to have missing property? Or as long as no errors are reported when simulation, does it mean that is it OK to have missing property and the missing property has little effect on the result? d) What does “defaults essential properties like heat capacity and volume to that of water on a mass basis” mean? Are the important properties the same as the properties of water, such as using the heat capacity and volume of water? Or how the physical properties of chemicals relate to the physical properties of water? The default setting is defalut=False when defining chemicals (https://biosteam.readthedocs.io/en/latest/API/thermosteam/Chemical.html#:~:text=default%3DFalse%20(bool%2C%20optional)%20%E2%80%93%20Whether%20to%20default%20any%20missing%20chemical%20properties%20such%20as%20molar%20volume%2C%20heat%20capacity%2C%20surface%20tension%2C%20thermal%20conductivity%2C%20and%20molecular%20weight%20to%20that%20of%20water%20(on%20a%20weight%20basis)). But there is “Default all properties with the chemical properties of water” in https://biosteam.readthedocs.io/en/latest/API/thermosteam/Chemical.html#:~:text=default(properties%3DNone), the two seem to contradict each other, so when the process is running, will the missing properties be treated according to “Default all properties with the chemical properties of water”? e) For your answer h, does that mean is it OK not to give Cn for the chemicals in the database or the chemicals defined by myself (in the both case of bst.Chemical(name, not set the phase state) and bst.Chemical(name, phase=l))? For the above conditions, can BioSTEAM automatically estimate the Cn of the reference phase state and other phase states outside the reference phase state? For “BioSTEAM estimates Cn (and any property) based on available data”, does it mean that as long as no errors are reported when simulation, I do not need to manually fill the missing properties for the chemicals in the database or the chemicals defined by myself (in the both case of bst.Chemical(name, not set the phase state) and bst.Chemical(name, phase=l))? f) For the chemicals in the database or created myself through bst.Chemical(name, phase=l) or bst.Chemical(name, not set the phase state), must chemical.get_missing_properties() return a null value? Which properties, even if missing (i.e. properties returned by chemical.get_missing_properties()), have little effect on the result? If the simulation does not report an error and the Dortmund UNIFAC groups are passed, is it ok even if there are missing properties? How to pass Dortmund UNIFAC groups, there seems to be no option to pass Dortmund UNIFAC groups in https://biosteam.readthedocs.io/en/latest/API/thermosteam/Chemical.html#:~:text=class%20Chemical(,%23. g) For chemical that does not participate in gas-liquid equilibrium, is it ok not to have Psat model? h) For substances involved in gas-liquid equilibrium (in database or created myself through bst.Chemical(name, not set the phase state)): If chemical.get_missing_properties() returns a null value, does it mean that all the data/ coefficients required for the Psat model/method are complete? Which properties even if missing (returned by chemical.get_missing_properties()) do not affect the data/ coefficients required by the Psat model/method? If there is no error reported when simulation, does it mean that the Psat model/method is ok, or the data/ coefficients required by the Psat model/method is complete? If the data/ coefficients required by the Psat model/method are missing, will BioSTEAM raise an error to remind me during the simulation? Do I need to manually input the data/ coefficients required for the Psat model/method? Or will BioSTEAM automatically calculate the needed data/ coefficients?