Coder Social home page Coder Social logo

Comments (3)

CalebBell avatar CalebBell commented on June 18, 2024 1

Hi Odhran!

Yes, this is expected behavior. By the way, there is now a high-accuracy gas-only pseudo-pure model specifically for air in Thermo.

from thermo import *
import numpy as np
from thermo.phases import DryAirLemmon
import matplotlib.pyplot as plt
from thermo.chemical_package import lemmon2000_constants, lemmon2000_correlations
T, P = 298.15, 101325.0
gas = DryAirLemmon(T=T, P=P)
flasher = FlashPureVLS(constants=lemmon2000_constants, correlations=lemmon2000_correlations,
                   gas=gas, liquids=[], solids=[])
Ps = np.linspace(500000,20000000, 100)
gas_H = np.zeros_like(Ps)

k=0
for P in Ps:
    gas_H[k] = flasher.flash(T=500, P=float(P)).H()
    k=k+1

plt.figure()
plt.plot(Ps,gas_H, label = "gas_H")
plt.xlabel("Pressure")
plt.ylabel("Enthalpy")
plt.legend()
plt.show()

image

It also shows the same behavior. Note that when compressing air in real life, the temperature increases as the process is isentropic, which results in the significant compression duty.

from thermo.

CalebBell avatar CalebBell commented on June 18, 2024 1

Hi Odhran,
Unfortunately the Lemmon model is pseudo-pure, i.e. incapable of participating in vapor-liquid equilibrium. In thermo, you can only use it for obtaining vapor properties. Adding a liquid phase would not work with it. Additionally, it is slower due to its complexity.
Sincerely,
Caleb

from thermo.

OdhranOOC avatar OdhranOOC commented on June 18, 2024

Much appreciated Caleb! Ah interesting I did read that Lemmon paper a few years back actually. So can I swap out the current gas phase EOS then for the improved Lemmon one, and leave the liquid phase as it is? How would that look?

My current code for reference:

constants, properties = ChemicalConstantsPackage.from_IDs(['nitrogen', 'oxygen', 'argon'])
kijs = IPDB.get_ip_asymmetric_matrix('ChemSep PR', constants.CASs, 'kij')
eos_kwargs = {'Pcs': constants.Pcs, 'Tcs': constants.Tcs, 'omegas': constants.omegas, 'kijs': kijs}
gas = CEOSGas(PRMIXTranslatedConsistent, eos_kwargs=eos_kwargs, HeatCapacityGases=properties.HeatCapacityGases)
liquid = CEOSLiquid(PRMIXTranslatedConsistent, eos_kwargs=eos_kwargs, HeatCapacityGases=properties.HeatCapacityGases)
flasher = FlashVL(constants, properties, liquid=liquid, gas=gas)
zs = normalize([78.08, 20.95, .93])

Also, do you know if the Lemmon model is faster than the alternative I have above, or is it actually slower due to the increased accuracy?

Much appreciated

from thermo.

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.