Skip to content

Commit 9037f7e

Browse files
authored
Merge branch 'develop' into ortho_dipole
2 parents f43ddd6 + 63dafb4 commit 9037f7e

15 files changed

+902
-65
lines changed

include/chemistry.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ class Chemistry {
104104
int read_chemistry_file(Neutrals neutrals,
105105
Ions ions);
106106

107-
reaction_type interpret_reaction_line(Neutrals neutrals,
108-
Ions ions,
109-
std::vector<std::string> line,
110-
json headers);
111-
112-
void find_species_id(std::string name,
113-
Neutrals neutrals,
114-
Ions ions,
107+
reaction_type interpret_reaction_line(const Neutrals &neutrals,
108+
const Ions &ions,
109+
const std::vector<std::string> &line,
110+
const json &headers);
111+
112+
void find_species_id(const std::string &name,
113+
const Neutrals &neutrals,
114+
const Ions &ions,
115115
int &id_,
116116
bool &IsNeutral);
117117

include/inputs.h

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,50 @@ class Inputs {
436436
bool get_O_cooling();
437437

438438
/**********************************************************************
439-
\brief returns settings["
439+
\brief returns settings["Sources"]["Ions"]["IncludePhotoElectronHeating"]
440+
\param none
441+
**/
442+
bool get_do_photoelectron_heating();
443+
444+
/**********************************************************************
445+
\brief returns settings["Sources"]["Ions"]["IncludeIonizationHeating"]
446+
\param none
447+
**/
448+
bool get_do_ionization_heating();
449+
450+
/**********************************************************************
451+
\brief returns settings["Sources"]["Ions"]["IncludeElectronIonCollisionalHeating"]
452+
\param none
453+
**/
454+
bool get_do_electron_ion_collisional_heating();
455+
456+
/**********************************************************************
457+
\brief returns settings["Sources"]["Ions"]["IncludeElectronNeutralElasticCollisionalHeating"]
458+
\param none
459+
**/
460+
bool get_do_electron_neutral_elastic_collisional_heating();
461+
462+
/**********************************************************************
463+
\brief returns settings["Sources"]["Ions"]["IncludeElectronNeutralInelasticCollisionalHeating"]
464+
\param none
465+
**/
466+
bool get_do_electron_neutral_inelastic_collisional_heating();
467+
468+
469+
/**********************************************************************
470+
\brief returns settings["Sources"]["Ions"]["IncludeThermoelectricHeating"]
471+
\param none
472+
**/
473+
bool get_do_thermoelectric_heating();
474+
475+
/**********************************************************************
476+
\brief returns settings["
477+
\param
478+
**/
479+
bool get_use_centripetal();
480+
481+
/**********************************************************************
482+
\brief returns settings["
440483
\param
441484
**/
442485
bool get_use_coriolis();

include/ions.h

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Ions {
172172
/// Specific heat (constant volume):
173173
arma_cube Cv_scgc;
174174

175-
/// Head Conduction (bulk):
175+
/// Heat Conduction (bulk):
176176
arma_cube lambda;
177177

178178
// Electrodynamics:
@@ -304,7 +304,7 @@ class Ions {
304304
\brief Get the ID of the ion species with the given name
305305
\param name a string that describes the species
306306
**/
307-
int get_species_id(std::string name);
307+
int get_species_id(const std::string &name)const;
308308

309309
/**********************************************************************
310310
\brief Calculates the electric field
@@ -348,8 +348,75 @@ class Ions {
348348
\brief Calculates the electron temperature on the given grid
349349
\param neutrals these are needed for the collision terms
350350
\param grid this is the grid to solve the equation on
351+
\param time the time class to know dt
351352
**/
352-
void calc_electron_temperature(Neutrals neutrals, Grid grid);
353+
void calc_electron_temperature(Neutrals neutrals, Grid grid, Times time);
354+
355+
/**********************************************************************
356+
/// @brief Calculate epsilon
357+
/// @details intermediate variable used in photoelectron & ionization heating
358+
/// From (Smithro & Solomon, 2008).
359+
/// @param neutrals
360+
/// @return epsilon
361+
**/
362+
arma_cube calc_epsilon(Neutrals &neutrals);
363+
364+
/**********************************************************************
365+
\brief Calculates photoelectron heating
366+
\details Based on (Swartz & Nisbet, 1972) & (Smithro & Solomon, 2008)
367+
Uses equations 9-12 from (Zhu & Ridley, 2016)
368+
https://doi.org/10.1016/j.jastp.2016.01.005
369+
\param epsilon
370+
\return Qphe
371+
**/
372+
arma_cube calc_photoelectron_heating(arma_cube epsilon);
373+
374+
/**********************************************************************
375+
\brief Calculates auroral heating
376+
\details NOTE: in GITM this is solved separately for ion precipitation & auroral
377+
ionization. In Aether these are both in ions.species[iIon].ionization_scgc...
378+
\param epsilon
379+
\return Qaurora
380+
**/
381+
arma_cube calc_ionization_heating(arma_cube epsilon);
382+
383+
/**********************************************************************
384+
\brief Calculates electron-ion (elastic) collisional heating
385+
\details From Schunk and Nagy 2009, and Bei-Chen Zhang and Y. Kamide 2003
386+
- This differs slightly from the GITM implementation, which assumes several ion species are present.
387+
Instead, here we use each ion species for the sum.
388+
- electon-ion collision frequency (from Schunk and Nagy 2009) = 5.45E-5
389+
- This is capable of handling BOTH the bulk & individual ion temperatures
390+
\return vector<Qeicp, Qeicm, Qeic_v>
391+
**/
392+
std::vector<arma_cube> calc_electron_ion_collisions();
393+
394+
/**********************************************************************
395+
\brief Calculates electron-neutral elastic collisional heating
396+
\details From Schunk and Nagy 2009
397+
\param neutrals
398+
\return vector<Qencp, Qencm, Qenc_v>
399+
**/
400+
std::vector<arma_cube> calc_electron_neutral_elastic_collisions(Neutrals &neutrals);
401+
402+
/**********************************************************************
403+
\brief Calculates the electron-neutral inelastic collisional heating
404+
\details From Schunk and Nagy 2009 pages 277, 282.
405+
This includes N2, O2 rotation, fine structure, O(1D) exitation & vibration, N2 vibration.
406+
See equation 15 from (Zhu, Ridley, Deng, 2016) https://doi.org/10.1016/j.jastp.2016.01.005
407+
\param neutrals
408+
\return vector<Qencp, Qencm, Qenc_v>
409+
**/
410+
std::vector<arma_cube> calc_electron_neutral_inelastic_collisions(Neutrals &neutrals);
411+
412+
/**********************************************************************
413+
\brief Calculate the thermoelectric current (same at all altitudes)
414+
\details Use eq. 6 of https://doi.org/10.1016/j.jastp.2016.01.005
415+
- Since we do not know e- parallel velocity, the dipole needs to do it this way too.
416+
\param grid
417+
\return arma_mat JParaAlt
418+
**/
419+
arma_mat calc_thermoelectric_current(Grid &grid);
353420

354421
/**********************************************************************
355422
\brief Check all of the variables for nonfinites, such as nans

include/neutrals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ class Neutrals {
453453
\brief Get the species ID number (int) given the species name (string)
454454
\param name string holding the species name (e.g., "O+")
455455
**/
456-
int get_species_id(std::string name);
456+
int get_species_id(const std::string &name) const;
457457

458458
/*****************************************************************************
459459
\brief Checks for nans and +/- infinities in density, temp, and velocity

include/solvers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ arma_vec solver_conduction(
4040
arma_vec dx,
4141
precision_t dt,
4242
int64_t nGCs,
43-
bool return_diff);
43+
bool return_diff = false,
44+
arma_vec source2 = arma_vec());
4445

4546
arma_cube solver_chemistry(arma_cube density,
4647
arma_cube source,

share/run/UA/inputs/defaults.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,21 @@
9898
"nMembers" : 1},
9999

100100
"Sources" : {
101-
"Grid" : {
102-
"Coriolis" : true,
103-
"Cent_acc": true },
104-
"Neutrals" : {
105-
"NO_cool" : false,
106-
"O_cool": false }
107-
},
101+
102+
"Grid" : {
103+
"Coriolis" : true,
104+
"Cent_acc": true },
105+
106+
"Neutrals" : {
107+
"NO_cool" : false,
108+
"O_cool": false },
109+
110+
"Ions" : {
111+
"IncludePhotoElectronHeating": true,
112+
"IncludeIonizationHeating": true,
113+
"IncludeElectronIonCollisionalHeating":true,
114+
"IncludeElectronNeutralElasticCollisionalHeating":true,
115+
"IncludeElectronNeutralInelasticCollisionalHeating":true}},
108116

109117
"Seed" : 0,
110118

src/advance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ bool advance(Planets &planet,
201201
}
202202

203203
ions.calc_ion_temperature(neutrals, gGrid, time);
204-
ions.calc_electron_temperature(neutrals, gGrid);
204+
// ions.calc_electron_temperature(neutrals, gGrid, time);
205205
//ionsMag.calc_ion_temperature(neutralsMag, mGrid, time);
206-
//ionsMag.calc_electron_temperature(neutralsMag, mGrid);
206+
ionsMag.calc_electron_temperature(neutralsMag, mGrid, time);
207207

208208
if (didWork & input.get_check_for_nans())
209209
didWork = neutrals.check_for_nonfinites("After Vertical Advection");

0 commit comments

Comments
 (0)