Setting up a simulation
Description
This text describes how to set up a basic Aspherix® simulation.
Introduction
Granular simulations typically describe the interaction between one or more particle phases and geometries or walls. In many cases also other species such as liquids, gases or droplets can be involved. The particles considered are in a size range where the hertz or hooke contact law is valid. The interaction between particles as well as particles and walls are resolved and a large variety of physical models can be applied (cohesion, liquid bridges, rolling friction models, heat exchange, etc.). Also external forces such as gravity can play a role. In Aspherix®, input scripts are used to define simulation setups, which use a natural language concept that was introduced for good human readability. In the following section we show how to set up a simple DEM simulation for Aspherix® Solver.
Detailed description
The application case looks as following: a stream of two kinds of spherical particles enters the simulation domain through an insertion face. Gravity acts on the particles, and the particles fall onto a chute, which experiences wear. The discussed simulation can be found here: examples/solver/basic/chute_wear, the name of the input script is chute_wear.asx.
Basic settings
We start with setting the particle shape to sphere. In a next step the dimensions of the simulation domain are set. In x-direction it ranges from -0.5 to 0.1 meters, in-y direction from -0.2 to 0.2 meters and in z-direction from -0.4 to 0.15 meters.
Please note that by default SI units are assumed in Aspherix®, but the units command can be used to change that.
Another basic setting is the neighbor_list command. It has a big impact on the computational costs of the calculation; a typical optimal choice is in the range of the average particle radius or diameter, in this case it is set to 0.002. If not skin size is selected, a skin size value will be selected automatically.
The timestep for the simulation is set to 1e-5 seconds. If you are unsure about the time step width, please use the check_timestep command.
particle_shape sphere
simulation_domain low (-0.5, -0.2, -0.4) high (0.1, 0.2, 0.15)
neighbor_list skin_size 0.002
simulation_timestep 1e-5
Materials and physical models
We define a single material with name m1 with the materials command. Depending on the used contact models, one must define different material properties. In this case these are the Young’s modulus, the Poisson’s ratio, the coefficients of restitution and friction, the density and, as a wear model is applied to the chute, also a wear coefficient.
As contact models we use the normal model hertz and the tangential model history for both particle-particle and particle-wall contacts.
The enable_gravity command is used to switch on gravity, which by default acts with a magnitude of 9.807 in negative z-direction.
materials {m1}
material_properties m1 youngsModulus 5e6 poissonsRatio 0.45 coefficientRestitution 0.3 coefficientFriction 0.5 k_finnie 1 density 2500
particle_contact_model normal hertz tangential history
wall_contact_model normal hertz tangential history
enable_gravity
Meshes
We start with defining a wear mesh module that will be applied to the chute geometry. Then we load two meshes, one for the particles insertion and one that is used as geometry.
Please note that we assume to have a folder called meshes, which is in the same location as the input script and which contains both our meshes.
mesh_module wear id wear_model model finnie
mesh id cad file meshes/simple_chute.stl material m1 mesh_modules {wear_model} solid yes
mesh id inface file meshes/insertion_face.stl solid no is_planar yes
Particles
In the next step, two particle templates are defined and combined into a particle distribution. This distribution is then used in an insertion command of type stream. Please note that an insertion command of this type also requires the previously defined insertion face.
particle_template id smallParticles material m1 radius 1.5e-3
particle_template id smallParticles material m1 radius 2.5e-3
particle_distribution id pdd1 templates {smallParticles, largeParticles} fractions {0.3, 0.7}
insertion mode stream particle_distribution pdd1 target_particle_count 6000 massrate 0.1 insert_every_time 0.01 all_in no velocity constant (0, 0, -1) insertion_face inface
Output intervals
The interval at which all particle data is saved is defined by the write_output_timestep keyword. The interval for the output of the global data (e.g., number of particles, kinetic energy, rolling kinetic energy, …) is set via the write_to_terminal_timestep command.
write_output_timestep 0.002
write_to_terminal_timestep 0.01
Run and output settings
Before adding the output_settings command, we run the simulation for a single time step using a simulate command. With this little trick we make sure that there are already particles in the simulation when the first particle output file is written, which increases the user experience when postprocessing with Paraview.
simulate time 1e-5
output_settings file post_n/sim_*.vtm meshes {cad}
simulate target_time 1
Running the simulation
For launching the simulation, please open a terminal and navigate to the location of the input script, which is called chute_wear.asx.
The simulation can be started on a single core by typing
aspherix -in chute_wear.asx
For running the simulation on multiple cores, a version of MPI must be installed on your machine. On Linux, the following command can be used:
mpirun -np N aspherix -in chute_wear.asx
On Windows, the command looks as following:
mpiexec -np N aspherix.exe -in chute_wear.asx
N is the number of processors.
Postprocessing
If not defined otherwise, the output_settings command writes the particle data to a post folder in the simulation folder. The files contain particle and mesh information and are in vtm file format, which can for example be post-processed with Paraview. Global simulation information is saved in the result_monitor.csv and result_monitor.txt file, furthermore, there are a log file and a file that contains all warnings that occurred during the simulation.
Tutorial cases
The discussed tutorial case is the following:
examples/solver/basic/chute_wear
Questions?
If any questions remain, contact us.