Mixing spheres and multispheres

Submitted by Matteo on Fri, 02/10/2017 - 16:18

Hello,

Can I have an example of a simulation where both spheres and multispheres are used?
In particular I would like to specify more types of spheres (different diameters) and multispheres (different clusters).

I feel a bit lost when I have to specify the material properties of all the types.
Do I have to specify a set of types for spheres starting from 1 and another set of types starting again from 1?

For example
fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 4500 radius 10
fix pts1 all particletemplate/sphere 1 atom_type 2 density constant 4500 radius 10

fix pts1 all particletemplate/multisphere 32452843 atom_type 1 density constant 8540e-3 nspheres 6 ntry 1000000 spheres file data/MultiSphere0 scale 1 type 1
fix pts1 all particletemplate/multisphere 32452843 atom_type 2 density constant 8540e-3 nspheres 6 ntry 1000000 spheres file data/MultiSphere0 scale 1 type 2

How should I specify the material properties like Young's modulus, Poisson ratio etc?
When I used only either spheres or multispheres I specified as many values as atoms types. What should I do when instead I use both spheres and multispheres?

Thanks
Matteo

j-kerbl's picture

j-kerbl | Tue, 02/14/2017 - 17:39

Hi Matteo,

you have to specify types for each of the two in one list, so if you have x (MATERIAL)types spheres and y (MATERIAL)types multispheres you specify
1...x for spheres and
x+1...x+y for multispheres.
However, if you only have one or two materials, but e.g. 6 different particles sizes, you can assign the atom_type multiple times to different templates (spheres and multispheres). Only the type (not atom_type) in particletemplate/multisphere needs to be unique.

Btw: here is a small code snippet to make the integrator selection a bit easier:
group spheres initialize
group multispheres initialize
fix intSphere spheres nve/sphere
fix intMulti multispheres multisphere
fix pts1 multispheres particletemplate/multisphere ...
fix pts2 spheres particletemplate/sphere ...

This adds the spheres and multispheres respectively to the groups spheres and multispheres and processes them with the correct integrator.

Definition for e.g. Youngs modulus works as usual for atom_types, for both spheres and multispheres at the same time.

I hope that clears things up a bit.

Cheers
Josef

Matteo | Fri, 02/17/2017 - 16:33

Dear Josep,

Below you can see the script to test this. Unfortunately it seems to not return errors but I cannot see any sphere when I post process the results. Only multispheres seem to be inserted.
pts1 and pts2 should be multispheres, pt3 spheres

modify_timing on

processors 5 5 1

atom_style granular
atom_modify map array
boundary f f f
newton off

communicate single vel yes

units micro

region reg block -0.0255e6 0.0255e6 -0.0105e6 0.0105e6 -0.001e6 0.0200e6 units box
create_box 3 reg

neighbor 10 bin
neigh_modify delay 0

fix m1 all property/global youngsModulus peratomtype 5.e3 5.e3 5.e3
fix m2 all property/global poissonsRatio peratomtype 0.45 0.45 0.45
fix m3 all property/global coefficientRestitution peratomtypepair 3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
fix m4 all property/global coefficientFriction peratomtypepair 3 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4
fix m5 all property/global coefficientRollingFriction peratomtypepair 3 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15

pair_style gran model hertz tangential history rolling_friction cdt
pair_coeff * *

timestep 0.03

fix gravi all gravity 9.81e-6 vector 0.0 0.0 -1.0 #Impose an acceleration to the particles of a group

fix cv all mesh/surface file meshes/Box.stl type 1 scale 1000
fix rc all mesh/surface file meshes/Recoater.stl type 1 scale 1000
fix bx all mesh/surface file meshes/Building_Piston.stl type 1 scale 1000
fix ax all mesh/surface file meshes/Powder_Piston.stl type 1 scale 1000 #Type 1 specifies the material type
fix inface all mesh/surface file meshes/Inlet.stl type 1 scale 1000
fix wall all wall/gran model hertz tangential history rolling_friction cdt mesh n_meshes 4 meshes cv rc bx ax

fix pts1 all particletemplate/multisphere 32452843 atom_type 1 density constant 8540e-3 nspheres 3 ntry 1000000 spheres file data/MultiSphere0 scale 1 type 1
fix pts2 all particletemplate/multisphere 32452867 atom_type 2 density constant 8540e-3 nspheres 2 ntry 1000000 spheres file data/MultiSphere1 scale 1 type 2
fix pts3 all particletemplate/sphere 32452883 atom_type 3 density constant 4500 radius constant 10

fix pdd1 all particledistribution/discrete 15485867. 3 pts1 0.33 pts2 0.33 pts3 0.33

#region for insertion
group nve_group region reg
region bc block 0.005e3 0.019e3 -0.009e3 0.009e3 -0.0002e3 0.002e3 units box

#particle insertion
fix ins nve_group insert/stream seed 15485863 distributiontemplate pdd1 &
maxattempt 100 mass 0.0001e12 massrate 50e5 overlapcheck yes vel constant 0. 0. -0.05 &
insertion_face inface extrude_length 0.0015e5

fix integr all multisphere

fix ts all check/timestep/gran 10000 0.1 0.1
compute rke all erotate/sphere
thermo_style custom step atoms ke c_rke f_ts[1] f_ts[2] vol #Style and content for printing thermodynamic data to the screen and log file
thermo 100000 #Output info in the log file every n timestep
thermo_modify lost ignore norm no #Set options for how thermodynamic information is computer and printed
compute_modify thermo_temp dynamic yes

