@@ -60,8 +60,11 @@ class Neutrals {
60
60
std::vector<arma_cube> velocity_vcgc;
61
61
std::vector<arma_cube> newVelocity_vcgc;
62
62
63
- // / Acceleration of each species (m/s^2)
63
+ // / Acceleration of each species (m/s^2) due to friction term
64
64
std::vector<arma_cube> acc_neutral_friction;
65
+
66
+ // / Coefficient for the friction term (sum of friction coefs with others)
67
+ arma_cube neutral_friction_coef;
65
68
66
69
// / Acceleration of each species based on Eddy contribution.
67
70
// / Only in vertical direction.
@@ -72,6 +75,8 @@ class Neutrals {
72
75
73
76
// / concentration (density of species / total density)
74
77
arma_cube concentration_scgc;
78
+ // mass concentration (mass * density of species / rho)
79
+ arma_cube mass_concentration_scgc;
75
80
76
81
// / Diffusion through other neutral species:
77
82
std::vector<float > diff0;
@@ -169,6 +174,9 @@ class Neutrals {
169
174
// / Eddy Diffusion
170
175
arma_cube kappa_eddy_scgc;
171
176
177
+ // / Viscosity
178
+ arma_cube viscosity_scgc;
179
+
172
180
// / O cooling
173
181
arma_cube O_cool_scgc;
174
182
@@ -183,6 +191,15 @@ class Neutrals {
183
191
184
192
// Source terms:
185
193
194
+ // Bulk acceleration due to collisions with ions:
195
+ std::vector<arma_cube> acc_ion_collisions;
196
+
197
+ // Bulk acceleration due to coriolis
198
+ std::vector<arma_cube> acc_coriolis;
199
+
200
+ // Total bulk acceleration
201
+ std::vector<arma_cube> acc_sources_total;
202
+
186
203
// / Bulk neutral thermal conduction temperature change rate (K/s)
187
204
arma_cube conduction_scgc;
188
205
@@ -192,6 +209,15 @@ class Neutrals {
192
209
// / Bulk neutral chemical heating temperatuare change (K/s)
193
210
arma_cube heating_chemical_scgc;
194
211
212
+ // Bulk neutral collisional heating with ions (K/s)
213
+ arma_cube heating_ion_friction_scgc;
214
+
215
+ // Bulk neutral collisional heating with ions (K/s)
216
+ arma_cube heating_ion_heat_transfer_scgc;
217
+
218
+ // Total heating sources
219
+ arma_cube heating_sources_total;
220
+
195
221
// / Nuetral gas direct absorption heating efficiency (~5%)
196
222
precision_t heating_efficiency;
197
223
@@ -294,6 +320,11 @@ class Neutrals {
294
320
**/
295
321
void calc_scale_height (Grid grid);
296
322
323
+ /* *********************************************************************
324
+ \brief Calculate the viscosity coefficient
325
+ **/
326
+ void calc_viscosity ();
327
+
297
328
/* *********************************************************************
298
329
\brief Calculate the eddy diffusion coefficient in valid pressure
299
330
**/
@@ -303,7 +334,13 @@ class Neutrals {
303
334
\brief Calculate the concentration for each species (species ndensity / total ndensity)
304
335
**/
305
336
void calc_concentration ();
306
-
337
+
338
+ /* *********************************************************************
339
+ \brief Calculate the density of each species from the mass concentration
340
+ for each species and rho (ndensity = con * rho / mass)
341
+ **/
342
+ void calc_density_from_mass_concentration ();
343
+
307
344
/* *********************************************************************
308
345
\brief Calculate the bulk mean major mass
309
346
**/
@@ -335,25 +372,24 @@ class Neutrals {
335
372
void calc_cMax ();
336
373
337
374
/* *********************************************************************
338
- \brief Calculate dt (cell size / cMax) in each direction, and take min
339
- \param dt returns the neutral time-step
375
+ \brief Calculate the chapman integrals for the individual species
340
376
\param grid The grid to define the neutrals on
341
377
**/
342
- precision_t calc_dt (Grid grid);
343
- precision_t calc_dt_cubesphere (Grid grid);
378
+ void calc_chapman (Grid grid);
344
379
345
380
/* *********************************************************************
346
- \brief Calculate the chapman integrals for the individual species
381
+ \brief Calculate the neutral bulk vertical thermal conduction
347
382
\param grid The grid to define the neutrals on
383
+ \param time The times within the model (dt is needed)
348
384
**/
349
- void calc_chapman (Grid grid);
385
+ void update_temperature (Grid grid, Times time );
350
386
351
387
/* *********************************************************************
352
- \brief Calculate the neutral bulk vertical thermal conduction
388
+ \brief Calculate the neutral bulk horizontal viscosity
353
389
\param grid The grid to define the neutrals on
354
390
\param time The times within the model (dt is needed)
355
391
**/
356
- void calc_conduction (Grid grid, Times time);
392
+ void update_horizontal_velocity (Grid grid, Times time);
357
393
358
394
/* *********************************************************************
359
395
\brief Calculate the O radiative cooling
@@ -368,8 +404,10 @@ class Neutrals {
368
404
/* *********************************************************************
369
405
\brief Add all of the neutral source terms to each of the equations
370
406
\param time The times within the model (dt is needed)
407
+ \param planet Need things like rotation rate
408
+ \param grid Need things like radius
371
409
**/
372
- void add_sources (Times time);
410
+ void add_sources (Times time, Planets planet, Grid grid );
373
411
374
412
/* *********************************************************************
375
413
\brief Set boundary conditions for the neutrals
@@ -415,7 +453,7 @@ class Neutrals {
415
453
/* ****************************************************************************
416
454
\brief Checks for nans and +/- infinities in density, temp, and velocity
417
455
**/
418
- bool check_for_nonfinites ();
456
+ bool check_for_nonfinites (std::string location );
419
457
420
458
/* *********************************************************************
421
459
\brief Checks for nans in the specified variable
@@ -480,7 +518,6 @@ class Neutrals {
480
518
\param grid The grid to define the neutrals on
481
519
\param time contains information about the current time
482
520
**/
483
-
484
521
void solver_vertical_rusanov (Grid grid,
485
522
Times time);
486
523
@@ -489,9 +526,29 @@ class Neutrals {
489
526
\param grid The grid to define the neutrals on
490
527
\param time contains information about the current time
491
528
**/
492
-
493
529
bool advect_vertical (Grid grid, Times time);
494
-
530
+
531
+ /* *********************************************************************
532
+ \brief Calculate the neutral friction in one cell using an implicit solver
533
+ \param iLong the longitude index
534
+ \param iLat the lat index
535
+ \param iAlt the altitude index
536
+ \param dt time step
537
+ \param vels updated velocity, which acts as a source term for the implicit solve
538
+ **/
539
+ arma_vec calc_friction_one_cell (int64_t iLong, int64_t iLat, int64_t iAlt,
540
+ precision_t dt, arma_vec &vels);
541
+
542
+ /* *********************************************************************
543
+ \brief Calculate the neutral friction in all cells (calls one_cell above)
544
+ \param dt time step
545
+ **/
546
+ void calc_neutral_friction_implicit (precision_t dt);
547
+
548
+ /* *********************************************************************
549
+ \brief Calculate the neutral friction coefficients for semi-implicit solver
550
+ **/
551
+ void calc_neutral_friction_coefs ();
495
552
};
496
553
497
554
#endif // INCLUDE_NEUTRALS_H_
0 commit comments