VERB_code_2.3
|
The document Algorithms.pdf may be useful for understanding the structure of the code. AllFunctions.pdf and Description.pdf may also be helpful for understanding the code better.
This document was generated by the Doxygen system. It has a description of the API, and used my main program's code, which runs the main() function. If you want to understand how the VERB code works, please, read the overview and after read the code and comments themselves.
The VERB code was developed by the Radiation Belt Modeling Group, a research group under the Earth, Planetary, and Space Sciences department at UCLA. Their website can be found here: http://rbm.epss.ucla.edu
The head researchers of this project are Yuri Shprits, Adam Kellerman, Alexander Drozdov, Ksenia Orlova, and Tatiana Podladchikova. The code and documentation have been updated by this team as well as other researchers, last updated in 2015.
See Main.cpp documentation for general algorithm explanation.
The code is designed to solve the Fokker-Planck diffusion equation:
\[ \frac{\partial f}{\partial t} = \frac{1}{p^2} \frac{\partial}{\partial p} p^2 D_{pp} \frac{\partial f}{\partial p}\Big|_{\textrm{const }\alpha, L} + \frac{1}{\cos(\alpha) \sin(\alpha) T(\alpha)} \frac{\partial}{\partial \alpha} \cos(\alpha) \sin(\alpha) T(\alpha) D_{\alpha \alpha} \frac{\partial f}{\partial \alpha}\Big|_{\textrm{const } p, L} + L^2 \frac{\partial}{\partial L} \frac{1}{L^2} D_{LL} \frac{\partial f}{\partial L}\Big|_{\textrm{const } J_1, J_2} + Q - S \]
This equation describes the evolution of phase space density (PSD) in time and phase space. It has three diffusion terms: Radial, Energy, and Pitch-angle. Radial diffusion needs a different grid than the two other (local, Energy, and Pitch-angle) diffusions. Q - local sources. S - local losses. In the code we split the equation into three parts and solve them one after another with interpolation between radial and local grids:
We have two grids in the code and phase space density arrays on each of them. PSD values and grids are stored in the class PSD. The structure of the classes is following:
PSD as general class, contains methods to compute diffusion. It keeps PSD values in the parent class Matrix3D. Grid has 3-dimensions, so it has 3 GridElements, and one additional element epc which is just useful for the output. Each GridElements is a 3D-Array of values of coordinates. We have to do it this way, because grids are irregular. BoundaryCondition class is used for the boundary conditions for diffusion calculation.
PSD needs diffusion coefficients, grid, and boundary conditions as an input parameter for diffusion functions PSD::Diffusion_L(), PSD::Diffusion_pc(), PSD::Diffusion_alpha(), PSD::Diffusion_pc_alpha(). Diffusion coefficients for each diffusion are stored inside DiffusionCoefficientsGroup class. The class structure:
DiffusionCoefficients, produced by each wave type, are grouped by directions in the DiffusionCoefficientsGroup class. That class can turn the waves on and off and scale their effect, and store the summation as Daa or Dpp.
Initial conditions defined by PSD::Create_Initial_PSD.
The code has empty constructor and functions, like AllocateMemory()
and Initialize()
which define an object. We also have a constructor, which call these functions during execution, just for shortening of the code. And it is like that for almost every class.