run 1
dump dmp all custom 100000 post/dump*.conveyor id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius

dump dmp_geom_ax all mesh/stl 100000 post/dump_geom_ax*.stl ax
dump dmp_geom_bx all mesh/stl 100000 post/dump_geom_bx*.stl bx
dump dmp_geom_rc all mesh/stl 100000 post/dump_geom_rc*.stl rc

run 1000000 upto

Is there anything wrong?
Thanks
Best regards
Matteo

j-kerbl's picture

j-kerbl | Mon, 02/20/2017 - 15:10

Hi Matteo,

since you are using
fix integr all multisphere
the spheres are created but once they enter the domain they aren't moving since they aren't in the integration process.
Use the bit of code I specified the last time:
group spheres initialize
group multispheres initialize
fix intSphere spheres nve/sphere
fix intMulti multispheres multisphere
fix pts1 multispheres particletemplate/multisphere ...
fix pts2 spheres particletemplate/sphere ...

Then you should be able to see the particles in the domain.
Are this huge density differences on purpose?

Cheers,
Josef

Matteo | Mon, 02/20/2017 - 16:37

Hi Josef,

Thanks for your help, now it seems that I can see the spherical particles too!
The density value for the spheres was wrong, thanks!
Regarding the material properties, from your last message I understand that I can define just only 1 material properties if the properties of all the spheres and multispheres are the same and then assign to them the relative atom_type. This would help when I want to define 100 different clusters of multispheres but all with the same material properties.

In the log file I would get the following two warning messages, is there anything I can do to fix it?
WARNING: Changing thermo_temp compute object. This object is deprecated and will be removed in the future. (../compute.cpp:141)
WARNING: Energy calculated for multisphere particles is currently not correct (../fix_multisphere.cpp:1099)

modify_timing on

processors 5 5 1

atom_style granular
atom_modify map array
boundary f f f
newton off

communicate single vel yes

units micro

region reg block -0.0255e6 0.0255e6 -0.0105e6 0.0105e6 -0.001e6 0.0200e6 units box
create_box 3 reg

neighbor 10 bin
neigh_modify delay 0

fix m1 all property/global youngsModulus peratomtype 5.e3 5.e3 5.e3
fix m2 all property/global poissonsRatio peratomtype 0.45 0.45 0.45
fix m3 all property/global coefficientRestitution peratomtypepair 3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
fix m4 all property/global coefficientFriction peratomtypepair 3 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4
fix m5 all property/global coefficientRollingFriction peratomtypepair 3 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15

pair_style gran model hertz tangential history rolling_friction cdt
pair_coeff * *

timestep 0.03

fix gravi all gravity 9.81e-6 vector 0.0 0.0 -1.0

fix cv all mesh/surface file meshes/Box.stl type 1 scale 1000
fix rc all mesh/surface file meshes/Recoater.stl type 1 scale 1000
fix bx all mesh/surface file meshes/Building_Piston.stl type 1 scale 1000
fix ax all mesh/surface file meshes/Powder_Piston.stl type 1 scale 1000
fix inface all mesh/surface file meshes/Inlet.stl type 1 scale 1000
fix wall all wall/gran model hertz tangential history rolling_friction cdt mesh n_meshes 4 meshes cv rc bx ax

group multispheres initialize
group spheres initialize

fix intSpheres spheres nve/sphere
fix intMulti multispheres multisphere

fix pts1 multispheres particletemplate/multisphere 32452843 atom_type 1 density constant 8540e-3 nspheres 3 ntry 1000000 spheres file data/MultiSphere0 scale 1 type 1
fix pts2 multispheres particletemplate/multisphere 32452867 atom_type 2 density constant 8540e-3 nspheres 2 ntry 1000000 spheres file data/MultiSphere1 scale 1 type 2
fix pts3 spheres particletemplate/sphere 32452883 atom_type 3 density constant 8540e-3 radius constant 10

fix pdd1 all particledistribution/discrete 15485867. 3 pts1 0.33 pts2 0.33 pts3 0.33

region bc block 0.005e3 0.019e3 -0.009e3 0.009e3 -0.0002e3 0.002e3 units box

fix ins all insert/stream seed 15485863 distributiontemplate pdd1 &
maxattempt 100 mass 0.0001e12 massrate 50e5 overlapcheck yes vel constant 0. 0. -0.05 &
insertion_face inface extrude_length 0.0015e5

fix ts all check/timestep/gran 10000 0.1 0.1
compute rke all erotate/sphere
thermo_style custom step atoms ke c_rke f_ts[1] f_ts[2] vol
thermo 100000
thermo_modify lost ignore norm no
compute_modify thermo_temp dynamic yes

run 1
dump dmp all custom 100000 post/dump*.conveyor id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius

dump dmp_geom_ax all mesh/stl 100000 post/dump_geom_ax*.stl ax
dump dmp_geom_bx all mesh/stl 100000 post/dump_geom_bx*.stl bx
dump dmp_geom_rc all mesh/stl 100000 post/dump_geom_rc*.stl rc

run 1000000 upto

Thanks
Matteo

j-kerbl's picture

j-kerbl | Wed, 02/22/2017 - 12:38

Hi Matteo,

yes, you can use the same atom_type for all templates, as long as it is the same material.

No, the warnings are there to raise awareness to the user, that some output might not be compatible with the settings in the simulation.

Cheers and happy simulations,
Josef