A new version of BAGS is under development. I've found the simple methods I used here are inadequate for high speed pneumatic guns and also inadequate in many other ways. For example, the valve flow equation I used is fairly inaccurate and better models are available. I am developing BAGS 2.0 in my spare time. BAGS 2.0 will be a 1D Lagrangian simulation much like what is described in this introductory CFD book. Also, I developed better non-dimensional models later.
What is written below is out of date and will eventually (pending free time) be replaced with newer writing.
BAGS is a simulation of a pneumatic gun that I've written in Python (You will need the Python software to run it). At the moment its methods are rudimentary and my programming skills are lacking, but the simulation is very reasonable for what I intend to use it for.
While I realize a program called GGDT also simulates air guns with better accuracy, I will not use GGDT for more than checking results. GGDT lacks the optimization functions I wrote BAGS for. More importantly, I want to learn how to write a simulation and understand how pneumatic guns work in more detail.
Download the latest version of BAGS (1.0.1b)
BAGS requires gas.txt, available here
Note: The name BAGS stands for "btrettel's air gun simulation", but the simulation can easily be adapted for other gases given they can be modeled as ideal gases.
After taking a formal fluid mechanics class I realized a number of things in BAGS are incorrect, though their accuracy is probably okay for most pneumatic guns. Regardless, I intend to correct these errors in the next version of BAGS. Expect an explanation of the associated derivations and setups when the next version is released too.
BAGS is reasonably accurate. Compared against other models it agrees closer to GGDT than CALM does because BAGS takes several things into account that CALM does not. Generally BAGS agrees with GGDT within 5% for subsonic projectiles and equivalent inputs.
At the moment BAGS is on the back burner while I learn more. I intended to slowly improve BAGS as I learned things, but I realized that there likely would be many changes that would reverse something I had done earlier. Waiting until I know a great deal more is simply a more economical use of my time.
There was a big list of things I planned to do here, but I've removed it as many items were tentative at best. The next version of BAGS will be 2.0. The biggest changes will be (1) the new GUI, (2) the CFD simulation, (3) the ability to model many guns (pneumatics, spring, combustion/hybrid, and several varieties of light gas guns at the very least) and many different valve types of pneumatic (everything GGDT has, potentially a custom option, and doing a more advanced job), (4) the exterior ballistics simulation, and (5) a large variety of optimization routines.
The GUI will include many options and possible plots (including interesting space-time plots from the CFD simulation). BAGS also will retain the ability to be run in a limited output form from the command line. A simulation much like the current one that will be far faster than the CFD simulation will still be part of 2.0 as an option. Similarly, the exterior ballistics simulation will have a fast simple version and a slower more advanced version. I intend for 2.0 to still use calorically perfect gas assumptions like the current version.
Some other ideas I intend to add to 2.0 include recoil calculation and calculation of transient stresses in the gun (in the barrel and piston primarily). These two should provide the beginnings of an answer to the question "Will my gun survive a shot at X pressure?"
Do not expect BAGS 2.0 before 2010. I am very interested in this project as it will unify much of my engineering knowledge and force me to review what I already have been taught and learn new things in the process.
There are no comments yet.
©2007 - 2010 Ben Trettel
Last modified on 2011-05-23 20:54:33.