Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MergeSlabs and SerialSlabs assume equilibrium wrongly #370

Closed
CorentinGrimaldi opened this issue Sep 22, 2021 · 0 comments · Fixed by #371
Closed

MergeSlabs and SerialSlabs assume equilibrium wrongly #370

CorentinGrimaldi opened this issue Sep 22, 2021 · 0 comments · Fixed by #371
Labels
bug Something isn't working physics involves the physics ⭐⭐⭐_ High Priority
Milestone

Comments

@CorentinGrimaldi
Copy link
Collaborator

🐛 Describe the bug

When MergeSlabs (//) is used between 2 spectra, one at equilibrium, the other one at non equilibrium, the resulting spectrum is wrongly assumed to be at equilibrium for some parameters such as radiance. See the exemple below.

When SerialSlabs (< or >) is used, the same problem occurs, and moreover the resulting spectrum is considered at equilibrium if the 2 spectra were at equilibrium (which makes no sense)

🖥 Steps To Reproduce

from radis import SpectrumFactory

sf_co2 = SpectrumFactory(wavelength_min=4160,
                         wavelength_max=4200,
                         molecule='CO2',
                         isotope='1,2,3,4',
                         mole_fraction=1e-2,
                         )
sf_co2.load_databank('CDSD-HITEMP')

sf_co  = SpectrumFactory(wavelength_min=4160,
                         wavelength_max=4200,
                         molecule='CO',
                         isotope='1,2,3',
                         mole_fraction=1e-6,
                         )
sf_co.load_databank('CO-HITEMP')

spec_co2_neq = sf_co2.non_eq_spectrum(Trot=2300, Tvib=2600)
spec_co_eq = sf_co.eq_spectrum(Tgas=2300)

spec_co2_neq.apply_slit(3, unit='nm', inplace=False).plot(wunit='nm', lw=2, Iunit='µW/cm^2/sr/nm')
(spec_co2_neq // spec_co_eq).apply_slit(3, unit='nm', inplace=False).plot(nfig='same', wunit='nm', lw=2, Iunit='µW/cm^2/sr/nm')

🎯 Expected behavior

MergeSlabs should consider the spectrum at equilibrium ONLY if the 2 spectra were at equilibrium.
SerialSlabs should NEVER consider the resulting spectrum at equilibrium.
The .is_at_equilibrium() function should be tested.

💡 Possible solutions

PR ready

@CorentinGrimaldi CorentinGrimaldi added bug Something isn't working physics involves the physics labels Sep 22, 2021
@erwanp erwanp added the ⭐⭐⭐_ High Priority label Sep 22, 2021
@erwanp erwanp added this to the 0.10.3 milestone Sep 22, 2021
@erwanp erwanp mentioned this issue Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working physics involves the physics ⭐⭐⭐_ High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants