Dear users and developers,
I am simulating a simple container with an inlet and outlet (both have much smaller diameters than container diameter). I insert
particles at the upper side (in the inlet) and they fall under gravity through the container and out to the outlet.
The system boundaries are fixed and particle tracking is set to "lost" so to save computational cost (I am not interested in particles exiting the outlet, only while they are inside is what matters).
When I try to calculate the residence time distribution with the combination of tracer and compute nparticles commands, I suspect the compute "erases" particles whenever they go out from the simulation box ("lost"). I would assume it would be much more beneficial to have the compute remember particles that were once in the outlet region, or maybe passed through some surface, so to properly count all particles including these that exit the simulation box.
Is there a simple way to account for particles that go outside the simulation box after they have left the region where counting is performed ?
Thank you,
David
richti83 | Thu, 02/05/2015 - 09:02
fix massflow mesh
yes there is such a function, see manual doc/fix_massflow_mesh.html
make a mesh at your outlet, but not include it in fix .. wall/gran to keep in invisible for the particles
fix mass all massflow/mesh mesh outface count once vec_side 0. 0. -1.
variable time equal step*dt
variable Nparticle equal f_mass[2] # the second vector component indicates the particle count
fix outfile all print 100 "$t,${Nparticle}" file massflow.csv screen no title "Time,Nparticle"
Best !
Christian.
davidf | Sun, 02/08/2015 - 08:45
Re:
Thank you for the prompt response, Christian !
Your suggestion is almost what I was looking for. As far as I can tell massflow/mesh does not allow to count particles previously marked by "atom/tracer" and separately count the unmarked ones.
I need to count the marked particles out of the total particles crossing a mesh, so to generate the residence time distribution.
Do you see any way to get around this ?
Thanks again
David
ckloss | Mon, 02/09/2015 - 13:48
Hi,
Hi,
>> I suspect the compute "erases" particles whenever they go out from the simulation box ("lost")
No, particles are tagged upon insertion and untagged/counted when they are in the compute region
>>I would assume it would be much more beneficial to have the compute remember particles that were once in the outlet region,
>>or maybe passed through some surface, so to properly count all particles including these that exit the simulation box.
That's waht it does - please see the documentation for details!
Best wishes
Christoph
davidf | Wed, 02/11/2015 - 21:10
Re:
Christoph, thanks for your response !
I have gone through the doc pages several times, and actually tested the attached input script, but no marked particles are being counted.
The total number of particles is non-zero, but the marked particles always is zero - for a reason I do not grasp.
Here is the input script I use, together with the relevant part of residence time calculation with fix atom/tracer/region and compute nparticles/tracer/region commands.
----------------------------------------------------
# Preliminaries
units si
atom_style sphere
atom_modify map array
boundary f f f
newton off
communicate single vel yes
# Declare domain
region domain block -0.05 0.9 -0.72 0.2 0.45 1.3 units box
create_box 2 domain
# Define the physics
pair_style gran/hertz/history cohesion sjkr rolling_friction cdt
pair_coeff * *
# Neighbor listing
neighbor 0.003 bin
neigh_modify every 1 check no #delay 0
# Setup
#Material properties and interactions
fix m1 all property/global youngsModulus peratomtype 2.5e7 2.5e7
fix m2 all property/global poissonsRatio peratomtype 0.25 0.25
fix m3 all property/global coefficientRestitution peratomtypepair 2 0.5 0.5 0.5 0.5
fix m4 all property/global coefficientFriction peratomtypepair 2 0.5 0.5 0.5 0.5
fix m5 all property/global cohesionEnergyDensity peratomtypepair 2 465000.0 15000.0 15000.0 15000.0
fix m6 all property/global coefficientRollingFriction peratomtypepair 2 0.001 0.001 0.001 0.001
# Particle insertion
fix pts all particletemplate/sphere 1 atom_type 1 density constant 2400 &
radius gaussian number 0.003 0.0002
fix pdd all particledistribution/discrete 120345 1 pts 1.0
region factory cylinder z 0.34 -0.34 0.025 1.0 1.05 units box
fix ins all insert/rate/region seed 120382 distributiontemplate pdd verbose no &
nparticles INF massrate 0.045 insert_every 100 &
overlapcheck yes vel constant 0 0 -4.0 region factory ntry_mc 1005
# Import mesh from cad
fix cad1 all mesh/surface file cyclone2_ascii_fine.stl type 2 scale 0.001 move 0 0.5 0 rotate axis 1 0 0 &
angle 90.0 curvature 0.5e-5
# Use the imported mesh as granular wall
fix geometry all wall/gran/hertz/history mesh n_meshes 1 meshes cad1 cohesion sjkr
# Create stopper for funnel
fix stopper all wall/gran/hertz/history primitive type 2 ycylinder 0.005 0.5 0.34 cohesion sjkr
# Detailed settings
fix integrate all nve/sphere
timestep 0.00005
# residence time distribution
region rtdinlet block 0.0 0.8 -0.7 0.0 0.8 1.05 units box
fix rt all property/atom/tracer region_mark rtdinlet mark_step 1000 marker_style dirac check_mark_every 1000
region rtdoutlet block 0.25 0.45 -0.45 -0.25 0.4 0.49 units box
compute nparticles all nparticles/tracer/region region_count rtdoutlet tracer rt
variable tot equal c_nparticles[1]
variable marked equal c_nparticles[2]
variable totmass equal c_nparticles[3]
variable markedmass equal c_nparticles[4]
fix extra1 all print 1000 "number total = ${tot}" file total-rtd.out
fix extra2 all print 1000 "number marked = ${marked}" file marked-rtd.out
fix extra3 all print 1000 "mass total = ${totmass}" file totmass-rtd.out
fix extra4 all print 1000 "mass marked = ${markedmass}" file mass-marked-rtd.out
#Thermodynamic output settings
thermo_style custom step atoms
thermo 1000
thermo_modify lost ignore norm no
# Check timestep
fix timecheck all check/timestep/gran 1 0.01 0.01
run 1
unfix timecheck
# Dump output
dump dmp all custom 10000 post/dump*.binflow id type type x y z ix iy iz vx vy vz fx fy fz &
omegax omegay omegaz radius
dump dumpstl all stl 10000 dump*.stl
### Execution and further settings
run 72000000 upto
-----------------------------------------------------------------------------
Can you point me to any flaws in the script I might be missing ?
Thank you so much,
David
j-kerbl | Thu, 02/26/2015 - 13:38
Hi David,
Hi David,
I recently did something similar and I have some hints for you.
If you want to continously mark particles you could either use the style heaviside or use a insert/stream with fix atom/tracer/stream.
The compute nparticles automatically resets the markers when it counts them. If you want the particles to stay marked you have to use the reset_marker off option.
You have to be careful with your prints, 1000 timesteps might be too high. You might want to try a lower value as e.g. 100.
Make a graph of the output files, if reset_marker is activated, there are often lonely "1" entries that can be easily overseen.
I hope that helps!
Cheers
Josef