Test+Problem+SPH+Data

=Creating SPH Initial Data= Pages: Workshop, Overview, CADAC, Data Access, Work Area Setup, Path Setup, Utilities, Grid Data, **SPH Data**, Running, Reporting, LOG


 * NOTE:** Consider first if accessing the precomputed initial value data files and reading them with IDL is sufficient for your purposes!

//**THE WEEK OF DECEMBER 3-7 THE SRB SYSTEM (AND HENCE ALSO /gpfs-wan) IS OFF-LINE FOR UPGRADES!**//

Otherwise, SPH initial data (positions and velocities) may be created by running the **g2s.x** utility. Syntax: code g2s.x ICS/1e6.g2s code This example creates an output file **data/1e6.sph**, containing SPH data for about 1e6 particles. Here's the content of the input file: code &g2s infile='cm1000b/d1000-t07000-b0.dat'    ! input file (1000x1000x1000 HD) offset=-0.5                             ! the input file has velocities on left cube faces outfile='data/1e6.sph'                  ! output file (about 1e6 SPH particles) do_exp=t                                ! input file has ln(rho) ppc=0.001                               ! particles per cell (1e9 cells -> 1e6 particles / code The main input parameter is **ppc** = average number of SPH particles per mesh cell, for uniform density. The total number of SPH particles varies slightly, but is of the order of **ppc** times the number of cells in the grid data file.

To change parameters, copy and edit the **data/1e6.g2s** file: code cp ICS/1e6.g2s mydata.g2s $EDITOR mydata.g2s g2s.x mydata.g2s code The SPH data are written in a simple, sequential data file format (see the **write_sph** subroutine in the **io_sph.f90** source code file. To get data in your preferred format, either use this code snippet from the **read_sph** subroutine in your own code, code open(lun,file=file,form='unformatted',status='old')  read(lun) np,wp  read(lun) sx,sy,sz  allocate (x(np),y(np),z(np),vx(np),vy(np),vz(np) read(lun) x read(lun) y  read(lun) z  read(lun) vx  read(lun) vy  read(lun) vz code or else replace the **write_sph** code with your own output routine.

Relaxing the initial positions of the SPH particles
Using a program written by Shu-Ishiro Inutsuka, located in the **Inutsuka** subdirectory of the utilities source code one can iterate the system of SPH-particles closer towards a state where gas pressure gradients are fully consistent with the grid-based forces. More detail later.