Cantera  2.1.2
rotor.cpp
Go to the documentation of this file.
1 /**
2  * @file rotor.cpp
3  *
4 */
5 #include "cantera/base/ct_defs.h"
7 
8 namespace Cantera
9 {
10 
11 /**
12  * Constructor.
13  *
14  * @param Bv Rotational constant, wavenumbers.
15  * @dipoleMoment permanent dipole moment.
16  * @param Dv Coefficient describing centrifugal
17  * effects on the bond length. For a rigid rotor, Bv = 0.
18  * @param Hv Coefficient describing higher-order vibration-rotation
19  * interactions. For a rigid rotor, Hv = 0.
20  */
21 Rotor::Rotor(doublereal Bv, doublereal dipoleMoment,
22  doublereal Dv, doublereal Hv) : m_Bv(Bv),
23  m_Dv(Dv),
24  m_Hv(Hv),
25  m_dipole(dipoleMoment) {}
26 
27 /**
28  * The energy of the level with rotational quantum number J,
29  * in wavenumber units.
30  * \f[
31  * E(J) = J(J+1)B - [J(J+1)]^2 D + [J(J+1)]^3H
32  * \f]
33  * For a rigid rotor, only B is non-zero. The parameters B, D, and H
34  * are set in the constructor.
35  */
36 doublereal Rotor::energy_w(int J)
37 {
38  int jjp1 = J*(J + 1);
39  return jjp1*(m_Bv + jjp1*(m_Hv*jjp1 - m_Dv));
40 }
41 
42 /**
43  * The number of quantum states with the same J. For a
44  * quantum-mechanical rotor, this is simply 2J+1.
45  */
47 {
48  return 2*J + 1;
49 }
50 
51 /**
52  * The rotational partition function.
53  *
54  * If T/Trot > 100, then the classical value (T/Trot) is
55  * is returned. Otherwise, it is computed as a sum
56  * \f[
57  * z = \sum_{J=0}^{J_{max}} (2J + 1) \exp(-E(J)/kT)
58  * \f]
59  */
60 doublereal Rotor::partitionFunction(doublereal T, int cutoff)
61 {
62  int j = 0;
63  doublereal T_Trot = wnum_to_J(m_Bv)/(Boltzmann*T);
64  if (T_Trot > 100.0) {
65  return T_Trot;
66  } else {
67  if (cutoff < 0) {
68  cutoff = (int)(3.0*sqrt(T/m_Bv));
69  }
70  doublereal dsum = 0.0, sum = 0.0;
71  for (j = 0; j < cutoff; j++) {
72  dsum = degeneracy(j)*exp(-wnum_to_J(energy_w(j))/(Boltzmann * T));
73  sum += dsum;
74  }
75  return sum;
76  }
77 }
78 
79 /**
80  * Ratio of the population of all states with rotational quantum
81  * number J to the ground state population.
82  */
83 doublereal Rotor::relPopulation(int J, doublereal T)
84 {
85  return degeneracy(J)*exp(-wnum_to_J(energy_w(J))/(Boltzmann*T));
86 }
87 
88 /**
89  * The frequency at which radiation is absorbed by a transition
90  * from the lower to the upper state in wavenumber units.
91  */
92 doublereal Rotor::frequency(int J_lower, int J_upper)
93 {
94  return energy_w(J_upper) - energy_w(J_lower);
95 }
96 
97 /**
98  * The spectral intensity of a rotational transition.
99  */
100 doublereal Rotor::intensity(int J_lower, int J_upper, doublereal T)
101 {
102  int dJ = J_upper - J_lower;
103  if (dJ > 1 || dJ < -1) {
104  return 0;
105  }
106  return relPopulation(J_lower, T);
107 }
108 
109 }
Rotor()
Default Constructor.
Definition: rotor.h:35
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
doublereal intensity(int J_lower, int J_upper, doublereal T)
The spectral intensity of a rotational transition.
Definition: rotor.cpp:100
doublereal relPopulation(int J, doublereal T)
Ratio of the population of all states with rotational quantum number J to the ground state population...
Definition: rotor.cpp:83
int degeneracy(int J)
The number of quantum states with the same J.
Definition: rotor.cpp:46
doublereal wnum_to_J(doublereal w)
Convert from wavenumbers to Joules.
Definition: rotor.h:76
doublereal partitionFunction(doublereal T, int cutoff=-1)
The rotational partition function.
Definition: rotor.cpp:60
Header file for class Rotor.
doublereal energy_w(int J)
The energy of the level with rotational quantum number J, in wavenumber units.
Definition: rotor.cpp:36
doublereal frequency(int J_lower, int J_upper)
The frequency at which radiation is absorbed by a transition from the lower to the upper state in wav...
Definition: rotor.cpp:92
const doublereal Boltzmann
Boltzmann's constant [J/K].
Definition: ct_defs.h:78