Coder Social home page Coder Social logo

Comments (4)

CalebBell avatar CalebBell commented on July 30, 2024 1

Pure components should work fine but instead of FlashVL you need to use FlashPureVLS: https://thermo.readthedocs.io/thermo.flash.html#thermo.flash.FlashPureVLS

from thermo.

CalebBell avatar CalebBell commented on July 30, 2024

Hi @mikeyj777,

The legacy Stream interface doesn't use the same enthalpy basis as the new Phase/flasher-based stuff, would not recommend trying to use them together. EquilibriumStream is the replacement for Stream. I have put off documenting it & don't have a tutorial; however, to combine to EquilibriumStream objects, you would add their flow rates (.ns attribute) and energy (.energy atribute) and provide them as input to a new EquilibriumStream object, as well as the pressure & the flasher object.

Here's a brief example

from thermo import *
constants, properties = ChemicalConstantsPackage.from_IDs(['methane', 'ethane', 'nitrogen'])
eos_kwargs = {'Pcs': constants.Pcs, 'Tcs': constants.Tcs, 'omegas': constants.omegas}
gas = CEOSGas(PRMIX, eos_kwargs=eos_kwargs, HeatCapacityGases=properties.HeatCapacityGases)
liquid = CEOSLiquid(PRMIX, eos_kwargs=eos_kwargs, HeatCapacityGases=properties.HeatCapacityGases)
flasher = FlashVL(constants, properties, liquid=liquid, gas=gas)
S1 = EquilibriumStream(flasher=flasher, T=300, P=1e5, ns=[1,2,3])
S2 = EquilibriumStream(flasher=flasher, T=305, P=1e5, ns=[.5,.3,.8])

ns_out = [na+nb for na, nb in zip(S1.ns, S2.ns)]
S3 = EquilibriumStream(flasher=flasher, P=1e5, ns=ns_out, energy=S1.energy+S2.energy)
S3.T, S3.ns

(300.9985275567583, [1.5, 2.2999999999999994, 3.7999999999999994])

Sincerely,
Caleb

from thermo.

mikeyj777 avatar mikeyj777 commented on July 30, 2024

thank you so much for the great support! I will give it a go and comment back with any issues.

from thermo.

mikeyj777 avatar mikeyj777 commented on July 30, 2024

How would you recommend working with a pure component stream? the equilibrium stream failed with a div by zero error in property_package.py, line 455

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.