Closed yalinli2 closed 4 years ago
Thanks for the request. I've thought about this before, but realized that it may be more transparent to let the user add this calculation for a couple of reasons:
Hnet_0 = stream.Hf + stream.H
reaction(stream)
stream.H = Hnet_0 - stream.Hf
But if you'd like this to be an option, I would suggest to make a adiabatic
method that wraps the __call__
method of Reaction objects and make a pull request. I can help guide you to add the required tests and make sure all the current tests are passing
Thanks for the reply!
I agree that it's more transparent for the users to decide whether to add the calculation. However I'm having trouble wrapping my head around whether we need to calculate H_rxn
at all - since stream.H
is automatically calculated, does the new stream.H
after reaction already include H_rxn
?
Thanks!
So stream.H is the enthalpy without heats of formation. An energy balance assuming adiabatic conditions would say:
(H_out + Hf_out) - (H_in + Hf_in) = 0 H_out = H_in + Hf_in - Hf_out
An this is what is going in: stream.H = Hnet_0 - stream.Hf
I made a mistake of assuming the H_in is equal to H_out after the reaction (which is only true if the heat capacity flow rate is the same). I corrected it in my first post. I think it would be helpful to add a method for this... Even I made a mistake initially jaja
Cool! I just sent a pull request, I only add one adiabatic_reaction
function in _reactions.py, but github shows that I made a lot of changes in the last commit, probably because I pasted my local file there instead of editing the original file. Feel free to edit/let me know what test I should run to make it work (as a learning experience), thanks!
BTW, I didn't know thermosteam is this big, there seems to be 1.5+ G hidden files, what are those?
Awesome! Please see my comments on the pull requests. The 1.5 G is mostly github, which saves all the branches and commits (so you can always go back to alternative versions).
Description I'm wondering whether it makes sense to automatically calculate reaction enthalpy in stoichiometric reactions? Basically calculate the Hrxn based on Hf of reactants/products and reaction conversions, then when performing the reaction, have the Hrxn added to the H of product streams (this can be optional), thanks!