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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: I want to calculate total emissivity using radis someday #528

Open
PrometheusYao opened this issue Sep 19, 2022 · 11 comments
Labels
enhancement New feature or request physics involves the physics
Milestone

Comments

@PrometheusYao
Copy link

馃敄 Feature description

For example this Kangwanpongpan 2012 paper
1663592903006
1663592816391

馃憠 Why you want this feature!!

No response

@PrometheusYao PrometheusYao added the enhancement New feature or request label Sep 19, 2022
@erwanp
Copy link
Member

erwanp commented Sep 19, 2022

RADIS already computes the spectral absorption coefficients Kappa.

image

The following quantity in (Eq.14) :

image

is known as radiance_noslit in RADIS.
Therefore you could compute the total intensity of (Eq.14) as :

s = calc_spectrum(...)  # on full wavenumber range 
I_L = s.get_integral("radiance_noslit")

And easily derive the emissivity (Eq.15) .

There is also a spectral array called "emissivity_no_slit". Please compare & check, but I think your "emittance"/emissivity above is equal to the integral of the spectral emissivity_no_slit:

s.get_integral("emissivity_noslit")

If you do that, it might be interesting to add a get_total_emissivity() method to the Spectrum object to directly close this pull request and contribute to RADIS.

--

PS : the emissivity changes with the path length, but you do not need to recompute the full line-by-line spectrum for each new path length. As long as you already have a computed spectrum at the same temperature, you can rescale the spectrum object (which is really, in RADIS, just an homogenous slab of a given length)

s.rescale_path_length(new_path_length)

which is almost instantaneous, 100% valid and accurate. If you plan to tabulate a database this will save you a lot of time !

There is also a method to rescale mole fraction (i.e, compute the many "MR" of the graph above )

s.rescale_mole_fraction(new_mole_fraction)

but unlike rescaling path_length, it is strictly speaking not valid as there are 2nd order effects that require to recompute the lineshapes again. If you want to recompute a state-of-the-art database do not use it. However, I'd expect you'd get less than 0.1% error compared to recomputing the line-by-line spectrum from scratch.


PPPS : at high pressure (typically >10 atm) a Lorentzian line-by-line model is not valid anymore; you have strong subLorentzian behaviors, and this will change the computed emissivity. Kangwanpongpan's paper does not account for subLorentzian behaviors and it might be partly wrong for the 60+ bars I see being computed .

@PrometheusYao
Copy link
Author

Thanks for the reply Erwan. Your reply helped me a lot and it took me a long time to figure out some of it.

I'm new to Radis and relatively new to python, so this could be a silly problem. Now I have a problem, as shown in the figure (shown below). when I calculate the temperature to 2000K, I get an error message, which I solved by reducing the cutoff. After that I ran and got another error message, I don't know how to solve this problem.

I would appreciate it if you could answer my question. Thanks very much.

鍥剧墖3
鍥剧墖4

`from radis import *
from numpy import *

Sigma = 5.67e-8

for Tags in range(300,2600,100):
s = calc_spectrum(0.00010, 10000, # cm-1
isotope=1,
pressure=1.01325, # bar
Tgas=Tags, # K
mole_fraction={'CO2':0.8, 'H2O':0.2},
path_length=100, # cm
databank='hitemp', # or 'hitemp', 'geisa', 'exomol'
wstep='auto',
cutoff=0
)
I_L = s.get_integral("radiance_noslit")
E_L = (I_L * 10 * pi) / (Sigma * (Tags**4))
`

@erwanp
Copy link
Member

erwanp commented Oct 12, 2022

Memory problem.

You're computing extreme amount of lines, which is what you want to do anyway, as I assume you want to compute a reference emissivity database for use in other codes. So expect tens of millions of lines on a spectral grid of hundred-thousands of datapoints.
Radis makes it possible to compute such spectra, but it remains an extreme computation.

The error message shows you'd need at least 48 GB, therefore a RAM of twice this amount to compute it smoothly. I guess you do not have that available (maybe on a cluster) .

You can compute the database over smaller wavenumber ranges, and then join them. There is a Gallery example talking about this ("compute large spectra")

You can also increase the wstep parameter. It is currently set to "auto" which ensures a good accuracy, but might be too much in your case. Try 0.01. It will reduce the spectral grid.

@erwanp
Copy link
Member

erwanp commented Oct 12, 2022

#489 was also implemented by @sagarchotalia to help. It cuts the lines in chunks (instead of cutting the wavenumber range), so you don't have to worry about recombining the ranges afterwards.
As using no chunksize required 41 Gb for 2.8e14 lines*points (cf error messages), try using chunksize=2.8e13 (or less) , you might get only 4.1 Gb usage, which you can handle on your computer.

You'd be one of the first users of this feature. No impact on accuracy, but I can't ensure it will be faster than the split-waverange method suggested above. Try!

@PrometheusYao
Copy link
Author

Thanks for the reply Erwan. I have solved the problem and your reply helped me a lot.

Now I calculated a set of data to compare with Kangwanpongpan's paper and found some deviations, especially in the region where the temperature is below 1500K. Is the reason for this deviation what you mentioned before: at high pressure (typically >10 atm) a Lorentzian line-by-line model is not valid anymore; Kangwanpongpan's paper have strong subLorentzian behaviors, and this will change the computed emissivity.

1665972562572

from radis import *
from numpy import *

Sigma = 5.67e-8

