Login    Register
User Information
Username:
Password:
We are a free and open
community, all are welcome.
Click here to Register
Sponsored
Who is online

In total there are 72 users online :: 4 registered, 0 hidden and 68 guests


Most users ever online was 155 on Mon Aug 15, 2016 1:40 am

Registered users: Bing [Bot], Google [Bot], MSNbot Media, Yahoo [Bot] based on users active over the past 5 minutes

The Team
Administrators
Global Moderators
global_moderators.png CS

High speed pneumatic gun simulation

Post questions and info about pneumatic (compressed gas) powered cannons here. This includes discussion about valves, pipe types, compressors, alternate gas setups, and anything else relevant.
Sponsored 
  • Author
    Message

High speed pneumatic gun simulation

Unread postAuthor: btrettel » Wed Mar 23, 2011 2:44 pm

This is a continuation of the discussion DYI and I were having about high speed simulation.

So, GGDT is known to be inadequate at high speeds. We must make new tools to predict performance in the high speed range.

At the moment I'm writing a relatively simple 1D Lagrangian code to predict the performance of high speed pneumatics. The 1D Lagrangian method is described in this book (available there as a PDF) on page 41. I will be doing a number of other things different than GGDT. For example, the valve model will be simpler in a few ways (the actual dynamics of the piston will be ignored for this first code), but better in other respects (the critical pressure ratio for a valve is generally far lower than it is for an orifice, so the typical equation for the critical pressure ratio is very wrong).

I actually have slowly been planning out and researching for a more accurate simulation, but I haven't had the free time until spring break.
  • 0

All spud gun related projects are currently on hold.

btrettel
Major
Major
 
Posts: 380
Joined: Sun Feb 03, 2008 4:40 pm
Location: Maryland
Reputation: 0

Unread postAuthor: btrettel » Thu Mar 24, 2011 6:45 pm

Hmm... I wrote a Lagrangian code to simulate a piston compressing some gas. My code works, but it's unstable, even though I'm following the example in the book! As I said, this is not a trivial thing to figure out. I'm taking a class in numerical PDEs at the moment, so I'll ask the professor about it after my spring break is over.
  • 0

All spud gun related projects are currently on hold.

btrettel
Major
Major
 
Posts: 380
Joined: Sun Feb 03, 2008 4:40 pm
Location: Maryland
Reputation: 0

Unread postAuthor: saefroch » Thu Mar 24, 2011 8:29 pm

Good luck to you! Don't want you to think none of us are following this, because I certainly am. I'm very interested in this, after getting a wildly optimistic supersonic prediction out of GGDT myself.
  • 0

User avatar
saefroch
Major General
Major General
 
Posts: 1679
Joined: Mon Jun 08, 2009 8:47 am
Location: U.S.A.- See Map
Country: United States (us)
Reputation: 0

Unread postAuthor: Technician1002 » Thu Mar 24, 2011 9:24 pm

Good luck on getting this done. I'll definitely be interested. I too am looking into some good modeling of high flow valves at high pressure.
  • 0

User avatar
Technician1002
Chief of Staff
Chief of Staff
 
Posts: 5190
Joined: Sat Apr 04, 2009 11:10 am
Reputation: 14

Unread postAuthor: LeMaudit » Thu Mar 24, 2011 10:14 pm

I too would be interested. I love to play with GGDT for hours :-)

I don't have the mathematical background to help with the equations, but I sure know how to design an interface and integrate some program code.

So if I can help in that matter just let me know.

Cheers.
  • 0

User avatar
LeMaudit
Donating Member
Donating Member
 
Posts: 665
Joined: Thu Apr 16, 2009 2:48 pm
Reputation: 0

Unread postAuthor: Gaderelguitarist » Thu Mar 24, 2011 10:34 pm

I don't have the programing background to help with interfacing and coding, but I sure know how to make things out of wood!

Need a box to keep your notes in?

Seriously good luck with this though. :D
  • 0

so many muchness
User avatar
Gaderelguitarist
Colonel
Colonel
 
Posts: 580
Joined: Sat Aug 16, 2008 9:56 pm
Location: Columbia, MD
Reputation: 0

Unread postAuthor: btrettel » Fri Mar 25, 2011 8:36 am

Thanks for the encouragement. I'd also be happy to take suggestions, but at this stage anything substantial is more likely to be put on the backburner until I figure out the basics.

