Git Product home page Git Product logo

Comments (7)

BenPortner avatar BenPortner commented on June 3, 2024 1

Amazing work @yoelcortes! Thanks for the swift implementation.

I tested it for the methane combustion example and it worked perfectly. However, there seems to be a problem when involving liquid hydrogen:

import thermosteam as tmo

tmo.settings.set_thermo(["H2O", "H2", "O2"])
electro_liquef = tmo.Reaction(
    'H2O,l -> H2,l + O2,g',
    correct_atomic_balance=True,
    reactant='H2O',
    X=1,
)
print(electro_liquef.dH / tmo.Chemical("H2O").MW)

"""
RuntimeError: Failed to extrapolate enthalpy of vaporization method 'DIPPR_PERRY_8E' at T=298.15 K for component with CASRN '1333-74-0 (H2)'
"""

More generally, it seems the heat of vaporization cannot be calculated for hydrogen:

tmo.Chemical("H2").Hvap(298) # same error

Not sure if I should open a new issue for this?

Thanks for the amazing work!
Ben

from thermosteam.

yoelcortes avatar yoelcortes commented on June 3, 2024

Hi Ben,

Thanks for the issue! Heats of vaporization are temperature dependent and I consider temperature dependence out of the scope of a reaction object. We can compute heat of reactions with phase changes using Stream objects together with Reaction objects:

import thermosteam as tmo
tmo.settings.set_thermo(['Water', 'Methane', 'CO2', 'O2'])
combustion = tmo.Reaction('Methane + O2 -> Water + CO2',
                          reactant='Methane', X=1,
                          correct_atomic_balance=True)
feed = tmo.Stream(Methane=1, O2=2, T=298.15, phase='g')
H0 = feed.Hnet
combustion(feed)
Hf = feed.Hnet
print(f'Lower heating value at 298.15 K reference state: {Hf - H0:.2f} kJ/hr')

feed = tmo.Stream(Methane=1, O2=2, T=400, phase='g')
H0 = feed.Hnet
combustion(feed)
Hf = feed.Hnet
print(f'Lower heating value at 400 K reference state: {Hf - H0:.2f} kJ/hr')

Output

Lower heating value at 298.15 K reference state: -802735.67 kJ/hr
Lower heating value at 400 K reference state: -801756.16 kJ/hr

I think this issue is related to #29. You can check it out for additional context. At the time the code had many bugs, but the same ideas apply.

Thanks!

from thermosteam.

BenPortner avatar BenPortner commented on June 3, 2024

Hi @yoelcortes,

thanks for the link to the related issue. It seems I didn't search carefully, sorry! I hope it is fine if I go on in this thread nevertheless:

I agree that the temperature dependence of the heat of vaporization (dH_vap) is out of the scope of the reaction object. However, I do believe it is in the scope of the reaction object to calculate the correct heat of reaction - and that is currently not the case. Moreover, I believe that it is not necessary to model the temperature dependence of dH_vap to get the reaction enthalpy right. The enthalpies of formation (Hf) are defined at STP. Hence, the difference between Hf_gas and Hf_liquid is the heat of vaporization at STP. Hf is thus needed at STP, not at any other temperature. Am I wrong?

from thermosteam.

yoelcortes avatar yoelcortes commented on June 3, 2024

Yeah, adding latent heats at 298.15 K makes sense. I think it all checks out, so I'll go ahead and add it for reactions where phases are specified. I might not get to it today, but surely by this weekend.

Thanks!

from thermosteam.

yoelcortes avatar yoelcortes commented on June 3, 2024

Done! I added tests so I'm pretty confident of results, but I'll let you close this issue so you can get a chance to test it too.

Thanks!

from thermosteam.

yoelcortes avatar yoelcortes commented on June 3, 2024

Thanks, Ben! Hydrogen cannot be liquefied above it's critical temperature, no matter how much pressure is applied (the gas and liquid phases are the same phase). So I think it's best just to use 'H2O,l -> H2,g + O2,g' instead since Hvap does not exist.

Thanks!

from thermosteam.

BenPortner avatar BenPortner commented on June 3, 2024

Silly me, hydrogen cannot be liquified above 33K, so there is no formation enthalpy of liquid H2 at 298K. Makes sense! 😅

It works fine with gaseous H2, as you suggest. Looks like everything is good! Closing the issue now 😄

Thanks.
Ben

from thermosteam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.