Open DancingQuanta opened 6 years ago
In current HAPI version, you can use the "Diluent" parameter in order to account for the broadening by gas mixtures and for partial pressures.
The Diluent parameter is a dictionary describing the molar fractions of gases in the mixture. For example, the absorption of H2O in mixture with air can be calculated using the following call:
nu,coef = absorptionCoefficient_Voigt(SourceTables='H2O',Diluent={'self':0.2,'air':0.8}) # 20% of H2O and 80% of air
If you want to consider multiple isotopic species of H2O at a time, you should calculate them separately (i.e. have each isotopologue in separate table), and then sum up the result in order to get the absorption of the mixture. This should be done in order to avoid ambiguity with the 'self' broadening parameter within single function call.
N.B. HITRAN intensities are multiplied by the "natural" abundances specific to each isotopologue; to account for different abundance, you should use the Components parameter of absorption coefficient function (see manual for details).
Hi, can the 'Diluent' be other gasses from the source tables? ie. if I wanted to compute the broadening of H2O by CO2 in a mixture of the two gasses, can the diluents be 'self' and 'CO2' for example? Or how would this work?
Absorption coefficients and broadening of gas mixtures to not seem to be explained in much detail in the HAPI manual
Yes, the Diluent parameter can contain any components (air, self, co2, h2o etc...) for which the corresponding broadening parameters (e.g. "gamma_co2' for the broadening by CO2) are present in the current table (unless the corresponding broadening part will be zero). We have updated the absorption coefficient section in the hapi manual which now hopefully explains it better (see the description of the Diluent parameter).
I see another example used the "Diluent" in the HAPI manual:
nu ,coef = absorptionCoefficient_Lorentz (SourceTables ='CO2' , Diluent ={'air ':1.0 })
If the molar fraction of air is 1, dose it mean the molar fraction of CO2 is zero? And what does the calculated absorption coefficient mean? It will be better if there is a detailed example in the manual to get the absorption coefficient for H2O and CO2 gas mixture.
@hitranonline I am incredibly stumped on how to take advantage of the Diluent parameter in HAPI.
I want to use the "Diluent" parameter to account for the broadening by gas mixtures/partial pressures when plotting the absorbance of 10% H2O by mole in air at 1000K and 1 atm for a doublet near 1392.67 nm across a path length of 10 cm.
However, when I use the parameter as suggested. . .
The Diluent parameter is a dictionary describing the molar fractions of gases in the mixture. For example, the absorption of H2O in mixture with air can be calculated using the following call:
nu,coef = absorptionCoefficient_Voigt(SourceTables='H2O',Diluent={'self':0.2,'air':0.8}) # 20% of H2O and 80% of air
And change my function call to output the correct units and input the correct mole-fractions:
nu,coef = absorptionCoefficient_Voigt(SourceTables='H2O_7185-7186', Environment='T':1000.0,'p':1.0}, HITRAN_units=False,Diluent={'self':0.1,'air':0.9},WavenumberStep= 0.005,WavenumberRange=None)
I expect coef
to contain a list of absorption coefficients in [cm-1]. I then plot the Absorbance (alpha = coef*L)
where L = 10 #[cm]
but clearly do not obtain to correct result. My absorbance appears to be an order of magnitude too large and my troubleshooting has lead me to believe I am either improperly using the Diluent parameter, or it has a bug.
I have attached my Absorbance plot and the baseline I am using for validation retrieved from an H2O example in Appendix D.1 (Hanson, R. K., Spearrin, R. M., & Goldenstein, C. S. (2016). Spectroscopy and Optical Diagnostics for Gases. In Spectroscopy and Optical Diagnostics for Gases. https://doi.org/10.1007/978-3-319-23252-2)
Can you please point out an error in my implementation of the Diluent parameter, or resources that show the proper implementation and correspondingly correct absorption coefficients returned when using it?
Thanks, Gibson
EDIT For those following the thread, answers to my above questions are shared on issue #14
Could you tell me following code is correct? I think "Diluent" dose not work well.
spectrum_begin = 7194.1156# cm^-1 spectrum_end = 7219.9956; # cm^-1 db_begin('data') name = 'H2O' moleculeID =1 isotopologueID = 1 fetch(name, moleculeID, isotopologueID, spectrum_begin, spectrum_end) nu,coef = absorptionCoefficient_Voigt(SourceTables=name, Diluent={'self':1.0, 'air':0.0}, Environment={'l':26.05, 'p':1.0, 'T':373.15}, HITRAN_units=False, )
I attached Fig. of calculation result Generally, H2O absorption rises with increasing H2O concentration. But the opposite result was obtained (At Fig, H2O absorption falls with increasing H2O concentration. )
.
Hello, If the species I am considering is, for example, H2O (all isotopes), how much H2O is there in relation to the broadening mixture? In other words, what does it means to set diluent = {'self' : 1} or diluent = {'air' : 1} or diluent = {'H2O': 1} in relation to the absorbing species? Note that I get different results for each of these. I have read the HAPI manual and tried to research articles online, and I understand what this does to the gamma broadening coefficient via the equations. What I don't understand is the proportion/or what this actually means.
Hello,
Apologies for the late response. When you set different proportion of diluent gases it affects only the broadening calculation. For instance if you have a 50/50 (or I should say 0.5/05) mixture of self and air gamma_effective=0.5gamma_air+0.5gamma_self I hope this makes sense.
Sincerely, Iouli Godon
On Mon, Mar 7, 2022 at 8:49 AM 'rde-girl' via HITRANOnline < @.***> wrote:
Hello, If the species I am considering is, for example, H2O (all isotopes), how much H2O is there in relation to the broadening mixture? In other words, what does it means to set diluent = {'self' : 1} or diluent = {'air' : 1} in relation to the absorbing species? I have read the HAPI manual and tried to research articles online, and I understand what this does to the gamma broadening coefficient via the equations. What I don't understand is the proportion/or what this actually means.
— Reply to this email directly, view it on GitHub https://github.com/hitranonline/hapi/issues/3#issuecomment-1060707264, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7FD56ZIV2KR67HJGE6O23U6YCOTANCNFSM4FPJIAAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
-- HITRAN Online
You received this message because you are subscribed to the Google Groups "HITRANOnline" group. To unsubscribe from this group and stop receiving emails from it, send an email to @.*** To view this discussion on the web visit https://groups.google.com/d/msgid/hitranonline/hitranonline/hapi/issues/3/1060707264%40github.com https://groups.google.com/d/msgid/hitranonline/hitranonline/hapi/issues/3/1060707264%40github.com?utm_medium=email&utm_source=footer .
I am sorry but I can't fully agree with the developer's answer.
Indeed, when using anything else than 'air' as a broadener the code will revert to default values for gamma silently
Proof of that: try with 'fkjdsfkk' as a key in the Diluent dictionary and see that no warnings are issued.
However, if you change the call to the ladder() function by adding 'flag_exception=True', you will see this Exception:
Exception: not found in DB: ['n_CO2', 'gamma_CO2', 'gamma_CO2']
It happens with the H2O molecule, meaning that broadening of water by CO2 is not known, and I say why not?
So we have two problems here:
1/ No warning is issued when a non existing diluent is used: this is VERY DANGEROUS! 2/ CO2 broadening coefs exists in the Hitran DB, but not for all molecules, there should be some indication of that
The documentation on the HITRAN website explained that it is possible to calculate the Lorentzian HWHM with partial pressure. I see that the
absorptionCoefficient_Lorentz
and otherabsorptionCoefficient_
does not support the partial pressure.Would it be possible to add this partial pressure variable please?