Aether  0.0
Ionosphere-Thermosphere model
ions.h
1 // Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
2 // Full license can be found in License.md
3 
4 #ifndef INCLUDE_IONS_H_
5 #define INCLUDE_IONS_H_
6 
7 #include <string>
8 #include <vector>
9 
10 class Ions {
11 
12  public:
13 
14  // This struct contains all of the information needed for a single
15  // species of ion. We will then have a vector of these species.
16 
17  struct species_chars {
18  std::string cName;
19  precision_t mass;
20  int charge;
21 
22  int DoAdvect;
23 
24  std::vector<precision_t> nu_ion_neutral_coef;
25  std::vector<bool> nu_is_resonant;
26  std::vector<precision_t> nu_ion_ion;
27  std::vector<precision_t> nu_ion_electron;
28 
29  std::vector<precision_t> nu_in_res_temp_min;
30  std::vector<precision_t> nu_in_res_coef1;
31  std::vector<precision_t> nu_in_res_coef2;
32  std::vector<precision_t> nu_in_res_tn_frac;
33  std::vector<precision_t> nu_in_res_ti_frac;
34 
35  std::vector<arma_cube> nu_ion_neutral_vcgc;
36 
37  // Sources and Losses:
38 
39  arma_cube density_scgc;
40  std::vector<arma_cube> par_velocity_vcgc;
41  std::vector<arma_cube> perp_velocity_vcgc;
42 
43  arma_cube temperature_scgc;
44 
45  // Sources and Losses:
46 
47  arma_cube ionization_scgc;
48 
49  arma_cube sources_scgc;
50  arma_cube losses_scgc;
51  };
52 
53  // bulk quantities (states):
54  arma_cube density_scgc;
55  std::vector<arma_cube> velocity_vcgc;
56  arma_cube ion_temperature_scgc;
57  arma_cube electron_temperature_scgc;
58 
59  // This is the vector that will contain all of the different species:
60  std::vector<species_chars> species;
61 
62  // Electrodynamics:
63  arma_cube potential_scgc;
64  std::vector<arma_cube> efield_vcgc;
65  std::vector<arma_cube> exb_vcgc;
66  arma_mat eflux;
67  arma_mat avee;
68 
69  // ------------------------------
70  // Functions:
71 
72  Ions(Grid grid, Inputs input, Report report);
73  species_chars create_species(Grid grid);
74  int read_planet_file(Inputs input, Report report);
75  void fill_electrons(Report &report);
76  int get_species_id(std::string name, Report &report);
77  void calc_efield(Grid grid, Report &report);
78  void calc_exb_drift(Grid grid, Report &report);
79  void calc_ion_drift(Neutrals neutrals,
80  Grid grid,
81  precision_t dt,
82  Report &report);
83  void calc_ion_neutral_coll_freq(Neutrals neutrals, Report &report);
84  std::vector<arma_cube> calc_ion_electron_pressure_gradient(int64_t iIon,
85  Grid grid,
86  Report &report);
87  void calc_ion_temperature(Neutrals neutrals, Grid grid, Report &report);
88 };
89 #endif // INCLUDE_IONS_H_
Ions::species_chars
Definition: ions.h:17
Inputs
Definition: inputs.h:10
Report
Definition: report.h:28
Ions
Definition: ions.h:10
Grid
Definition: arm_vars.h:11
Neutrals
Definition: neutrals.h:26