- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
Boundary, Initial conditions
GEMINI requires both initial and boundary conditions to run properly.
Specifically the user must provide a complete initial ionospheric state for all ionospheric species:
- density
- drift
- temperature
and boundary conditions for the electric potential:
- 2D: top, bottom, and side potentials
- 3D: topside current density and side wave potentials
Fluid state variables are given free-flow boundary conditions at the edges of the simulation grid.
The io module contains code dealing with input of initial state from file.
The potential_comm and potentialBCs_mumps modules contain code dealing with boundary condition input.
There are presently two ways in which the boundary and initial conditions can be set for GEMINI:
- subroutine-based input
- file-based input
NOTE: future releases will likely completely remove the option for subroutine-based initial and boundary conditions.
There are two subroutines that can be modified by the user to provide boundary conditions to the code; these are described below. Note that, if any of these are changed, the code needs to be recompiled.
./ionization/boundary_conditions/precipBCs_mod.f90 - the function precipBCs' specifies the pattern of electron precipitation, including characteristic energy and total energy flux, over top of grid.  If the user does not specify an input file for precipitation boundary conditions in config.ini`, then this subroutine will be called to set the boundary.
./numerical/potential/boundary_conditions/potentialBCs_mumps.f90 - boundary conditions for the electric potential or field-aligned current.  The type of input that is being used is specified by the flags in the config.ini file for the simulation.  This subroutine will only be called if the user has not specified an input file containing boundary conditions.
By default these subroutines will be used for boundary conditions if file input is not specified in the config.ini input file. The base GEMINI sets these to be zero potential (or current) and some negligible amount of precipitation. Note that if you write over these subroutines then the code will use whatever you have put into them if file input is not specified. This can lead to unintended behavior if ones modifies these and then forgets since the code will continue to use the modifications instead of some baseline. Because of this issue, and the fact that GEMINI must be rebuilt every time these subroutines are changed, this method of boudnary condition input is going to be removed.
An alternative is to use the file input option, which needs to be set up using MATLAB (or other) scripts.  To enable this type of input, the appropriate flags (flagprecfileinput and flagE0fileinput) need to be set in the input config.ini file (see Section entitled "Input file format" above).  All examples included in initialize/ in both the GEMINI and GEMINI-scripts repositories use this method for setting boundary conditions.  Note that the user can specify the boundary condition on a different grid from what the simulation is to be run with; in this case GEMINI will just interpolate the given boundary data onto the current simulation grid.
GEMINI needs for each species that it simulates over the entire grid for which the simulation is being run as input:
- density
- drift
- temperature
Generally one will use the results of another GEMINI simulation that has been initialized in an arbitrary way, run for a full day to a proper ionospheric equilibrium as this input.
Any equilibrium simulation run this way must use full output (flagoutput=1 in the config.ini).
A useful approach for these equilibrium runs is to use a coarser grid so that the simulation completes quickly and then interpolate the results up to fine grid resolution.
An example of an equilibrium setup is given in
initialize/2Dtest_eq.
Note that this basically makes up an initial conditions using eqICs.m and runs until initial transients have settled.
An example of a script that interpolates the output of an equilibrium run to a finer grid is included with
initialize/test2d.