@@ -117,6 +117,62 @@ void Ions::calc_electron_temperature(Neutrals neutrals, Grid grid, Times time) {
117
117
JParallel = calc_thermoelectric_current (grid);
118
118
}
119
119
120
+ report.print (4 , " Calculating electron temperature" );
121
+
122
+ arma_cube sources = Qphe + Qencm + Qeicm + Qrotm + Qf + Qexc + Qvib_O2 + Qvib_N2
123
+ + QIonization + Qenc_v + Qeic_v;
124
+ arma_cube sources_temp_dependent = Qencp + Qeicp + Qrotp;
125
+
126
+
127
+ // ============= CALCULATE TEMPERATURE =================
128
+ arma_vec temp1d (nAlts);
129
+ arma_vec lambda1d (nAlts);
130
+ arma_vec front1d (nAlts);
131
+ arma_vec dalt1d (nAlts);
132
+ arma_vec conduction1d (nAlts);
133
+ arma_vec sources1d (nAlts);
134
+ arma_vec sources_tempdep_1d (nAlts);
135
+ arma_vec ratios (nAlts);
136
+ arma_vec density_ratio (nAlts);
137
+
138
+ // Get the time step size
139
+ precision_t dt = time.get_dt ();
140
+
141
+
142
+ for (int64_t iLon = nGCs; iLon < nLons - nGCs; iLon++) {
143
+ for (int64_t iLat = nGCs; iLat < nLats - nGCs; iLat++) {
144
+ temp1d = electron_temperature_scgc.tube (iLon, iLat);
145
+ temp1d (0 ) = neutrals.temperature_scgc (iLon, iLat, 0 );
146
+ temp1d (1 ) = neutrals.temperature_scgc (iLon, iLat, 1 );
147
+ lambda1d = lambda.tube (iLon, iLat);
148
+ lambda1d (1 ) = lambda1d (2 );
149
+ lambda1d (0 ) = lambda1d (2 );
150
+ front1d = 3.0 / 2.0 * cKB * species[nSpecies].density_scgc .tube (iLon, iLat);
151
+ dalt1d = grid.dalt_lower_scgc .tube (iLon, iLat);
152
+ sources1d = sources.tube (iLon, iLat);
153
+ sources1d = sources1d / front1d;
154
+
155
+ sources_tempdep_1d = sources_temp_dependent.tube (iLon, iLat);
156
+ sources_tempdep_1d = sources_tempdep_1d / front1d;
157
+
158
+ conduction1d.zeros (); // reset temp variable to zero
159
+ conduction1d = solver_conduction (temp1d,
160
+ lambda1d,
161
+ front1d,
162
+ sources1d,
163
+ dalt1d,
164
+ dt / 10 .,
165
+ nGCs,
166
+ false ,
167
+ sources_tempdep_1d);
168
+
169
+ // The conduction solver gives Tnew-Told, so divide by dt
170
+ conduction1d.clamp (200 , 6000 );
171
+ electron_temperature_scgc.tube (iLon, iLat) = conduction1d;
172
+ }}
173
+
174
+ // electron_temperature_scgc = neutrals.temperature_scgc;
175
+
120
176
report.exit (function);
121
177
}
122
178
0 commit comments