GRINS-0.8.0
|
HITRAN interface object. More...
#include <hitran.h>
Public Member Functions | |
HITRAN (const std::string &data_file, const std::string &partition_function_file, libMesh::Real T_min, libMesh::Real T_max, libMesh::Real T_step) | |
Constructor. More... | |
unsigned int | isotopologue (unsigned int index) |
Isotopologue ID. More... | |
libMesh::Real | nu0 (unsigned int index) |
Linecenter wavenumber [ ]. More... | |
libMesh::Real | sw (unsigned int index) |
Linestrength [ ]. More... | |
libMesh::Real | gamma_air (unsigned int index) |
Air-broadening half-width [ ]. More... | |
libMesh::Real | gamma_self (unsigned int index) |
Self-broadening half-wdith [ ]. More... | |
libMesh::Real | elower (unsigned int index) |
Lower state energy of transition [ ]. More... | |
libMesh::Real | n_air (unsigned int index) |
Temperature coefficient []. More... | |
libMesh::Real | delta_air (unsigned int index) |
Air pressure-induced line shift [ ]. More... | |
libMesh::Real | partition_function (libMesh::Real T, unsigned int iso) |
unsigned int | get_data_size () |
Return the data size. More... | |
libMesh::Real | partition_function_derivative (libMesh::Real T, unsigned int iso) |
Finite difference derivative for partition function. More... | |
Protected Member Functions | |
int | T_index (libMesh::Real T) |
Find the index into _T corresponding to the given temperature. More... | |
libMesh::Real | get_partition_function_value (libMesh::Real T, unsigned int iso) |
Search through the partition function data to get value for given temperature. More... | |
libMesh::Real | interpolate_values (int index_r, libMesh::Real T_star, const std::vector< libMesh::Real > &y) const |
Linear interpolation helper function. More... | |
HITRAN () | |
User should not call empty constructor. More... | |
Protected Attributes | |
libMesh::Real | _Tmin |
libMesh::Real | _Tmax |
libMesh::Real | _Tstep |
int | _data_size |
Size of spectroscopic data. More... | |
int | _q_size |
Size of partition function data. More... | |
libMesh::Real | _T0 |
Reference temperature (296K) More... | |
std::vector< libMesh::Real > | _qT0 |
std::vector< unsigned int > | _isotop |
std::vector< libMesh::Real > | _nu |
std::vector< libMesh::Real > | _sw |
std::vector< libMesh::Real > | _gamma_air |
std::vector< libMesh::Real > | _gamma_self |
std::vector< libMesh::Real > | _elower |
std::vector< libMesh::Real > | _n |
std::vector< libMesh::Real > | _delta_air |
std::vector< std::vector< libMesh::Real > > | _qT |
Vector for partition function values for all isotopologues. More... | |
HITRAN interface object.
This class provides an interface to utilize data from the HITRAN Spectroscopic Database. Data can be pulled directly from the HITRAN website, or through the HITRAN python API, HAPI.
Two files must be provided to this class, one with various data members, and one with values of the partition function at various temperatures.
The data file must contain comma-separated values for individual spectrscopic lines in the following format:
Isotopologue,Linecenter,Linestrength,Air-broadened Half Width,Self-Broadened Half Width,Lower State Energy,Temperature Coefficient,Air-Pressure Shift
The partition function file must contain comma-separated values for each isotopologue at the same temperature values. The temperature limits themselves are specified as inputs to the constructor.
Note the partition function data must explicitly include a value at the given reference temperature, which is currently 296K for HITRAN.
The basic units for values are those given by HITRAN, which currently are [cm] and [atm]
GRINS::HITRAN::HITRAN | ( | const std::string & | data_file, |
const std::string & | partition_function_file, | ||
libMesh::Real | T_min, | ||
libMesh::Real | T_max, | ||
libMesh::Real | T_step | ||
) |
Constructor.
data_file | A file containing values for the required quantities, formatted as described above |
partition_function_file | A file containing partition function values, formatted as described above |
T_min | The minimum temperature for the partition function values, inclusive |
T_max | The maximum temperature for the partition function values, inclusive |
T_step | The step between successive temperature values |
Definition at line 40 of file hitran.C.
References _data_size, _delta_air, _elower, _gamma_air, _gamma_self, _isotop, _n, _nu, _q_size, _qT, _qT0, _sw, _T0, and GRINS::StringUtilities::split_string_real().
|
protected |
User should not call empty constructor.
libMesh::Real GRINS::HITRAN::delta_air | ( | unsigned int | index | ) |
Air pressure-induced line shift [ ].
Definition at line 228 of file hitran.C.
References _delta_air.
Referenced by GRINSTesting::HITRANtest::parse_from_file().
libMesh::Real GRINS::HITRAN::elower | ( | unsigned int | index | ) |
Lower state energy of transition [ ].
Definition at line 216 of file hitran.C.
References _elower.
Referenced by GRINSTesting::HITRANtest::parse_from_file().
libMesh::Real GRINS::HITRAN::gamma_air | ( | unsigned int | index | ) |
Air-broadening half-width [ ].
Definition at line 204 of file hitran.C.
References _gamma_air.
Referenced by GRINSTesting::HITRANtest::parse_from_file().
libMesh::Real GRINS::HITRAN::gamma_self | ( | unsigned int | index | ) |
Self-broadening half-wdith [ ].
Definition at line 210 of file hitran.C.
References _gamma_self.
Referenced by GRINSTesting::HITRANtest::parse_from_file().
unsigned int GRINS::HITRAN::get_data_size | ( | ) |
|
protected |
Search through the partition function data to get value for given temperature.
Definition at line 246 of file hitran.C.
References _qT, interpolate_values(), and T_index().
Referenced by partition_function().
|
protected |
unsigned int GRINS::HITRAN::isotopologue | ( | unsigned int | index | ) |
Isotopologue ID.
Definition at line 186 of file hitran.C.
References _isotop.
Referenced by GRINSTesting::HITRANtest::parse_from_file().
libMesh::Real GRINS::HITRAN::n_air | ( | unsigned int | index | ) |
Temperature coefficient [].
Definition at line 222 of file hitran.C.
References _n.
Referenced by GRINSTesting::HITRANtest::parse_from_file().
libMesh::Real GRINS::HITRAN::nu0 | ( | unsigned int | index | ) |
Linecenter wavenumber [ ].
Definition at line 192 of file hitran.C.
References _nu.
Referenced by GRINSTesting::HITRANtest::parse_from_file().
libMesh::Real GRINS::HITRAN::partition_function | ( | libMesh::Real | T, |
unsigned int | iso | ||
) |
Returns the value of the partition function of the given isotopologue at the given temperature
Definition at line 234 of file hitran.C.
References _qT0, _T0, and get_partition_function_value().
Referenced by GRINSTesting::HITRANtest::parse_from_file(), and partition_function_derivative().
libMesh::Real GRINS::HITRAN::partition_function_derivative | ( | libMesh::Real | T, |
unsigned int | iso | ||
) |
Finite difference derivative for partition function.
Definition at line 158 of file hitran.C.
References _Tmax, _Tmin, _Tstep, and partition_function().
libMesh::Real GRINS::HITRAN::sw | ( | unsigned int | index | ) |
Linestrength [ ].
Definition at line 198 of file hitran.C.
References _sw.
Referenced by GRINSTesting::HITRANtest::parse_from_file().
|
protected |
Find the index into _T corresponding to the given temperature.
Definition at line 264 of file hitran.C.
Referenced by get_partition_function_value().
|
protected |
Size of spectroscopic data.
Definition at line 110 of file hitran.h.
Referenced by get_data_size(), and HITRAN().
|
protected |
Definition at line 130 of file hitran.h.
Referenced by delta_air(), and HITRAN().
|
protected |
|
protected |
Definition at line 126 of file hitran.h.
Referenced by gamma_air(), and HITRAN().
|
protected |
Definition at line 127 of file hitran.h.
Referenced by gamma_self(), and HITRAN().
|
protected |
Definition at line 123 of file hitran.h.
Referenced by HITRAN(), and isotopologue().
|
protected |
|
protected |
|
protected |
|
protected |
Vector for partition function values for all isotopologues.
Definition at line 133 of file hitran.h.
Referenced by get_partition_function_value(), and HITRAN().
|
protected |
Value of partition function at reference temperature for all isotopologues. Cached since it is used frequently
Definition at line 120 of file hitran.h.
Referenced by HITRAN(), and partition_function().
|
protected |
|
protected |
Reference temperature (296K)
Definition at line 116 of file hitran.h.
Referenced by HITRAN(), and partition_function().
|
protected |
Definition at line 107 of file hitran.h.
Referenced by interpolate_values(), and partition_function_derivative().
|
protected |
Definition at line 107 of file hitran.h.
Referenced by interpolate_values(), partition_function_derivative(), and T_index().
|
protected |
Definition at line 107 of file hitran.h.
Referenced by interpolate_values(), partition_function_derivative(), and T_index().