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