Ultra-fast reconstruction method for gas molecule absorption spectrum based on CUDA (Compute Unified Device Architecture)
Through the ultrafast reconstruction method of gas molecular absorption spectroscopy based on CUDA, the parallel line-by-line calculation program cuLBL is constructed using the HITRAN database and CUDA architecture, which solves the real-time problem of wide spectrum high resolution and non-uniform path calculation in the existing technology, and realizes rapid reconstruction and efficient calculation of gas molecular absorption spectroscopy.
Patent Information
- Application Number
- CN202510721137.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-02
Smart Images

Figure CN120581111A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of gas molecule absorption spectrum calculation, and in particular relates to a CUDA-based gas molecule absorption spectrum ultrafast reconstruction method. Background Art
[0002] Gas molecular absorption spectroscopy calculations play an irreplaceable fundamental role in atmospheric radiation transmission and target radiation simulation. With the iterative upgrades of technologies like infrared detection and laser telemetry, this field has placed higher technical demands on spectral resolution, computational accuracy, and operational efficiency.
[0003] The most widely used method for calculating gas molecular absorption spectra is the line-by-line integration method (LBL). This method implements spectral calculations through three key steps: first, obtaining the parameters of all spectral lines within the target spectral range; then, calculating the broadened line shape based on temperature and pressure; and finally, obtaining the absorption spectrum through wavenumber sampling and integration. While this method offers the advantages of intuitive principle and reliable accuracy, it faces bottlenecks such as exponentially increasing computing resource consumption and insufficient response speed, making it difficult to meet the real-time requirements of wide-spectrum, high-resolution scenarios and non-uniform path calculations.
[0004] The research community has developed a variety of fast algorithms using methods such as band-mode calculations and related K distributions. These algorithms essentially strike a balance between computational efficiency and resource consumption by approximating LBL results to a certain degree. However, existing methods still struggle to effectively address real-time challenges, especially in non-uniform path calculations where environmental parameters vary dramatically.
[0005] CUDA, the Computational Unified Device Architecture (CUDA), is a platform provided by Nvidia that uses GPUs to accelerate parallel computing. It is particularly suitable for computationally intensive scientific computing. Researchers have conducted research on high-resolution atmospheric spectral line parallel computing methods based on the CUDA architecture, achieving rapid calculations of gas molecular absorption spectra and demonstrating the breakthrough potential of the CUDA architecture in this field. Therefore, further optimizing CUDA-based methods for rapid calculations of gas molecular absorption spectra and, based on this, developing ultrafast reconstruction methods for gas molecular absorption spectra suitable for high real-time performance, high resolution, wide spectral range, and highly inhomogeneous paths will be of great significance for engineering applications in atmospheric radiation transfer calculations and target radiation simulations. Summary of the Invention
[0006] In order to meet the real-time requirements of wide-spectrum, high-resolution scenes and non-uniform path calculations, the present invention proposes a CUDA-based ultrafast reconstruction method for gas molecule absorption spectra.
[0007] The technical solution adopted by the present invention to solve the technical problem is:
[0008] A CUDA-based ultrafast reconstruction method for gas molecular absorption spectra includes the following steps:
[0009] Step 1: Get spectral line data
[0010] Based on the HITRAN database, the HITRAN application programming interface (HAPI) was used to obtain spectral line data, including the line center wave number, line intensity, air broadening half-width at half maximum, self-broadening half-width at half maximum, temperature dependence coefficient, transition low-energy state energy, and the number of spectral lines.
[0011] Step 2: Build the parallel line-by-line calculation program cuLBL
[0012] Based on CUDA, a program cuLBL is constructed for parallel line-by-line calculation based on the sampling wavenumber. The construction process includes: setting the sampling starting wavenumber, sampling cutoff wavenumber, sampling interval, line wing truncation wavenumber, sampling wavenumber data, number of samples, CUDA block size, grid stride number, and CUDA grid size; constructing the Voigt linear function as a CUDA device function; and constructing the CUDA kernel function.
[0013] Step 3: Calculate the absorption coefficient spectrum database
[0014] The starting point, end point and interval of temperature and pressure were set respectively, and the absorption coefficient spectrum database was calculated based on the spectral line data using the parallel line-by-line calculation program cuLBL.
[0015] Step 4: Build a database of spectral absorption coefficient fitting parameters
[0016] The temperature and pressure partitions, fitting types and methods are set, the temperature and pressure of each partition are standardized, the absorption coefficient spectrum database is partitioned and fitted, and the fitting parameters are stored to obtain a spectral absorption coefficient fitting parameter database.
[0017] Step 5: Implement the ultrafast reconstruction procedure of absorption coefficient spectrum
[0018] Based on CUDA, an ultrafast absorption coefficient spectrum reconstruction program is implemented. The implementation process includes: setting the second CUDA block size, calculating the second CUDA grid size; constructing the CUDA device function fitting function and the CUDA device function partition fitting function; and constructing the second CUDA kernel function.
[0019] Step 6: Reconstruct the gas molecule absorption spectrum
[0020] Based on the spectral absorption coefficient fitting parameter database, the absorption spectrum of gas molecules is reconstructed using the absorption coefficient spectrum ultrafast reconstruction program.
[0021] The above-mentioned method for ultrafast reconstruction of gas molecule absorption spectrum, step 1, further comprises:
[0022] The HITRAN application programming interface (HAPI) was used to download the CO2 at 1900 cm-1 from the HITRAN2020 database. -1 ~3500cm -1 Data packets within the wave number range;
[0023] Use the HITRAN application programming interface (HAPI) to analyze the spectral line center wave number, line intensity, air broadening half-width at half maximum, self-broadening half-width at half maximum, temperature dependence coefficient and transition low-energy state energy in the CO2 data package;
[0024] Store the spectral line center wave number, line intensity, air broadening half-width at half maximum, self-broadening half-width at half maximum, temperature dependence coefficient and transition low-energy state energy as v c 、S w , γ air , γ self 、n air and E lower . Use N v Indicates the number of spectral lines.
[0025] The above-mentioned method for ultrafast reconstruction of gas molecule absorption spectrum, step 2, further comprises:
[0026] (1) Set the sampling starting wave number w start , sampling cutoff wave number w end , sampling interval δ w 0.01cm -1 , line wing cutoff wave number w cutoff is the set value. , the calculation formula is as follows:.
[0027] Use w to store the data from w start to w end The interval is δ w The sampling wave number data includes w start and w end .
[0028] (2) Determine the number of samples N, which is calculated as follows:
[0029]
[0030] (3) Set the CUDA block size B size , Grid stride number G stride Calculate the CUDA grid size G for the set value size for:
[0031]
[0032] In the above formula, The symbol for rounding up.
[0033] (4) Construct CUDA device function Voigt linear function F voigt (v-v0,γ L ,γ D ), the calculation formula is as follows:
[0034]
[0035] In the above formula, v is the sampling wave number, v0 is the center wave number of the spectrum line, γ L is the Lorentz half-width at half maximum, γ D is the Doppler half-width at half maximum, H(x,y) is the value of the Voigt linear function obtained by the improved Humlcek algorithm.
[0036] (5) Construct CUDA kernel function F kernal (v c ,S′ w ,γ L ,γ D ,C v ,w,w cutoff ;a coef ):
[0037] Input parameters are: central wave number v c , correction line strength S′ w , Lorentz half-width at half maximum γ L , Doppler half-width at half maximum γ D , volume concentration C v , sampling wave number w, line wing cutoff wave number w cutoff .
[0038] Output parameters are: Absorption coefficient a coef , is an N-dimensional array.
[0039] The above-mentioned method for ultrafast reconstruction of gas molecule absorption spectrum, step 2, further comprises:
[0040] (1) Set the sampling starting wave number w start 2000cm -1 , sampling cutoff wave number w end 3333cm -1 , sampling interval δ w 0.01cm -1 , the line wing cutoff wave number w cutoff 25cm -1 .
[0041] (3) Set the CUDA block size B size128, grid stride number G stride is 3.
[0042] In the above-mentioned method for ultrafast reconstruction of gas molecular absorption spectra, the CUDA kernel function is constructed in step 2, and the process is as follows:
[0043] 1) Determine the number I of the CUDA thread Thread in the entire CUDA grid. The calculation formula is:
[0044] I=t idx +b idx B size (4)
[0045] In the above formula, t idx is the ID number of the CUDA thread, b idx The ID number of the CUDA block.
[0046] 2) Determine the stride length L stride , the calculation formula is:
[0047] L stride =G size B size (5)
[0048] 3) Let variable i=I.
[0049] 4) If i>N, go to process 10).
[0050] 5) Let variable j = 1.
[0051] 6) If j>N v , go to process 9).
[0052] 7) Let Δv = w(i) - v c (j).
[0053] If |Δv|<w cutoff ,make
[0054] a coef (i) = a coef (i)+C v S′ w (j)F voigt (Δv,γ L (j),γ D (j)). (6)
[0055] In the above formula, a coef (i) represents a coef The i-th element of S′ w (j) represents S′ w The jth data, γ L (j) represents γL The jth data, γ D (j) represents γ D The jth data.
[0056] 8) Let j=j+1 and go to process 6).
[0057] 9) Let i=i+L stride , go to process 4).
[0058] 10) Calculation completed.
[0059] The above-mentioned method for ultrafast reconstruction of gas molecule absorption spectrum, step 3, further comprises:
[0060] (1) Set the temperature starting point T start , temperature end point T end , temperature interval δ T is the set value, the number of temperature samples N T The calculation formula is as follows:
[0061]
[0062] In the above formula, is the floor symbol.
[0063] (2) Set the pressure starting point P start is 0.1atm, the pressure end point P end is 2atm, pressure interval δ P is 0.1atm, the number of pressure samples is N P The calculation formula is as follows:
[0064]
[0065] (3) Using the parallel line-by-line calculation program cuLBL, the CO2 absorption coefficient spectral database is calculated. The calculation process is as follows:
[0066] 1) Let variable i = 1.
[0067] 2) If i>N P , go to process 13).
[0068] 3) Let variable j = 1.
[0069] 4) If j>N T , go to process 12).
[0070] 5) Calculate the pressure point P = P start +iδ P , temperature point T=T start +jδ T .
[0071] 6) Calculate the volume concentration C v :
[0072]
[0073] In the above formula, k = 1.380649 × 10 -16 erg / K.
[0074] 7) Calculate the correction line strength S′ w :
[0075]
[0076] In the above formula, T ref The reference temperature is 296 K, c2 = 1.4387769 cm·K, Q(T) is the total internal partition function, and the total internal partition function is implemented using PYTIPS2021 of HAPI. w is the collection of all spectral line intensity data, v c is the central wave number corresponding to the spectral line, and the obtained S′ w It is the collection of all spectral line correction line intensity data.
[0077] 8) Calculate the Lorentz half-width at half maximum γ L , the calculation formula is as follows:
[0078]
[0079] In the above formula, P self is the partial pressure of gas molecules, the gas is pure CO2, that is, P self =P.n air , γ air and γ self They are the temperature dependence coefficients of all spectral lines, the half-width at half maximum of air broadening and the half-width at half maximum of self-broadening data, and the data correspond one to one. The obtained γ L It is the collection of the Lorentz half-width at half maximum data of all spectral lines.
[0080] 9) Doppler half-width at half maximum γ D :
[0081]
[0082] In the above formula, c = 2.99792458 × 10 10 cm / s,N A =6.02214129×10 23 mol -1 , M is the molecular weight of CO2 44. c is the central wave number data set corresponding to all spectral lines, and the obtained γ D It is the collection of all spectral line Doppler half-maximum half-width data.
[0083] 10) Set the central wave number v c , correction line strength S′ w , Lorentz half-width at half maximum γ L , Doppler half-width at half maximum γ D , volume concentration C v , sampling wave number w and line wing cutoff wave number w cutoff Copy it to the CUDA device and execute the calculation of the CUDA kernel function as follows:
[0084] F kernal <<<G size ,B size >>>(v c ,S′ w ,γ L ,γ D ,C v ,w,w cutoff ;a coef ) (13)
[0085] After CUDA threads are synchronized, a coef Copied back to the host and stored in the database DATA, represented as DATA[P,T;a coef ], representing the absorption coefficient spectrum data under pressure P and temperature T environment.
[0086] 11) Let j=j+1 and go to process 4).
[0087] 12) Let i=i+1 and go to process 2).
[0088] 13) After the calculation is completed, DATA is the CO2 absorption coefficient spectrum database.
[0089] The above-mentioned method for ultrafast reconstruction of gas molecule absorption spectrum, step 3, further comprises:
[0090] (1) Set the temperature starting point T start is 270K, the temperature end point T end is 1000K, the temperature interval δ T 10K;
[0091] (2) Set the pressure starting point P start is 0.1atm, the pressure end point P end is 2atm, pressure interval δ P is 0.1atm.
[0092] The above-mentioned method for ultrafast reconstruction of gas molecule absorption spectrum, step 4, further comprises:
[0093] (1) The temperature and pressure ranges are divided into the following zones:
[0094] Zone I: 270K≤T<600K, 0.1atm≤P<1atm.
[0095] Zone II: 600K≤T≤1000K, 0.1atm≤P<1atm.
[0096] Zone III: 600K≤T≤1000K, 1atm≤P≤2atm.
[0097] Zone IV: 270K≤T<600K, 1atm≤P≤2atm.
[0098] (2) Set the fitting type to a binary 5th-order polynomial:
[0099]
[0100] Set the fitting method to least squares.
[0101] (3) Perform partition fitting on a spectrum-by-spectrum basis to build a spectral absorption coefficient fitting parameter database. The process is as follows:
[0102] 1) Let variable i = 1.
[0103] 2) If i>N, go to step 5)
[0104] 3) Use w(i) to represent the i-th sampling wave number, a coef (i) represents the absorption coefficient corresponding to w(i).
[0105] Suppose the set of all pressure points and temperature points in zone I are P I and T I , extract all absorption coefficient data of wave number w(i) from the DATA database, expressed as DATA[P I ,T I ;a coef (i)].
[0106] Calculate P I The mean of MEAN(P I ) and standard deviation STD(P I ), calculate T I The mean MEAN(T I ) and standard deviation STD(T I ).
[0107] P I To standardize:
[0108]
[0109] TI To standardize:
[0110]
[0111] by is the independent variable x, is the y independent variable, DATA[P I ,T I ;a coef (i)] is the target value of f(x,y), and the 21 parameters a0~a are obtained by fitting using formula (14). 20 Stored in the database A-DATA, expressed as A-DATA[w(i),I; a0~a 20 ].
[0112] For regions II, III, and IV, the same operation as that for region I was used to obtain the MEAN (P II )、STD(P II )、MEAN(T II )、STD(T II )、MEAN(P III )、STD(P III )、MEAN(T III )、STD(T III )、MEAN(P IV )、STD(P IV )、MEAN(T IV )、STD(T IV )、A-DATA[w(i),II;a0~a 20 ]、A-DATA[w(i),III;a0~a 20 ] and A-DATA[w(i),IV;a0~a 20 ].
[0113] 4) Let i=i+1 and return to process 2).
[0114] 5) After the calculation is completed, all A-DATA databases are collectively called spectral absorption coefficient fitting parameter databases.
[0115] The above-mentioned method for ultrafast reconstruction of gas molecule absorption spectrum, step 5, further comprises:
[0116] (1) Let P s and T s The input pressure and temperature data, the number of data is N s .
[0117] (2) Set the second CUDA block size B′ sizeis 32, calculate the second CUDA grid size G′ size , the calculation formula is as follows:
[0118]
[0119] (3) Construct the second CUDA device function fitting function F fit (x,y,a0~a 20 ):
[0120]
[0121] In the above formula, x and y are the independent variable values, a0~a 20 is the fitting parameter.
[0122] (4) Construct the second CUDA device function partition fitting function F zone (P s ,T s ,w):
[0123] According to P s and T s Determine which temperature and pressure zone it belongs to. Assume it belongs to zone X (X∈[I,II,III,IV]), let:
[0124]
[0125] a0~a 20 =A-DATA[w,X;a0~a 20 ](twenty one)
[0126] In the above formula, P s and T s are input pressure and temperature respectively, MEAN(P X )、STD(P X )、MEAN(T X ) and STD(T X ) are the mean pressure, standard deviation of pressure, mean temperature and standard deviation of temperature in region X, respectively, and w is the wave number.
[0127] Then the second CUDA device function partition fitting function F zone (P s ,T s ,w) is calculated as:
[0128] F zone (P s ,T s ,w)=F fit (x,y,a0~a 20 ) (twenty two)
[0129] (5) Construct the second CUDA kernel function F′ kernal (P s ,T s ;a rcoef ):
[0130] Input parameters are: target temperature T s , target pressure P s .
[0131] The output parameters are: reconstruction absorption coefficient a rcoef , is N s A two-dimensional array of size N × N.
[0132] The second CUDA kernel function construction process is:
[0133] 1) Determine the number I′ of the second CUDA thread Thread in the entire second CUDA grid, using the following formula:
[0134] I=t idx +b idx B′ size (twenty three)
[0135] In the above formula, t idx is the ID number of the CUDA thread, b idx The ID number of the CUDA block.
[0136] 2) If i>N s , go to process 7).
[0137] 3) Let variable j = 1.
[0138] 4) If j>N, go to process 7).
[0139] 5) Order
[0140] a rcoef (i,j)=F zone (P s (i),T s (i),w(j)). (24)
[0141] In the above formula, a rcoef (i,j) represents a rcoef The element in row i and column j of P s (i) represents P s The i-th data, T s (i) represents T s The i-th data, w(j) represents the j-th sampling wave number.
[0142] 6) Let j=j+1 and go to process 4).
[0143] 7) Calculation completed.
[0144] In the above-mentioned method for ultrafast reconstruction of gas molecule absorption spectrum, step 6 further comprises:
[0145] The data P s and T s Copy it to the CUDA device and execute the calculation of the second CUDA kernel function as follows:
[0146] F′ kernal <<<G′ size ,B′ size >>>(P s ,T s ;a rcoef ) (25)
[0147] After CUDA threads are synchronized, a rcoef Copy back to the host side, at this time a rcoef That is the reconstructed gas molecule absorption spectrum, N s ×N two-dimensional array, the rows of the two-dimensional array are the same as P s and T s Correspondingly, the columns of the two-dimensional array correspond to the sampling wave number w.
[0148] The beneficial effects of the present invention are:
[0149] A CUDA-based ultrafast reconstruction method for gas molecular absorption spectra uses an improved Humlcek algorithm to partition and obtain Voigt line functions. The algorithm has low algorithm complexity and fast calculation speed while ensuring calculation accuracy.
[0150] A CUDA-based ultrafast reconstruction method for gas molecular absorption spectra deploys CUDA parallel computing according to the sampling wavenumber, avoiding data access conflicts caused by multiple threads updating the calculation results of the same sampling wavenumber at the same time.
[0151] A CUDA-based ultrafast reconstruction method for gas molecular absorption spectra uses grid stride technology to fully utilize the computing power of a single thread and further improve computational efficiency.
[0152] A CUDA-based method for ultrafast reconstruction of gas molecular absorption spectra uses LBL parallel calculation results to perform absorption coefficient partition fitting according to the sampling wavenumber. While ensuring accuracy, the data volume can be compressed by more than one order of magnitude. CUDA parallel technology is used a second time in the gas molecular absorption spectrum reconstruction process, further accelerating the calculation and achieving ultrafast reconstruction of gas molecular absorption spectra. BRIEF DESCRIPTION OF THE DRAWINGS
[0153] Figure 1 This is a flowchart of the ultrafast reconstruction of gas molecule absorption spectra according to the first embodiment of the present invention. DETAILED DESCRIPTION
[0154] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0155] Example 1
[0156] A CUDA-based method for ultrafast reconstruction of gas molecular absorption spectra, see Figure 1 First, HAPI was used to call the HITRAN database to obtain spectral line data, and a program called cuLBL was built based on CUDA to perform parallel line-by-line calculations according to the sampling wavenumber. Then, cuLBL was used to calculate a gas molecular absorption coefficient spectral database covering the temperature and pressure range. The absorption coefficient was partitioned and fitted according to the sampling wavenumber, and a fitting parameter database was constructed. Finally, a parallel absorption coefficient spectral reconstruction program was implemented based on CUDA, achieving ultrafast reconstruction of gas molecular absorption spectra.
[0157] To reconstruct CO2 at 2000cm -1 ~3333cm -1 The absorption coefficient in the wave number range is taken as an example, with a resolution of 0.01cm -1 , specifically including the following steps:
[0158] Step 1: Obtain spectral line data
[0159] Use HAPI to obtain spectral line data from the HITRAN2020 database.
[0160] The spectral line data include the central wave number of the spectral line, line intensity, air broadening half width at half maximum, self-broadening half width at half maximum, temperature dependence coefficient and transition low energy state energy, as well as the number of spectral lines.
[0161] The specific process is as follows:
[0162] (1) Use HAPI to download CO2 at 1900cm from the HITRAN2020 database -1 ~3500cm -1 Data packets within the wave number range.
[0163] (2) Use HAPI to analyze the spectral line center wave number, line intensity, air broadening half-width at half maximum, self-broadening half-width at half maximum, temperature dependence coefficient and transition low-energy state energy in the CO2 data package.
[0164] (3) Store the spectral line center wave number, line intensity, air broadening half-width at half maximum, self-broadening half-width at half maximum, temperature dependence coefficient and transition low-energy state energy as v c 、S w , γ air , γ self 、n air and Elower . Use N v Indicates the number of spectral lines.
[0165] At this point, the acquisition of spectral line data is completed.
[0166] Step 2: Build the parallel line-by-line calculation program cuLBL
[0167] Build the CUDA-based program cuLBL for parallel line-by-line computation based on the sampling wavenumber. This includes setting the sampling start wavenumber, sampling end wavenumber, sampling interval, line wing cutoff wavenumber, sampling wavenumber data, number of samples, CUDA block size, grid stride number, and CUDA grid size; constructing the Voigt linear shape function as a CUDA device function; and building the CUDA kernel function.
[0168] The specific process is as follows:
[0169] (1) Set the sampling starting wave number w start 2000cm -1 , sampling cutoff wave number w end 3333cm -1 , sampling interval δ w 0.01cm -1 , the line wing cutoff wave number w cutoff 25cm -1 .
[0170] Use w to store the data from w start to w end The interval is δ w The sampling wave number data (including w start and w end ).
[0171] (2) Determine the number of samples N:
[0172]
[0173] (3) Set the CUDA block size B size 128, grid stride number G stride 3, calculate the CUDA grid size G size for:
[0174]
[0175] in, The symbol for rounding up.
[0176] (4) Construct CUDA device function Voigt linear function F voigt (v-v0,γ L ,γD ):
[0177]
[0178] Among them, v is the sampling wave number, v0 is the center wave number of the spectrum line, γ L is the Lorentz half-width at half maximum, γ D is the Doppler half-width at half maximum, H(x,y) is the value of the Voigt linear function obtained by the improved Humlcek algorithm.
[0179] (5) Construct CUDA kernel function F kernal (v c ,S′ w ,γ L ,γ D ,C v ,w,w cutoff ;a coef ):
[0180] Input parameters: central wave number v c , correction line strength S′ w , Lorentz half-width at half maximum γ L , Doppler half-width at half maximum γ D , volume concentration C v , sampling wave number w, line wing cutoff wave number w cutoff .
[0181] Output parameter: Absorption coefficient a coef , is an N-dimensional array.
[0182] The process of building a CUDA kernel function is as follows:
[0183] 1) Determine the number of the CUDA thread (Thread) in the entire CUDA grid:
[0184] I=t idx +b idx B size (4)
[0185] Among them, t idx is the ID number of the CUDA thread, b idx The ID number of the CUDA block.
[0186] 2) Determine the stride length L stride :
[0187] L stride =G size B size (5)
[0188] 3) Let variable i=I.
[0189] 4) If i>N, go to process 10).
[0190] 5) Let variable j = 1.
[0191] 6) If j>N v , go to process 9).
[0192] 7) Let Δv = w(i) - v c (j).
[0193] If |Δv|<w cutoff ,make
[0194] a coef (i) = a coef (i)+C v S′ w (j)F voigt (Δv,γ L (j),γ D (j)). (6)
[0195] Among them, a coef (i) represents a coef The i-th element of S′ w (j) represents S′ w The jth data, γ L (j) represents γ L The jth data, γ D (j) represents γ D The jth data.
[0196] 8) Let j=j+1 and go to process 6).
[0197] 9) Let i=i+L stride , go to process 4).
[0198] 10) Calculation completed.
[0199] At this point, cuLBL is built.
[0200] Step 3: Calculate the absorption coefficient spectral database
[0201] Set the starting point, end point, and interval of temperature and pressure respectively. Based on the spectral line data from step 1, use the parallel line-by-line calculation program cuLBL built in step 2 to calculate the absorption coefficient spectrum database. The specific process is as follows:
[0202] (1) Set the temperature starting point T start is 270K, the temperature end point T end is 1000K, the temperature interval δ T is 10K, the number of temperature samples is N T for:
[0203]
[0204] in, is the floor symbol.
[0205] (2) Set the pressure starting point P start is 0.1atm, the pressure end point P end is 2atm, pressure interval δ P is 0.1atm, the number of pressure samples is N P for:
[0206]
[0207] (3) Use cuLBL to calculate the CO2 absorption coefficient spectral database. The process is as follows:
[0208] 1) Let variable i = 1.
[0209] 2) If i>N P , go to process 13).
[0210] 3) Let variable j = 1.
[0211] 4) If j>N T , go to process 12).
[0212] 5) Calculate the pressure point P = P start +iδ P , temperature point T=T start +jδ T .
[0213] 6) Calculate the volume concentration C v :
[0214]
[0215] Where k = 1.380649 × 10 -16 erg / K.
[0216] 7) Calculate the correction line strength S′ w :
[0217]
[0218] Where T ref The reference temperature is 296K, c2 = 1.4387769 cm·K, Q(T) is the total internal partition function, and this embodiment is implemented using PYTIPS2021 of HAPI. It should be noted that S w is the collection of all spectral line intensity data, v cis the central wave number corresponding to the spectral line. This process uses formula (10) to calculate all spectral lines and obtain S′ w It is also the collection of all spectral line correction line strength data.
[0219] 8) Calculate the Lorentz half-width at half maximum γ L :
[0220]
[0221] Among them, P self is the partial pressure of gas molecules. In this example, the gas is pure CO2, that is, P self =P. It should be noted that n air , γ air and γ self are the temperature dependence coefficients of all spectral lines, the half-width at half maximum of air broadening and the half-width at half-maximum of self-broadening, respectively. The data correspond one to one. This process uses formula (11) to calculate all spectral lines and obtain γ L It is also the collection of the Lorentz half-width at half maximum data of all spectral lines.
[0222] 9) Doppler half-width at half maximum γ D :
[0223]
[0224] Where c = 2.99792458 × 10 10 cm / s,N A =6.02214129×10 23 mol -1 , M is the molecular weight of CO2 44. It should be noted that v c is the central wave number data set corresponding to all spectral lines. This process uses formula (12) to calculate all spectral lines and obtain γ D It is also the collection of all spectral line Doppler half-maximum half-width data.
[0225] 10) Set the central wave number v c , correction line strength S′ w , Lorentz half-width at half maximum γ L , Doppler half-width at half maximum γ D , volume concentration C v , sampling wave number w and line wing cutoff wave number w cutoff Copy it to the CUDA device and execute the calculation of the CUDA kernel function as follows:
[0226] F kernal <<<G size ,B size >>>(v c ,S′w ,γ L ,γ D ,C v ,w,w cutoff ;a coef ) (13)
[0227] After CUDA threads are synchronized, a coef Copied back to the host and stored in the database DATA, represented as DATA[P,T;a coef ], representing the absorption coefficient spectrum data under pressure P and temperature T environment.
[0228] 11) Let j=j+1 and go to process 4).
[0229] 12) Let i=i+1 and go to process 2).
[0230] 13) After the calculation is completed, DATA is the CO2 absorption coefficient spectrum database.
[0231] At this point, the calculation of the gas molecule absorption coefficient spectrum database is completed.
[0232] Step 4: Construct a database of spectral absorption coefficient fitting parameters
[0233] Set the temperature and pressure partitions, fitting type and method, standardize the temperature and pressure of each partition, perform partition fitting on the gas molecular absorption coefficient spectral database obtained in step 3, store the fitting parameters, and obtain the spectral absorption coefficient fitting parameter database. The specific process is as follows:
[0234] (1) Divide the temperature and pressure ranges into zones to improve fitting accuracy. In this embodiment, the temperature and pressure zones are as follows:
[0235] Zone I: 270K≤T<600K, 0.1atm≤P<1atm.
[0236] Zone II: 600K≤T≤1000K, 0.1atm≤P<1atm.
[0237] Zone III: 600K≤T≤1000K, 1atm≤P≤2atm.
[0238] Zone IV: 270K≤T<600K, 1atm≤P≤2atm.
[0239] (2) Set the fitting type to a binary 5th-order polynomial:
[0240]
[0241] Set the fitting method to least squares.
[0242] (3) Perform partition fitting on a spectrum-by-spectrum basis to build a spectral absorption coefficient fitting parameter database. The process is as follows:
[0243] 1) Let variable i = 1.
[0244] 2) If i>N, go to step 5)
[0245] 3) Use w(i) to represent the i-th sampling wave number, a coef (i) represents the absorption coefficient corresponding to w(i).
[0246] Suppose the set of all pressure points and temperature points in zone I are P I and T I , extract all absorption coefficient data of wave number w(i) from the DATA database, expressed as DATA[P I ,T I ;a coef (i)].
[0247] Calculate P I The mean of MEAN(P I ) and standard deviation STD(P I ), calculate T I The mean MEAN(T I ) and standard deviation STD(T I ).
[0248] P I To standardize:
[0249]
[0250] T I To standardize:
[0251]
[0252] by is the independent variable x, is the y independent variable, DATA[P I ,T I ;a coef (i)] is the target value of f(x,y), and the 21 parameters a0~a are obtained by fitting using formula (14). 20 Stored in the database A-DATA, expressed as A-DATA[w(i),I; a0~a 20 ].
[0253] For regions II, III, and IV, the same operation as that for region I was used to obtain the MEAN (P II )、STD(P II )、MEAN(T II)、STD(T II )、MEAN(P III )、STD(P III )、MEAN(T III )、STD(T III )、MEAN(P IV )、STD(P IV )、MEAN(T IV )、STD(T IV )、A-DATA[w(i),II;a0~a 20 ]、A-DATA[w(i),III;a0~a 20 ] and A-DATA[w(i),IV;a0~a 20 ].
[0254] 4) Let i=i+1 and return to process 2).
[0255] 5) After the calculation is completed, all A-DATA databases are collectively called spectral absorption coefficient fitting parameter databases.
[0256] At this point, the construction of the spectral absorption coefficient fitting parameter database is completed.
[0257] Step 5: Implement the ultrafast reconstruction procedure of absorption coefficient spectrum
[0258] Based on CUDA, an ultrafast absorption coefficient spectrum reconstruction program is implemented. Specifically, it includes: setting the second CUDA block size, calculating the second CUDA grid size; constructing the CUDA device function fitting function and the CUDA device function partition fitting function; and constructing the second CUDA kernel function.
[0259] The specific process is as follows:
[0260] (1) Let P s and T s The input pressure and temperature data, the number of data is N s .
[0261] (2) Set the second CUDA block size B′ size is 32, calculate the second CUDA grid size G' size for:
[0262]
[0263] (3) Construct the second CUDA device function fitting function F fit (x,y,a0~a 20 ):
[0264]
[0265] Among them, x and y are independent variable values, a0~a 20 is the fitting parameter.
[0266] (4) Construct the second CUDA device function partition fitting function F zone (P s ,T s ,w):
[0267] According to P s and T s Determine which temperature and pressure zone it belongs to. Assume it belongs to zone X (X∈[I,II,III,IV]), let:
[0268]
[0269] a0~a 20 =A-DATA[w,X;a0~a 20 ](twenty one)
[0270] Among them, P s and T s are input pressure and temperature respectively, MEAN(P X )、STD(P X )、MEAN(T X ) and STD(T X ) are the mean pressure, standard deviation of pressure, mean temperature and standard deviation of temperature in region X, respectively, and w is the wave number.
[0271] but
[0272] F zone (P s ,T s ,w)=F fit (x,y,a0~a 20 )(twenty two)
[0273] (5) Construct the second CUDA kernel function F′ kernal (P s ,T s ;a rcoef ):
[0274] Input parameter: target temperature T s , target pressure P s .
[0275] Output parameter: Reconstructed absorption coefficient a rcoef , is N s A two-dimensional array of size N × N.
[0276] The second CUDA kernel function process is:
[0277] 1) Determine the number I′ of the second CUDA thread Thread in the entire second CUDA grid:
[0278] I=t idx +b idx B′ size (twenty three)
[0279] Among them, t idx is the ID number of the CUDA thread, b idx The ID number of the CUDA block.
[0280] 2) If i>N s , go to process 7).
[0281] 3) Let variable j = 1.
[0282] 4) If j>N, go to process 7).
[0283] 5) Order
[0284] a rcoef (i,j)=F zone (P s (i),T s (i),w(j)). (24)
[0285] Among them, a rcoef (i,j) represents a rcoef The element in row i and column j of P s (i) represents P s The i-th data, T s (i) represents T s The i-th data, w(j) represents the j-th sampling wave number.
[0286] 6) Let j=j+1 and go to process 4).
[0287] 7) Calculation completed.
[0288] At this point, the CUDA-based ultrafast reconstruction program for absorption coefficient spectra has been completed.
[0289] Step 6: Reconstruct the gas molecule absorption spectrum
[0290] Based on the spectral absorption coefficient fitting parameter database in step 4, the absorption coefficient spectrum ultrafast reconstruction program in step 5 is used to reconstruct the gas molecular absorption spectrum. The specific process is as follows:
[0291] The data P s and T s Copy it to the CUDA device and execute the calculation of the second CUDA kernel function as follows:
[0292] F′kernal <<<G′ size ,B′ size >>>(P s ,T s ;a rcoef ) (25)
[0293] After CUDA threads are synchronized, a rcoef Copy back to the host side, at this time a rcoef That is the reconstructed gas molecule absorption spectrum, N s ×N two-dimensional array, the rows of the two-dimensional array are the same as P s and T s Correspondingly, the columns of the two-dimensional array correspond to the sampling wave number w.
[0294] At this point, the gas molecule absorption spectrum is reconstructed.
Claims
1. A CUDA-based ultrafast reconstruction method for gas molecular absorption spectra, characterized in that: The following steps are involved: Step 1, obtain spectral line data: Based on the HITRAN database, the spectral line data were obtained using the HITRAN application programming interface HAPI; The spectral line data include the spectral line center wave number, line intensity, air broadening half width at half maximum, self-broadening half width at half maximum, temperature dependence coefficient and transition low energy state energy, as well as the number of spectral lines; Step 2: Build the parallel line-by-line calculation program cuLBL: Based on CUDA, a program called cuLBL is constructed to perform parallel line-by-line computation based on the sampling wavenumber. The construction process includes: setting the sampling starting wavenumber, sampling ending wavenumber, sampling interval, line wing cutoff wavenumber, sampling wavenumber data, number of samples, CUDA block size, grid stride number, and CUDA grid size; constructing the Voigt linear function as a CUDA device function; and constructing the CUDA kernel function. Step 3, calculate the absorption coefficient spectrum database: The starting point, end point and interval of temperature and pressure were set respectively, and the absorption coefficient spectrum database was calculated based on the spectral line data using the parallel line-by-line calculation program cuLBL; Step 4: Build a database of spectral absorption coefficient fitting parameters: Setting the temperature and pressure partitions, fitting type and method, standardizing the temperature and pressure of each partition, performing partition fitting on the absorption coefficient spectrum database, storing the fitting parameters, and obtaining a spectral absorption coefficient fitting parameter database; Step 5: Implement the ultrafast reconstruction procedure of the absorption coefficient spectrum: Based on CUDA, an ultrafast reconstruction program for absorption coefficient spectrum is implemented; the implementation process includes: setting the second CUDA block size, calculating the second CUDA grid size; constructing a CUDA device function fitting function and a CUDA device function partition fitting function; and constructing a second CUDA kernel function; Step 6: Reconstruct the gas molecule absorption spectrum: Based on the spectral absorption coefficient fitting parameter database, the absorption spectrum of gas molecules is reconstructed using the absorption coefficient spectrum ultrafast reconstruction program.
2. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 1, characterized in that: The step 1 further comprises: The HITRAN application programming interface (HAPI) was used to download the CO2 at 1900 cm-1 from the HITRAN2020 database. -1 ~3500cm -1 Data packets within the wave number range; Use the HITRAN application programming interface (HAPI) to analyze the spectral line center wave number, line intensity, air broadening half-width at half maximum, self-broadening half-width at half maximum, temperature dependence coefficient and transition low-energy state energy in the CO2 data package; Store the spectral line center wave number, line intensity, air broadening half-width at half maximum, self-broadening half-width at half maximum, temperature dependence coefficient and transition low-energy state energy as v c 、S w , γ air , γ self 、n air and E lower ; Use N v Indicates the number of spectral lines.
3. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 2, characterized in that: The step 2 further comprises: (1) Set the sampling starting wave number w start , sampling cutoff wave number w end , sampling interval δ w 0.01cm -1 , line wing cutoff wave number w cutoff is the set value;, the calculation formula is as follows:; Use w to store the data from w start to w end The interval is δ w The sampling wave number data includes w start and w end ; (2) Determine the number of samples N, which is calculated as follows: (3) Set the CUDA block size B size , Grid stride number G stride Calculate the CUDA grid size G for the set value size for: In the above formula, is the rounding symbol; (4) Construct CUDA device function Voigt linear function F voigt (v-v0,γ L ,γ D ), the calculation formula is as follows: In the above formula, v is the sampling wave number, v0 is the center wave number of the spectrum line, γ L is the Lorentz half-width at half maximum, γ D is the Doppler half-width at half maximum, H(x,y) is the Voigt linear function value obtained by the improved Humlcek algorithm; (5) Construct CUDA kernel function F kernal (v c ,S′ w ,γ L ,γ D ,C v ,w,w cutoff ;a coef ): Input parameters are: central wave number v c , correction line strength S′ w , Lorentz half-width at half maximum γ L , Doppler half-width at half maximum γ D , volume concentration C v , sampling wave number w, line wing cutoff wave number w cutoff ; Output parameters are: Absorption coefficient a coef , is an N-dimensional array.
4. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 3, characterized in that: The step 2 further comprises: (1) Set the sampling starting wave number w start 2000cm -1 , sampling cutoff wave number w end 3333cm -1 , sampling interval δ w 0.01cm -1 , the line wing cutoff wave number w cutoff 25cm -1 ; (3) Set the CUDA block size B size 128, grid stride number G stride is 3.
5. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 3, characterized in that: The step 2 constructs the CUDA kernel function, and the process is as follows: 1) Determine the number I of the CUDA thread Thread in the entire CUDA grid. The calculation formula is: I=t idx +b idx B size (4) In the above formula, t idx is the ID number of the CUDA thread, b idx The ID number of the CUDA block; 2) Determine the stride length L stride , the calculation formula is: L stride =G size B size (5) 3) Let variable i=I; 4) If i>N, go to process 10); 5) Set variable j = 1; 6) If j>N v , go to process 9); 7) Let Δv = w(i) - v c (j); If |Δv|<w cutoff ,make a coef (i)=a coef (i)+C v S w ′(j)F voigt (Δv,γ L (j),c D (j)); (6) In the above formula, a coef (i) represents a coef The i-th element of S′ w (j) represents S′ w The jth data, γ L (j) represents γ L The jth data, γ D (j) represents γ D The jth data; 8) Let j = j + 1, and go to process 6); 9) Let i=i+L stride , go to process 4); 10) Calculation completed.
6. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 2, characterized in that: The step 3 further comprises: (1) Set the temperature starting point T start , temperature end point T end , temperature interval δ T is the set value, the number of temperature samples N T The calculation formula is as follows: In the above formula, is the floor rounding symbol; (2) Set the pressure starting point P start is 0.1atm, the pressure end point P end is 2atm, pressure interval δ P is 0.1atm, the number of pressure samples is N P The calculation formula is as follows: (3) Using the parallel line-by-line calculation program cuLBL, the CO2 absorption coefficient spectral database is calculated. The calculation process is as follows: 1) Set variable i = 1; 2) If i>N P , go to process 13); 3) Let variable j = 1; 4) If j>N T , go to process 12); 5) Calculate the pressure point P = P start +iδ P , temperature point T=T start +jδ T ; 6) Calculate the volume concentration C v : In the above formula, k = 1.380649 × 10 -16 erg / K; 7) Calculate the correction line strength S′ w : In the above formula, T ref The reference temperature is 296 K, c2 = 1.4387769 cm·K, Q(T) is the total internal partition function, and the total internal partition function is implemented using PYTIPS2021 of HAPI; S w is the collection of all spectral line intensity data, v c is the central wave number corresponding to the spectral line, and the obtained S′ w It is the collection of all spectral line correction line intensity data; 8) Calculate the Lorentz half-width at half maximum γ L , the calculation formula is as follows: In the above formula, P self is the partial pressure of gas molecules, the gas is pure CO2, that is, P self =P;n air , γ air and γ self They are the temperature dependence coefficients of all spectral lines, the half-width at half maximum of air broadening and the half-width at half maximum of self-broadening data, and the data correspond one to one. The obtained γ L It is the collection of all spectral line Lorentz half-maximum half-width data; 9) Doppler half-width at half maximum γ D : In the above formula, c = 2.99792458 × 10 10 cm / s,N A =6.02214129×10 23 mol -1 , M is the molecular weight of CO2 44; v c is the central wave number data set corresponding to all spectral lines, and the obtained γ D It is the collection of all spectral line Doppler half-width at half maximum data; 10) Set the central wave number v c , correction line strength S′ w , Lorentz half-width at half maximum γ L , Doppler half-width at half maximum γ D , volume concentration C v , sampling wave number w and line wing cutoff wave number w cutoff Copy it to the CUDA device and execute the calculation of the CUDA kernel function as follows: F kernal <<<G size ,B size >>>(v c ,S′ w ,γ L ,γ D ,C v ,w,w cutoff ;a coef ) (13) After CUDA threads are synchronized, a coef Copied back to the host and stored in the database DATA, represented as DATA[P,T;a coef ], represents the absorption coefficient spectrum data under the pressure P and temperature T environment; 11) Let j = j + 1, and go to process 4); 12) Let i = i + 1, and go to process 2); 13) After the calculation is completed, DATA is the CO2 absorption coefficient spectrum database.
7. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 6, characterized in that: The step 3 further comprises: (1) Set the temperature starting point T start is 270K, the temperature end point T end is 1000K, the temperature interval δ T 10K; (2) Set the pressure starting point P start is 0.1atm, the pressure end point P end is 2atm, pressure interval δ P is 0.1atm.
8. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 2, characterized in that: The step 4 further comprises: (1) The temperature and pressure ranges are divided into the following zones: Zone I: 270K≤T<600K, 0.1atm≤P<1atm; Zone II: 600K≤T≤1000K, 0.1atm≤P<1atm; Zone III: 600K≤T≤1000K, 1atm≤P≤2atm; Zone IV: 270K≤T<600K, 1atm≤P≤2atm; (2) Set the fitting type to a binary 5th-order polynomial: Set the fitting method to least squares; (3) Perform partition fitting on a spectrum-by-spectrum basis to build a spectral absorption coefficient fitting parameter database. The process is as follows: 1) Set variable i = 1; 2) If i>N, go to step 5) 3) Use w(i) to represent the i-th sampling wave number, a coef (i) represents the absorption coefficient corresponding to w(i); Suppose the set of all pressure points and temperature points in zone I are P I and T I , extract all absorption coefficient data of wave number w(i) from the DATA database, expressed as DATA[P I ,T I ;a coef (i)]; Calculate P I The mean of MEAN(P I ) and standard deviation STD(P I ), calculate T I The mean MEAN(T I ) and standard deviation STD(T I ); P I To standardize: T I To standardize: by is the independent variable x, is the y independent variable, DATA[P I ,T I ;a coef (i)] is the target value of f(x,y), and the 21 parameters a0~a are obtained by fitting using formula (14). 20 Stored in the database A-DATA, expressed as A-DATA[w(i),I; a0~a 20 ]; For regions II, III, and IV, the same operation as that for region I was used to obtain the MEAN (P II )、STD(P II )、MEAN(T II )、STD(T II )、MEAN(P III )、STD(P III )、MEAN(T III )、STD(T III )、MEAN(P IV )、STD(P IV )、MEAN(T IV )、STD(T IV )、A-DATA[w(i),II;a0~a 20 ]、A-DATA[w(i),III;a0~a 20 ] and A-DATA[w(i),IV;a0~a 20 ]; 4) Let i=i+1, and return to step 2); 5) After the calculation is completed, all A-DATA databases are collectively called spectral absorption coefficient fitting parameter databases.
9. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 8, characterized in that: The step 5 further comprises: (1) Let P s and T s The input pressure and temperature data, the number of data is N s ; (2) Set the second CUDA block size B′ size is 32, calculate the second CUDA grid size G′ size , the calculation formula is as follows: (3) Construct the second CUDA device function fitting function F fit (x,y,a0~a 20 ): In the above formula, x and y are the independent variable values, a0~a 20 is the fitting parameter; (4) Construct the second CUDA device function partition fitting function F zone (P s ,T s ,w): According to P s and T s Determine which temperature and pressure zone it belongs to. Assume it belongs to zone X (X∈[I,II,III,IV]), let: a0~a 20 =A-DATA[w,X;a0~a 20 ] (21) In the above formula, P s and T s are input pressure and temperature respectively, MEAN(P X )、STD(P X )、MEAN(T X ) and STD(T X ) are the mean pressure, standard deviation of pressure, mean temperature and standard deviation of temperature in region X, respectively, and w is the wave number; Then the second CUDA device function partition fitting function F zone (P s ,T s ,w) is calculated as follows: F zone (P s ,T s ,w)=F fit (x,y,a0~a 20 ) (22) (5) Construct the second CUDA kernel function F′ kernal (P s ,T s ;a rcoef ): Input parameters are: target temperature T s , target pressure P s ; The output parameters are: reconstruction absorption coefficient a rcoef , is N s ×N two-dimensional array; The second CUDA kernel function construction process is: 1) Determine the number I′ of the second CUDA thread Thread in the entire second CUDA grid, using the following formula: I=t idx +b idx B′ size (23) In the above formula, t idx is the ID number of the CUDA thread, b idx The ID number of the CUDA block; 2) If i>N s , go to process 7); 3) Let variable j = 1; 4) If j>N, go to process 7); 5) Order a rcoef (i,j)=F zone (P s (i),T s (i),w(j)); (24) In the above formula, a rcoef (i,j) represents a rcoef The element in row i and column j of P s (i) represents P s The i-th data, T s (i) represents T s The i-th data, w(j) represents the j-th sampling wave number; 6) Let j = j + 1, and go to process 4); 7) Calculation completed.
10. The method for ultrafast reconstruction of gas molecule absorption spectrum according to claim 9, characterized in that: The step 6 further comprises: The data P s and T s Copy it to the CUDA device and execute the calculation of the second CUDA kernel function as follows: F′ kernal <<<G′ size ,B′ size >>>(P s ,T s ;a rcoef ) (25) After CUDA threads are synchronized, a rcoef Copy back to the host side, at this time a rcoef That is the reconstructed gas molecule absorption spectrum, N s ×N two-dimensional array, the rows of the two-dimensional array are the same as P s and T s Correspondingly, the columns of the two-dimensional array correspond to the sampling wave number w.