How to simulate your own problems

To make “input.udf” for aimed purpose

  • The simplest way is to find a sample “input.udf” close to your aimed problem from “Case Studies”.
  • UDF is a text file. One can browse and edit it using a text editor, while it can be more easily manupulated with GOURMET. See the manuals below for general information on UDF.
  • For KAPSEL, one must first choose the type of problem you want to simulate by selecting “constitutive_eq” from list below in the beginning part of UDF.
    • Navier_Stokes: (sedimentation, diffusion, coagulation)
    • Shear_Navier_Stokes: (dynamics in shear flow, rheology)
    • Shear_Navier_Stokes_Lees_Edwards: (dynamics in shear flow, rheology)
    • Electrolyte: (electrophoresis)
  • The computational cost of each run scales almost lineally with the size of CFD grid (2^NPX x 2^NPY x 2^NPZ) times the total iteration steps (GTS x Num_snap). The largest part of the computational time is used by FFT calculations for solving fluid motion (and also for Poisson Eq. in case of electrolyte).
    • 10^5 iterations of 256^3 system takes roughly a few days on a single core of a moderate Intel CPU.
    • Use of OpenMP much improves the computational performance on multi-core machines. The speed-up depends on the size of CFD grids (larger the size higher the multi-core performance).

To start regular simulations

  • Run KAPSEL as follows.
 > ../kapsel -Iinput.udf -Ooutput.udf -Ddefine.udf -Rrestart.udf
  • -I” option defines the name of UDF file which contains details of simulation (type of simulation, initial conditions, physical and simulation parameters, etc…).
  • -O” option defines the name of UDF file which contains the results (time-dependent positions and velocities of all the particles, etc…) of the simulation.
  • -D” option defines the name of UDF file which contains definitions of KAPSEL data format. This is common for any simulations, but the versions of input.udf and define.udf must be the same.
  • -R” option defines the name of UDF file which contains values of all dynamical variables at the end of the simulation See “Re-start run” below.
  • Field data (fluid velocities, ionic densitied, etc…) is saved in a subdirectory specified in “input.udf” if “output.AVS” = “on”. This requires huge disk space (GB order). No field data is saved if “output.AVS” = “off”.

To continue simulations from the end of previous run

  • One can continue simulations from the end of the previous run by the following procedure.
    • Start GOURMET, and open “restart.udf”
    • Set “resume.Calculation” = “CONTINUE”
    • Increase “output.Num_step”, and save it as “input2.udf”
    • Run KAPSEL as follows.
 > ../kapsel -Iinput2.udf -Ooutput2.udf -Ddefine.udf -Rrestart2.udf