Skip to content

Equilibrium particle configurations

Oleg Korobkin edited this page Apr 10, 2019 · 10 revisions

Setting up equilibrium particle configurations

This page describes generic setup for preparing close-to-equilibrium particle configurations. The example is written for Sedov test 3D, but it should work just as well in 2D or 1D with small modifications (see below).

There are four steps:

  1. generate initial data lattice - tightly packed HCP, FCC or icosahedral shells in 3D, hexagonal lattice in 2D, or a simple uniformly spaced lattice in 1D;
  2. particle relaxation run;
  3. [optional] modify quantities on the particles -- assign new ones (for example, assign velocity field, reduce pressure, add blast energy etc.);
  4. evolution run.

Steps 1 and 3 are produced with initial data generators, Step 2 - with hydro driver, Step 4 can be either hydro or newtonian. The following example demonstrates how to generate a spherical distribution of particles in 2D or 3D, relax it to quasi-equilibrium state, add blast energy at the origin and evolve (producing Sedov blast wave in a given density profile):

  1. Produce close-packed lattice with a target mass - using initial.par (Note: edit the radius in initial.par for 1D or 2D setups):
  # produces "mesa_initial.h5part":
  ./sedov_3d_generator initial.par # (or use sedov_1d/2d for 1D or 2D resp.)

This lattice does not yet conform to the target density profile. In this example, it is a uniform sphere of smaller radius but the same mass as a target profile, which is then relaxed in Step 2 to the target profile by applying external force and the drag.

  1. Relax particles by evolving in a density-supporting external potential - file relaxation.par:
  # starts from "mesa_initial.h5part" 
  # outputs "mesa_relaxation.h5part"
  ./hydro_3d relaxation.par 
  1. Modify quantities on the particles - file modify_particles.par. This example is for Sedov ID generator, which overwrites pressure, internal energy and blast energy for a given particles configuration:
  # reads the last step in "mesa_relaxation.h5part"
  # modifies it with new quantities
  ./sedov_3d_generator modify_particles.par  

  1. Evolution run - file evolve.par:
  # reads in "mesa_relaxation.h5part" 
  # outputs "mesa_evolution.h5part"
  ./hydro_3d evolve.par 

Once you find the right set of options, you may want to automate this process (using bash or python scripting). If you want to save intermediate relaxation history, copy it to a separate file before proceeding to Step 3: "mesa_relaxation.h5part" -> "mesa_relaxation_saved.h5part", because it will be overwritten in Step 3.