GatewayToAirGuns.org    Donation

All Springer/NP/PCP Air Gun Discussion General > Engineering- Research & Development

Learning CFD to understand what makes a decent moderator

(1/2) > >>

WobblyHand:
Have to confess, need a challenge every now and again.  Thought it might be fun to learn CFD to understand more about moderators.  Well that part about fun is a stretch.  But since I went through something similar learning FEA, thought it might be possible to transfer some of that learning to CFD.  Now there's plenty of high $$$$ software tools for this, and PhD's learn this stuff along the way doing other stuff, but I'm just a retired guy with no budget for high end tools.  So I'm going to see if I can get going using some open source tools.  Open source is pretty good, but you have to be tenacious or lucky at times to get it done, especially if you have an odd (or new) computer.

My computer was on its last legs last year and I thought I'd make a major upgrade.  I changed from a linux distribution on a failing laptop, to a Mac.  Wow, it was a big jump.  For ordinary stuff I can say a Mac is great - at least if you can figure out the Mac way.  For super technical stuff, umm, it's kind of difficult.  Nonetheless, I persisted and managed to install CfdOF workbench on FreeCAD.  I already use FreeCAD for my CAD work (and 3d printing).  A while ago, I used the FEM work bench, learning finite element methods.  So I thought extending finite element methods to fluids shouldn't be that huge of a leap.  I was wrong, but still have managed at least to get Computational Fluid Dynamics using Open FOAM working on a new MacBookPro.  If someone should be so foolish to try this, let me know, I'll try to help.  But for now, I'll skip the gory details on that, because it's kind of boring for non-geeks.

Why am I doing this?  Well, probably like some of you, I've played around a little with making some moderators for my airguns, and wondered if there was some way to 1) visualize what was happening to pressure, flow and sound and 2) was there are way, if we knew what was happening, to make improvements.  Can't say my mods are super, but they mostly work, but I'd like them quieter and smaller.

After installing and configuring the SW, I ran the CfdOF workbench selftest, to see if everything was installed ok.  6 out of the 8 demos worked.  Hey that's par for open source.  I confirmed with the author that made sense, and he said he had issues with 2 of the demos.  The documentation for this workbench is a "work in progress", which really means there isn't much there.  The implication is it's time to be a big boy and figure some of it out yourself.  So after spending 3 or 4 weeks on this, today I got the demo example "projectile" to run without crashing the FreeCAD application.  Thought it was pretty neat to have 4 cores chugging away solving a high Mach turbulent compressible fluid simulation on a laptop.  Thought it would be a good sort of model to get going, in light of some of the possible situations in a moderator.  It was a steady state model though, and I think it's necessary to do this transiently.

This was just a baby step.  Have so much more to learn about this.  Even the terminology is quite different than what I am familiar with.  Maybe I will fall flat on my face, but at least I am going to give it a try.

So step 1 was done.  Do a toy, but complex model and simulate it.  Following steps would be to learn how to do set up and initialize this same model to run in transient mode.  Then learn more about setting up initial conditions that would be amenable to AG simulations, like simulating a release of a finite volume of high pressure air at t=0.  Lots of steps, but maybe they will bring me a little closer to understanding what's happening in our airguns.

Just for visuals, here's the output of my first projectile sim.  You can see the shock waves at the nose and the leading edge of the fins.

WobblyHand:
What goes up, must go down. 

Seemed to screw something up on my computer.  Now trying to recover CfdOF functionality.  Dang!  Just as I was getting closer.  In techno-talk, I can't open the necessary special volume for OpenFOAM.  It's a special read only volume on disk that has a case sensitive file system.  Any how, that seems to be busted.  I'll have to wait until I can get some help (online).  Hopefully that will be sooner rather than later, but it could be a while.

I have no idea what really caused the problem, so this is hard to learn from.  Will have to find something else to work on for a while.  Hopefully will be running again within a week.

WobblyHand:
Think I have a fix for getting CfdOF running again.  Have to apply it, and we'll see what happens.  Maybe I'll have CfdOF up and running this weekend.

Might be cool to simulate one of Bob's boat tail .22 slugs.  The picture with dimensions on NOE is a little garbled, can't quite get all the dimensions.  @rsterne, do you have a more complete diagram of the 27/30 grain slug?  I don't quite understand the nose and hollow point dimensions.

WhatUPSbox?:
Great job getting the CFD code running. When I looked, there were a number barrel/pellet/bullet cfd analyses posted online. One of them might make a benchmark. Here is an example https://www.youtube.com/@williamfraser/search?query=airgun
There is a bunch from the PB world that I won't link to but some of them may be useful.
Great work.

WobblyHand:

--- Quote from: WhatUPSbox? on May 05, 2024, 12:41:13 PM ---Great job getting the CFD code running. When I looked, there were a number barrel/pellet/bullet cfd analyses posted online. One of them might make a benchmark. Here is an example https://www.youtube.com/@williamfraser/search?query=airgun
There is a bunch from the PB world that I won't link to but some of them may be useful.
Great work.

--- End quote ---
Thanks.  My re-install is not quite working yet.  Got OpenFOAM set up again, but having issues with re-installing two critical programs, cfmesh-cdfof, and HiSA.  For some reason their builds aren't working correctly.  So, still down for the count.  Have a lot of reading to do.  Setting up the initial conditions will be key to getting meaningful results.  Long way to go still.  The HiSA simulator is for high speed turbulent flow, so I need to get that working again.

Wish some of these kinds of videos (like Mr. Fraser's) would describe the background more, and how such simulations were set up.  Results are cool, but I want to know how to do these kinds of sims myself.  I suspect the set ups are quite complex.

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Media Embedder
Powered by SMFPacks Alerts Pro Mod
Powered by SMFPacks Ads Manager Mod