Non-quasi-static Air Compression Calculation

Hello Everyone,

As some of you know, there are airsoft guns which work with a spring and piston mechanism. An electric motor drives a semicircle gear and that gear drives a rack gear connected to piston. When the gear compresses the spring and reaches semicircle’s free end the piston compresses the air and push the airsoft bullet (BB).

So I want to design such a system but I stuck at this point. The air compression is not quasi static in this case because motor runs at high rpm. I am trying to calculate what pressure is required in order to push the BB with a velocity of 400 m/s. How to calculate the final pressure of a non-quasi static air compression?

jrmichler
Mentor
First of all, 400 m/s is high velocity for an air rifle, and completely unrealistic for an airsoft gun.

The best place to start is by getting a copy of The Airgun from Trigger to Target by Cardew and Cardew: https://www.amazon.com/dp/0950510823/?tag=pfamazon01-20. Read that book from cover to cover, then read it again.

If you want to better understand the thermodynamics of high speed air compression, good search terms to start with are: adiabatic vs isothermal compression.

sysprog
Chestermiller
Mentor
How fast is the piston actually moving. Is the BB released after the air reaches full pressure, or does it move while the gas is being compressed? Doesn't 400 m/s exceed the speed of sound?

First of all, 400 m/s is high velocity for an air rifle, and completely unrealistic for an airsoft gun.

How fast is the piston actually moving. Is the BB released after the air reaches full pressure, or does it move while the gas is being compressed? Doesn't 400 m/s exceed the speed of sound?

Sorry my bad, the velocity is about 120 m/s. (almost 400 feet per second in british units)

1-) Actually I dont know the piston speed but to make an approx. Let's the spring is compressed about 7 cm. An average fire rate of airsoft gun is 20 round per second. So 0.05 second per each BB. During that time the spring is compressed and released. Release is probably much faster but lets assume equal. so 0.14 m / 0.05 s yields nearly 3 m/s. That doesnt seem reasonable so assumption is wrong. I don't know the piston speed.

2-) BB is not released after air reaches it's full pressure but in practice we assume that it is since the spring is released quite fast and also there is very little piece that prevents the BB to move in the chamber.

My procedure,

1-) Determine the desired effective range.
2-) By the help of drag and lift calculations calculate outlet velocity.
3-) To achive that speed select a compression spring with an appropriate spring constant.

In the third step I couldn't decide whether I should proceed with energy method or force method.

Chestermiller
Mentor
In my judgment, this is a solvable problem. Here's how I would approach it. Assume the spring and gas are separated by a frictionless piston of mass m. They are contained in a closed cylinder of total volume ##V_0##, with the spring occupying the region to the left, up to location x, and with the gas situated on the right, occupying the remainder V of the volume. So, neglecting the volume of the piston, we have at any time during the gas compression:
$$xA+V=V_0\tag{1}$$where A is the cross sectional area of the cylinder and V is the gas volume. Initially the spring is compressed and held in place. At time t = 0, the spring is released, and the system is allowed to irreversibly establish a new equilibrium to which the gas has been adiabatically compressed.

OK so far???

Last edited:
mastermechanic and sysprog
In my judgment, this is a solvable problem. Here's how I would approach it. Assume the spring and gas are separated by a frictionless piston of mass m. They are contained in a closed cylinder of total volume ##V_0##, with the spring occupying the region to the left, up to location x, and with the gas situated on the right, occupying the remainder V of the volume. So, neglecting the volume of the piston, we have at any time during the gas compression:
$$xA+V=V_0$$where A is the cross sectional area of the cylinder and V is the gas volume. Initially the spring is compressed and held in place. At time t = 0, the spring is released, and the system is allowed to irreversibly establish a new equilibrium to which the gas has been adiabatically compressed.

OK so far???

Yes, I understand so far.

Chestermiller
Mentor
This is a continuation of the analysis in Post #5.

The force exerted by the compressed spring in the positive x-direction (on the left face of the piston) is $$F=k(L-x)$$ where L is the unextended length of the spring and k is the spring constant. If we combine this with Eqn. 1 of post #5, we obtain the compressive force of the spring as a function of the gas volume:$$F=\frac{k}{A}(V-V^*)\tag{3a}$$ with $$V^*=V_0-LA\tag{3b}$$According to Eqn. 3a, the greater the gas volume, the more that the spring is compressed, and the greater the compression force of the spring on the piston.

If we do a force balance on the piston during this irreversible process, we obtain: $$F-F_g=m\frac{dv}{dt}\tag{4a}$$ or $$F_g=F-m\frac{dv}{dt}\tag{4b}$$where ##F_g## is the force exerted by the gas in the negative x-direction on the right face of the piston, and v is the velocity of the piston: $$v=\frac{dx}{dt}=-\frac{1}{A}\frac{dV}{dt}\tag{5}$$During the gas compression, because of the irreversibility of the deformation, ##F_g## is not the force calculated from the ideal gas law; however, at final steady state, when the system has equilibrated and the piston has come to rest, we have: $$F=F_f=\frac{k}{A}(V_f-V^*)=P_fA\tag{6}$$
Eqn. 6 provides us with a relationship for the final pressure of the gas exclusively in terms of the final volume of the gas.

Next, if we multiply Eqn. 4b by the piston velocity dx/dt, we can obtain the rate at which the piston does work on the gas: $$\frac{dW}{dt}=F_g\frac{dx}{dt}=F\frac{dx}{dt}-mv\frac{dv}{dt}\tag{7}$$Substituting Eqns. 3 and 5 into Eqn. 7 then yields: $$\frac{dW}{dt}=-\frac{k}{A^2}(V-V^*)\frac{dV}{dt}-mv\frac{dv}{dt}\tag{8}$$If we next integrate Eqn. 8 between time equal to zero and infinite time, taking into account the fact that, at final equilibrium the piston is no longer moving, we obtain the total (final) amount of work that the spring does on the gas: $$W_f=-\frac{k}{A^2}\int_{V_i}^{V_f}(V-V^*)dV=\frac{k}{2A^2}[(V_i-V^*)^2-(V_f-V^*)^2]\tag{9}$$In the end, this is just the change in stored elastic energy of the spring.

From the 1st law of thermodynamics, it follows that that the internal energy change for this adiabatic reversible compression of the air is equal to the work done on the gas: $$\Delta U=\frac{k}{2A^2}[(V_i-V^*)^2-(V_f-V^*)^2]\tag{10}$$Treating the air as an ideal gas, we have that $$\Delta U=nC_v(T_f-T_i)=\frac{C_v}{R}(P_fV_f-P_iV_i)=\frac{5}{2}(P_fV_f-P_iV_i)\tag{11}$$Combining Eqns. 10 and 11 then yields: $$5(P_fV_f-P_iV_i)=\frac{k}{A^2}[(V_i-V^*)^2-(V_f-V^*)^2]\tag{12}$$Substituation of Eqn. 6 for ##P_f## into Eqn. 12 then yields: $$6(V_f-V^*)^2+5V^*(V_f-V^*)=5A^2\frac{P_iV_i}{k}+(V_i-V^*)^2\tag{13}$$Eqn. 13 provides a quadratic algebraic equation for determining the final volume ##V_f## in terms of known parameters. Once this is known, the final pressure can be determined from Eqn. 6.

Last edited: