You can keep particles and nParticles inside a volume by using a radial field that affects only particles outside the volume you are interested in, and pushes the particles back in. You can also use this procedure to keep particles inside a volume emitter.
You can also use the Volume Trapping attributes to keep objects from exiting volume shape fields. See Volume Trapping.
To keep particles inside the volume
Try a value which is about one-half the magnitude value of your first field, but is negative. For example, if the first field has magnitude of 10 or -10, use a radial field magnitude of -5.
This makes the radial field have the same volume as the original field.
Whenever particles move outside the original field volume, the radial field pushes them back in. You may want to tune the radial field magnitude and/or transform values to get the exact look you want.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License