Also, the page I linked to describes the method I'm using rather well, so if someone does have programming experience and understands calculus, they probably could start implementing their own code. Someone with more free time than I have could make more progress.

LeMaudit, I know absolutely nothing about programming interfaces, so if you can help with that, I'd be very appreciative.
  • 0

All spud gun related projects are currently on hold.

btrettel
Major
Major
 
Posts: 380
Joined: Sun Feb 03, 2008 4:40 pm
Location: Maryland
Reputation: 0

Sponsored

Sponsor
 


Unread postAuthor: jackssmirkingrevenge » Fri Mar 25, 2011 8:41 am

Gaderelguitarist wrote:I don't have the programing background to help with interfacing and coding, but I sure know how to make things out of wood!

Need a box to keep your notes in?


Even better ;)
  • 0

User avatar
jackssmirkingrevenge
Donating Member
Donating Member
 
Posts: 24225
Joined: Thu Mar 15, 2007 11:28 pm
Country: Holy See (Vatican City State) (va)
Reputation: 66

Unread postAuthor: LeMaudit » Fri Mar 25, 2011 9:22 am

I'll be glad to.
If you figure some code or pseudo-code out of the equations, I can try put then in a little Windows program, GGDT flavoured :wink:

Gaderelguitarist... I have lots and lots of code... would you like to exchange a few 100ths of code lines for a nice wooden box ? :lol:
  • 0

Last edited by LeMaudit on Fri Mar 25, 2011 1:11 pm, edited 1 time in total.
User avatar
LeMaudit
Donating Member
Donating Member
 
Posts: 665
Joined: Thu Apr 16, 2009 2:48 pm
Reputation: 0

Unread postAuthor: DYI » Fri Mar 25, 2011 1:06 pm

Btrettel, I looked at the approach you linked me to, and noted some subtle flaws.

What they're doing is essentially a derivation of the conservation equations for an infinitesimal volume moving with the flow, with somewhat less rigour than I'm used to. The derivation seems okay, but upon closer inspection is not tremendously useful.

