How BAGS works

Long explanation of the simulation

I wrote a rough PDF on how BAGS 0.9 works. Sorry for making a PDF, but I don't have time to convert my word processor document to a webpage at the moment. Note that this explains BAGS 0.9 and not the newer SI version.

Short explanation of the simulation

The simulation essentially is a loop that starts with the projectile in its initial position and ends when the projectile leaves the barrel. The loop approximates the solutions to some ordinary differential equations. Right now I'm using the first order Euler method with a very small step size for simplicity.

The loop goes like this:

  1. Figure out the volumetric flow rate at STP.
  2. Convert that to a mass flow rate.
  3. Find the new barrel temperature.
  4. Add new mass to the barrel and subtract mass from air chamber (unless barrel pressure is higher, and in that case it reverses--this doesn't happen often but it does happen in some cases).
  5. Recalculate the pressures in the barrel and air chamber.
  6. Move the projectile.
  7. Calculate the work done (for #3 in the next iteration).
  8. Repeat.

At the moment I use an equation for flow through a control valve. The one I'm using is described on this page. I know nothing about what assumptions this equation makes. I suspect my use of a simplified equation like this makes my model inaccurate at high pressures and high velocities. This equation will suffice until I read more about compressible flow.

Most of the remainder of the math uses Newtonian mechanics, the ideal gas law, and the Reynolds Transport Theorem neglecting effects of the gas' kinetic energy.

Comments

There are no comments yet.

Post a comment

Poster

Email

Email addresses are not required. Email addresses posted are protected from spam with JavaScript.

Comment

Write 4856 in this field