Region Volume Error with Intersecting Regions

Submitted by ethanhn2 on Thu, 01/22/2026 - 19:18

Hello,

I am attempting to simulate the flow of hard spherical pebbles through a large cylindrical geometry. I want to insert pebbles (D = 0.0127 m) at four radial locations (r/R = 0, 0.33, 0.67, 0.92 where R = 0.15 m is the radius of the vessel). To do this, I define four cylindrical regions centered at (x,y) = (0,0) to insert pebbles. For the outer three insertion radii, I define an inner and outer cylinder, then remove the inner cylinder from the outer to create a cylindrical shell about the desired r/R position. This gives a 3D insertion region at constant r/R +- 1 pebble diameter.

When I pass the numerical arguments for the inner cylinder explicitly, it works just as I intend with no error. An example region and insert definition looks like:

# r/R = 0.33
region rR_33_inner cylinder z 0 0 0.0368 0.331 0.38 units box side out # side out gives complement of inner cylindrical region
region rR_33_outer cylinder z 0 0 0.0495+${insert_margin} 0.331 0.38 units box side in
region rR_33 intersect 2 rR_33_inner rR_33_outer # intersection gives cylindrical shell between outer and inner cylinders

fix ins2_33 tracers insert/rate/region seed 11657 distributiontemplate pdd2 nparticles ${N_tracer} particlerate 7500 insert_every 1000 overlapcheck yes all_in no vel constant 0. 0. 0. region rR_33

The insert_margin variable is defined by:

variable insert_margin equal ${pdiam}*${diameter_margin}

Where ${pdiam} is set to 0.0127 m and ${diameter_margin} is set to 1 (+/- 1 diameter about r/R position). However, when I change the inner region definition to be in terms of this variable:

region rR_33_inner cylinder z 0 0 0.0495-${insert_margin} 0.331 0.38 units box side out

LIGGGHTS throws an error. The error printed to the terminal is:

INFO: Resetting random generator for region rR_33
ERROR: Unable to calculate region volume. Possible sources of error:
(a) region volume is too small or out of domain (you may want to increase the 'volume_limit' in the input script)
(b) particles for insertion are too large when using all_in yes
(c) region is 2d, but should be 3d (./src/region.cpp:680)

I am confused because 0.0495-${insert_margin} should evaluate exactly to 0.0368, but it fails whereas 0.0368 explicitly works just fine. My input file is attached. Working with LIGGGHTS-PUBLIC 3.8.0. Any help is appreciated!