To understand why, consider the physical effect of the time steps. Disturbances will propagate at some speed based upon the size of the disturbance and the local temperature/gas composition (we'll assume the flow to not be chemically reacting for now...). In the numerical implementation, disturbances will propagate at a speed equal to the distance between the two points being considered, divided by the time step.

Now think what's happening in a simple 1-D launcher: the points nearer to the projectile will spread out significantly, while those near the chamber base will remain (relatively) closely packed. Also to be noted is that the sound speed in those closely packed sections is higher, as they've expanded less and are thus hotter (the pressure has an effect as well, but we'll discount non-ideal gas effects for now). The result? With a fixed time step, sound will tend to travel faster in the cooler sections, and slower in the hotter ones, a physically backward scenario.

The solution to this problem is, as I mentioned earlier, the generation of an adaptive grid. I've yet to wrap my mind completely around the implementation of it, but it essentially allows, in the constructed computational space, for the finite difference equations to be solved in a uniform grid, with uniform timesteps in such a way that, when it's translated back to the physical space, gives realistic representation of the actual disturbance propagation rates.

Unfortunately, my workload here at school is rather high at the moment, and it might be May before I can get this method worked out and implemented...

On another note, it is interesting to ponder what a hypothetical analytical solution would look like. Would a speed of sound and accurate propagation rate simply "fall out" of the result due to the inclusion (in the derivation) of sufficient parameters to calculate it? What about the particle speeds in the gas? Would we need to include more information in the derivation before that would happen? Compressible flow is indeed a fascinating puzzle.
  • 0

Spudfiles' resident expert on all things that sail through the air at improbable speeds, trailing an incandescent wake of ionized air, dissociated polymers and metal oxides.
User avatar
DYI
Lieutenant General
Lieutenant General
 
Posts: 2861
Joined: Sat Jul 07, 2007 8:18 pm
Location: The People's Republic of Canuckistan
Country: Turks and Caicos Islands (tc)
Reputation: 9

Unread postAuthor: btrettel » Fri Mar 25, 2011 2:23 pm

DYI, the problem you mention is valid for explicit methods, and you are very smart to have picked that out. It's called the CFL condition. It was mentioned in the book on page 50, though not in much detail, and in a manner different from how you thought about it.

There are a number of ways around this problem. One relatively simple one is to adaptively change the grid/cells as you've mentioned. This can be done with the Lagrangian method too, and I don't think it's that hard; I basically already have to do this to implement the mass flow from the valve. This, unfortunately, presents other problems (interpolation errors, loss of resolution, added computation, etc.), so I don't intend to implement it.

One approach that avoids this problem completely is the numerical method of characteristics. There is no CFL condition for the MOC. The MOC, unfortunately, is kinda confusing with multiple equations, but if you are interested, I would suggest this book. This sounds like the closest thing to what you want to implement. This method has been used fairly often for interior ballistic simulations (see this book for specifics), but in my opinion, it's a pain when real gas and non-isentropic effects are added (as I want to do). The Lagrangian approach, in contrast, allows for these effects to be added quite easily. See this paper for some details about that.

There also is an approach to this problem that I'm looking in to (though not directly; I want stability, and the CFL condition is only one part of that). An implicit method completely avoids this problem because the numerical domain of dependence would be all values. Of course, this comes at a cost; implicit methods are generally much more difficult to implement and require more computation per time step. This is why higher-order accuracy implicit methods are used along with larger time steps. The result is stability and improved accuracy. I do want to implement an implicit method now due to the instability that I'm seeing.

The Lagrangian approach seems to be somewhat uncommon compared against the numerical MOC, but the approach has successfully been used for hypersonic gun simulations before. See, for example, this 50 year old technical report from the Naval Ordnance Lab.

As for analytical solutions... I've looked for them, but they don't exist unless we define new functions. The MOC and dimensional analysis might offer some insights into how one might define the new functions, but I'm not going to bother looking into that.
  • 0

All spud gun related projects are currently on hold.

btrettel
Major
Major
 
Posts: 380
Joined: Sun Feb 03, 2008 4:40 pm
Location: Maryland
Reputation: 0

Unread postAuthor: Gaderelguitarist » Fri Mar 25, 2011 9:15 pm

Even better


So essentially...it's a very large computer that....makes equations.

I can figure math as long as it's about geometry, or some sub genre. I never really decided to try my hand at calculus or other theoretical, seemingly useless methods of mixing numbers to make different ones. One of the beautiful things about being an artist is that Math is not a necessity :lol: .

I have lots and lots of code... would you like to exchange a few 100ths of code lines for a nice wooden box ?


I'm not sure what I would do with coding. Quite frankly, I'm not sure what you would do with a wooden box. Right now I'm working on making a food/alcohol safe wooden tankard. That has many more uses.

Thats as far of a tangent (heh...math) as I will go upon. No more distractions.
  • 0

so many muchness
User avatar
Gaderelguitarist
Colonel
Colonel
 
Posts: 580
Joined: Sat Aug 16, 2008 9:56 pm
Location: Columbia, MD
Reputation: 0

Unread postAuthor: DYI » Sat Mar 26, 2011 5:14 pm

I am aware of implicit methods and the MoC. The main attraction of the explicit finite difference approach for me is how intuitive the method is, and the good physical intuition for the situation that comes with it.

I may not have quite as much background here as you do, but I'm well acquainted with the CFL condition. Interesting how a result derived for linear PDEs has such applicability and physical meaning for the nonlinear flow equations. What I stated was just a general physical truth about the flows. I also neglected to mention the effect that relative flow velocities have on the propagation, but considering the small differences in this quantity between two adjacent points on a moving grid, this can probably be ignored (or at worst, easily accounted for).

I believe I've figured out how to solve the problem with a high degree of accuracy using an explicit finite differencing approach. It's not the most elegant of solutions, but it should work well. I'll report back with my results if I get it working.

I'll try to get it running at first on a straight, valveless tube with instant, uniform pressure generation in the chamber and a vacuum in front of the projectile. Much like most of the launchers I build nowadays... :lol:
  • 0

Spudfiles' resident expert on all things that sail through the air at improbable speeds, trailing an incandescent wake of ionized air, dissociated polymers and metal oxides.
User avatar
DYI
Lieutenant General
Lieutenant General
 
Posts: 2861
Joined: Sat Jul 07, 2007 8:18 pm
Location: The People's Republic of Canuckistan
Country: Turks and Caicos Islands (tc)
Reputation: 9

Return to Pneumatic Cannon Discussion

Who is online

Registered users: Bing [Bot], Google [Bot], MSNbot Media, Yahoo [Bot]

Reputation System ©'