FEMM - Hollow Cylinder Projectile

Home
Up
Site Map

What shape of projectile works best? Let's use FEMM to analyze some possibilities. What about various sizes of a hollow cylinder? The new Lua scripting feature in FEMM 3.2 makes this easier!

This web page studies a hollow cylinder, explains how the FEM model works, and tries to draw some conclusions. The FEM files are provided, so you can see how it's done and try other variations.

FEMM Model of Hollow Cylinder

A few weeks ago, some trial runs seemed to suggest that a hollow cylinder works better than solid. The Lua scripting example provided by Dr. Meeker is an excellent tutorial, but it uses a spherical projectile. I adapted his model to the new purpose.

Let's use Lua scripting to try a range of sizes.

For a starting point, I'll use a 1 mm thick cylinder wall, and vary the inside radius to see what happens. The coil dimensions match my FEMM model on my previous page, just to be consistent.

Assumptions

This modelling is a good starting point, but it is still very simplified:

How to Run Lua Script in FEM

Here is a step-by-step procedure to reproduce my results.

Pre-processor Lua Program

This program moves the projectile and runs the numerical analysis of the problem. Then it calls the post-processor to extract the particular results we want to see.

hollow_cylinder_pre.lua (download)
-------------------------------------------------
-- Main program
-------------------------------------------------
project = "hollow_cylinder"
outfile = project .. "_results.txt"
start_time = date()

-- Amount the projectile radius grows
increment = 0.3

handle = openfile(outfile, "w")		-- overwrite old results file!
write(handle, "\nInvestigating radius of hollow cylinder projectile \n")
write(handle, "Start time: ", start_time, "\n" )
write(handle, "Coil is 20mm long\n" )
write(handle, "    3mm inside radius\n" )
write(handle, "    6mm outside radius\n" )
write(handle, "Projectile is 10mm long\n" )
write(handle, "    0.1 inside radius (initial)\n" )
write(handle, "    1.1 outside radius (initial)\n")
closefile(handle)

-- Save model under new name, so it can't affect your carefully prepared
-- starting model. The new name also prevents losing your work if you get
-- a runaway solution that you have to kill in the Task Manager.
save_femm_file("temp.fem")

-- Prepare for selecting and moving the group of points in the projectile.
seteditmode("group")

-- Loop through the sizes of projectile; each one is 'increment' larger
for i=0,5 do
	inside_radius = 0.1 + (i * increment)

	handle = openfile(outfile,"a")
	write(handle, "\nInside radius ", inside_radius, ", iteration ", i, "\n")
	closefile(handle)

	-- Loop through all the projectile positions along firing tube
	for n=1,25 do
		-- Save current position for post-processor
		handle = openfile("tempfile","w")
		pos = n-25
		write(handle, pos)
		closefile(handle)

		-- Solve and save results
		showmesh()
		analyse()
		run_post(project .. "_post.lua")

		-- Nudge projectile downward by 1mm
		selectgroup(1)
		move_translate(0,-1)	
	end

	-- Move projectile back to starting position, and
	-- increase radii by 'increment'
	selectgroup(1)
	move_translate(increment, 25)
end

-----------------------------------------------
-- Document the total run time and finish up --
-----------------------------------------------
handle = openfile(outfile, "a")
end_time = date()
write(handle, "\nEnd time: ", end_time )
closefile(handle)

messagebox("All done!\n\nStarted " .. start_time .. "\nFinished " .. end_time)

Post-processor Lua Program

This program drives the post-processor of FEM and records the force on the projectile in a file.

hollow_cylinder_post.lua (download)
outfile = "hollow_cylinder_results.txt"

-- read projectile's position at its centerpoint
handle = openfile("tempfile", "r")
position = read(handle, "*n")
closefile(handle)

-- Select the solenoid coil, to prepare for integration
groupselectblock(2)

-- Option 10 tells you the volume.
-- Option 12 computes mechanical force. 
-- Read the manual; it can compute lots of other things!
force = blockintegral(12)

-- Output volume and force to results file
handle = openfile(outfile,"a")
write(handle, position, "\t", force, "\n")
closefile(handle)

exitpost()

Conclusion

The graphs for seven different projectiles are practically on top of one another. Therefore, the force per unit of mass does not depend on the inside radius of a hollow cylinder of iron. (Click on the this picture at right for a full-size view.)

This was a surprise! I expected that a larger diameter cylinder would work better, because it would be closer to the coil's windings, and therefore have a smaller air gap. But that's not how it turned out!

I believe this is explained by the fact that the magnetic field is quite uniform inside a solenoid. That means the mechanical force is essentially independent of the projectile's shape -- the magnetism acts upon the iron it can 'reach' regardless of its distance from the coil's windings.


Last update May 7, 2007 by Barry Hansen ©1998-2007