for Tags in range(300, 2600, 100):
    s = calc_spectrum(0.0001, 10000,  # cm-1
                      isotope=1,
                      pressure=1.01325,  # bar
                      Tgas=Tags,  # K
                      mole_fraction={'CO2': 0.88889, 'H2O': 0.11111},
                      path_length=100,  # cm
                      databank='hitemp',  # or 'hitemp', 'geisa', 'exomol'
                      wstep='auto',
                      cutoff=0,
                      )
    I_L_1m = s.get_integral("radiance_noslit")
    E_L_1m = (I_L_1m * 10 * pi) / (Sigma * (Tags ** 4))
    s.rescale_path_length(1000)
    I_L_10m = s.get_integral("radiance_noslit")
    E_L_10m = (I_L_10m * 10 * pi) / (Sigma * (Tags ** 4))
    s.rescale_path_length(6000)
    I_L_60m = s.get_integral("radiance_noslit")
    E_L_60m = (I_L_60m * 10 * pi) / (Sigma * (Tags ** 4))

@anandxkumar anandxkumar added this to the 0.15 milestone Oct 28, 2022
@PrometheusYao
Copy link
Author

Thanks for the reply Erwan.

Now, I have calculated two sets of data using radis, compared with Mohammad Hadi Bordbar's paper and Kangwanpongpan's paper and found some deviations.

  1. The water vapor to carbon dioxide molar fraction ratio of 0.125 (i.e, mole_fraction={'CO2': 0.88889, 'H2O': 0.11111})is a good match at low pressures and a large deviation at high pressures.
  2. a large deviation was found for a molar fraction ratio of water vapor to carbon dioxide of 1 (i.e, mole_fraction={'CO2': 0.5, 'H2O': 0.5}).

I have been thinking about it for a long time but I could not find the reason. I hope you can give some guidance.
Sincerely thank you.

1
2

from radis import *
from numpy import *

Sigma = 5.67e-8

for Tags in range(300, 3100, 100):
    s = calc_spectrum(0.000001, 30000,  # cm-1
                      isotope=1,
                      pressure=1,  # bar
                      Tgas=Tags,  # K
                      mole_fraction={'CO2': 0.1, 'H2O': 0.2},
                      path_length=100,  # cm
                      databank='hitemp',  # or 'hitemp', 'geisa', 'exomol'
                      wstep='auto',
                      cutoff=0,
                     )
    I_L_nm = s.get_integral("radiance_noslit")
    E_L_nm = (I_L_nm * 10 * pi) / (Sigma * (Tags ** 4))
    for path_length in range(200, 6100, 100):
        s.rescale_path_length(path_length)
        I_L_nm = s.get_integral("radiance_noslit")
        E_L_nm = (I_L_nm * 10 * pi) / (Sigma * (Tags ** 4))
 
  

@erwanp
Copy link
Member

erwanp commented Nov 2, 2022

First thing : congratulations for computing all of this!

  1. Do you ensure that cutoff=0 in Radis?

  2. If so i think it's a sub Lorentzian behavior. Does the Kangwanpongpan paper give the lineshape model used?

@PrometheusYao
Copy link
Author

Thank you Erwan for your reply, your reply helped me a lot

  1. I made sure that cutoff=0 in Radis.

  2. The Lorentzian lineshape model is used in both Kangwanpongpan's paper and Mohammad Hadi Bordbar's paper.

  3. I have looked up and read some papers on sub-Lorentzian behavior in the past two days, but I still don't quite understand it. I would appreciate if you could recommend some classic papers or books on sub-Lorentzian behavior.

Sincerely thank you.

@erwanp
Copy link
Member

erwanp commented Nov 7, 2022

Hello

I had a quick read at the papers

  1. Reference on SubLorentzian : Hartmann is the reference on this, see Collisional Effects on Molecular Spectra

  2. Indeed it seems Kangwanpongpan & Bordbar both use a Lorentzian model. They do not include a sub-Lorentzian model. So their model is the same as current Radis model : pure Lorentzian with a truncation. One explanation might be the value of the truncation they use. I couldn't find which truncation Kangwanpongpan uses. Bordbar uses 500 cm-1 on each side

image

Their truncatino is based on no physical argument; I assume they just maximized the value until the results made no difference. We know that this is physically wrong : lines are not lorentzian. At least close to ambient temperature & pressure where we have extensive data from the atmosphere communities, we know truncatino should be around 50 cm-1 or (better) use a sub-Lorentzian model directly. See #340 for some calculations on the impact of truncatino.

I would : recompute one point using RADIS, for instance near 500 K, 60 atm; using a lineshape Truncation of 500 cm-1. This is not physically accurate but you should match Bordbar result, and confirm that this is the source of the difference. If that's the case, you should defintly publish your paper stating that the differences are due to wrong lineshape models in Bordbar.

Truncation half-width is implemented with the truncation parameter in calc_spectrum directly

calc_spectrum(... , truncation=500) 

If the hypothesis above are correct, Radis model is more accurate (with truncation at 50 cm-1).

Better: you should implement some subLorentizan behavior in RADIS ; it would be a first, and who be extremelly accurate.
It's quite easy to implement and I can help on getting you started.

Tagging @mariottop who might be interested in the topic. He might even help you with the paper if needed, emissivity is a strong topic of interest for him.

@erwanp
Copy link
Member

erwanp commented Mar 3, 2023

Hello @PrometheusYao do you have any update ?

@erwanp
Copy link
Member

erwanp commented Jul 30, 2023

@pag1pag you did a similar thing, did you use a dedicated function ?

@erwanp erwanp modified the milestones: 0.15, 0.16 Jul 30, 2023
@erwanp erwanp added the physics involves the physics label Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request physics involves the physics
Projects
None yet
Development

No branches or pull requests

3 participants