-
Notifications
You must be signed in to change notification settings - Fork 1
pabolmasov/HACol
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
INSTALLATION AND RUNNING To run the code, make sure you have python3 (checked for python3.6 and 3.7), MPI, MPI4py, numpy, scipy, and preferrably ipython and HDF5 support. The configuration file is globals.conf. Probably, you would not need to change anything in the code, only in the configuration. globals.conf contains different configurations of the code, differing in physical and numerical parameters. The main working file is tire_MPI.py, and the main routine in it is alltire(). Tune all the global parameters in globals.conf and then run the code from the command line with > mpirun -np <N> python tire_MPI.py <CONF>, where <N> stands for the number of processers in use (it should coincide with the value of parallelfactor in globals.conf), and <CONF> is the configuration set up name (in square brackets in globals.conf). If the configuration file is omitted, all the parameters are set to the default values from globals.conf. If everything is fine, you will get a lot of output to your stdout, nothing to stderr, and the "out/" directory (or the output directory set by "outdir" in the "globals" configuration file) should immediately (unless you turned the graphical output off by setting ifplot = False in globals.py) start filling with files like vtie..png and tireout..dat containing the snapshots of your simulation. Also, current total flux (namely, luminosity in L_Edd/4\pi units) will be written to "flux.dat". Total mass, momentum, and energy will be outputted to "totals.dat" in the same directory. The main output is either tireout.hdf5 (if "ifhdf" flag is True in globals.conf) or, alternatively, a series of ..dat files with snapshots. Make sure that different simulations write to different directories. For this, set different "outdir" names for different configurations. Then, several simulations may be run simultaneously. To run the code without ipython, you need to be sure that all the necessary libraries like scipy are installed. If you are running the code on a machine that does not support matplotlib, make sure that graphic output is off (ifplot=False in globals.py). NUMERICAL ALGORITHMS The code solves the system of conservation equations for mass, momentum, and energy, taking into account a number of physical effects: radiation losses, photon diffusion, mass loss when the force-free condition is violated. Solution is obtained using HLLE or HLLC Riemann solver. Riemann solvers are defined in solvers.py, and the signal velocities computed by sigvel.py. An elaborate description of the physics and numerical techniques is given in our paper https://ui.adsabs.harvard.edu/abs/2023MNRAS.tmp.1899A/abstract ADDITIONAL PHYSICS TBD OUTPUTS So far, if "ifhdf" flag is False in globals.py, it produces multiple structure snapshots "tireout*.dat" containing density, velocity, energy density etc. as functions of length along the field line. All this information is written to a single HDF file "tireout.hdf5" if the flag is True. In this case, ASCII outputs are also made, but "ascalias" times less often (this parameter is set to 10 by default). Also, total luminosity is always written to "flux.dat" as a function of time. Geometry (including radius, polar angle, and the geometrical cross-section of the flow) is written to a special file "geo.dat" in the output directory. In the HDF5 file, individual snapshots are stored as individual datasets "entry000000", "entry000001" etc. All the globals are written to a special dataset "globals", and the contents of "geo.dat" is also saved as a "geometry" dataset in "tireout.hdf5", making the file self-consistent. HDF5 outputs with the same set of globals and the same geometry may be combined using "liststitch" routine defined in hdfoutput.py. File postpro.py provides a number of routines useful for analysis and visualization of the simulation results. RESTART Currently, there is a support for restart with identical or different spatial resolution. If the size of the radial mesh (number of points) is identical, no interpolation is used. If the number of points is different, all the quantities will be remapped. If the outer radius of the simulation is larger than the outer radius of the restart file, the code will report an error. Writing to and reading from an HDF5 file is possible, if the global variable locking flag is set to negative. In bash, it is enough to set: export HDF5_USE_FILE_LOCKING=FALSE POSSIBLE PROBLEMS The code is designed in a way to make the results accessable as soon as possible. All the ASCII files and all the HDF5 entries are flushed as soon as the snapshot is written. You do not need to wait until the simulation ends to read and reduce the output entries (though there could be issues with simultaneous access). If you need to kill the code during the simulation, all the results would be saved. There may be problems with reading the HDF5 simultaneously with writing to it. One possible solution is setting HDF5_USE_FILE_LOCKING=FALSE before running the code.
About
HACol = Hydrodynamics of Accretion Column (one-dimensional magnetospheric flow)
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published