Modeling Air Compression Cylinder

  • #36
So as a simple physics model applying conservation of energy treating the gas trapped between piston and bb as incompressible and without significant mass:

$$ \frac{1}{2}kx_o^2 = \frac{1}{2}M_{p} v^2 + \frac{1}{2} \frac{1}{3}M_s v^2 + \frac{1}{2}M_{bb} \left( \frac{D_p}{D_{bb}}\right)^4 v^2 $$

1736518051905.png


Is this in the ballpark upper bound for the velocity of piston as the BB leaves the barrel?

Giving for the BB and upper bound of:

$$ v_{bb} = \left( \frac{D_{p}}{D_b} \right)^4 v \approx 1500~\text{m/s} $$

If its even half that in actuality, I've done some other ballpark calculations that say the back pressure from accelerating the air ahead of the bb out of the barrel could be significant.
 
Last edited:
Engineering news on Phys.org
  • #37
WOW! At mach 4.5 you could save a lot on gun powder. 😱
 
  • #38
Tom.G said:
WOW! At mach 4.5 you could save a lot on gun powder. 😱
:smile:
 
  • #39
Tom.G said:
WOW! At mach 4.5 you could save a lot on gun powder. 😱
It could be significant at mach 1 (or less) too. As far as I know the OP is looking for deviations in simulation vs. measurement.

So I just imagined a tube of length ##L## and diameter ##D## and constant friction factor ##f##. For unsteady- incompressible flow of the gas in the barrel initially at rest I get this for the pressure in front of the projectile as it clears the barrel:

$$ P = P_{atm} + \rho L \dot v + \rho f \frac{L}{D}\frac{v^2}{2} $$

So for a constant a pressure differential across the tube the flow would begin to accelerate from rest. I ignore the decrease in mass, so a solution is able to be obtained.

I'm trying to answer "what pressure would I need to reach a certain velocity in the flow by the time an element would travel the length of the barrel":

with ##u =(P-P_{atm} )-\rho f \frac{L}{D}\frac{v^2}{2}## the ODE becomes linear separable:

$$ -\frac{D}{f}\frac{du}{dz}=u$$

After I solve for everything in terms of ##v## ( the desired projectile velocity at the end of the barrel) I get this:

1736618148073.png



It quadratic and here is a plot with some reasonable parameters I believe.

1736618295786.png


Sorry to mix English and metric but I just have more sense of scale with psi over pascals. Is a 10 psi back pressure ignorable, what is the pressure behind the projectile pushing it?
 
Last edited:
  • #40
Hi have been sick last couple of days, but have been able to measure the pressure in the chamber and in the barrel (add the exit of the nozzle) and the pressure in the barrel right at the end (when the bb exits).

Simulation_vs_measuremen_complete_setup.PNG


It seems that the pressure in the chamber is a bit higher then what is measured so need to recheck all the measurements (initial air-mass and the mass-air-flow) the ratio between chamber and barrel/nozzle pressure seems to be in the right area. Think if I can get these to match the simulation completely matches reality. So maybe the assumption that the bb sees another force might be incorrect.

Also noticed that the pressure normally is dropping below ATM when the piston is going backwards. so in the measurement above I made sure the spring was already compressed.
 
  • #41
JeroenM said:
Hi have been sick last couple of days, but have been able to measure the pressure in the chamber and in the barrel (add the exit of the nozzle) and the pressure in the barrel right at the end (when the bb exits).

View attachment 355800

It seems that the pressure in the chamber is a bit higher then what is measured so need to recheck all the measurements (initial air-mass and the mass-air-flow) the ratio between chamber and barrel/nozzle pressure seems to be in the right area. Think if I can get these to match the simulation completely matches reality. So maybe the assumption that the bb sees another force might be incorrect.

Also noticed that the pressure normally is dropping below ATM when the piston is going backwards. so in the measurement above I made sure the spring was already compressed.
I believe the yellow spike in pressure is acting over the length of the barrel. I think it shows the magnitude is not insignificant. It is working against the projectile as the static gas in the barrel before the spring is released is accelerated out of the barrel ahead of the projectile. That pressure increases the pressure in the chamber that is pushing the projectile relative to a model that doesn’t consider it.

If the bb is already out of the barrel than that pressure is just the pressure behind the bb as it exists ( and I'm mistaken)

What is the timing of the spike relative to the bb position?
 
Last edited:
  • #42
The pressure spike is just as the BB passes the sensor and just before it exits the barrel. I went a step back and did a measurement with the barrel and no BB but I closed the barrel on the end. Same as I did with only the cylinder. But is pretty far off.

So this is with no barrel and closed cylinder:
Closed_port.PNG

Pretty good match sim vs measurement

Below is the same but then with a 300mm (6.05mm barrel) connected.

Closed_barrel.PNG

EDIT:
Just notiched that the pressure in the barrel is not the same as in the chamber but accoring to the measurement it was. Most likely due to the fact that my "nozzle" MFR calculation only works one way.

Matlab simulation code:
% Initialize air mass in the chamber
m_air_chamber(1) = P0 * Lc*Ap / (R * T);  % Initial mass of air in the chamber
m_air_barrel(1)=P0 * Lb*Ab / (R * T); % Initial mass of air in the barrel

for n = 2:n_steps
 
 % Chamber volume
    V_c(n) = Lc*Ap - x_p(n-1) * Ap;

    % Update chamber pressure (Ideal Gas Law)
    P(n) = m_air_chamber(n-1) * R * Temp(n-1) / V_c(n);

    Temp(n)=T*(P(n)/P0)^((gamma-1)/gamma); % Calculate temperature rise due to fast adiabatic compression
 
    rho_air_chamber = P(n)/(R*Temp(n));


% Calculate orifice flow
    delta_P_orifice(n) = P(n) - P_barrel(n-1);  % Pressure difference across orifice
    pressure_ratio = P_barrel(n-1) / P(n);  % Downstream to upstream pressure ratio

    if pressure_ratio > critical_pressure_ratio  % Subsonic flow
        flow_regime(n) = 1;  % Subsonic
        if delta_P_orifice(n) > 0
         
            m_dot_orifice(n) = C_d * An * P(n) * sqrt(2 / (R * Temp(n))* (gamma / (gamma - 1))  * ((P_barrel(n-1)/P(n))^(2/gamma) - (P_barrel(n-1)/P(n))^((gamma+1)/gamma)  ) );
        else
            m_dot_orifice(n) = 0;
        end
    else  % Choked flow
        flow_regime(n) = 2;  % Chokedflow_regime(n) = 2;  % Choked
        m_dot_orifice(n) = C_d * An *P(n)*sqrt(gamma/(R * Temp(n))) * (2/(gamma+1))^((gamma+1)/(2*(gamma-1)));
    end
   

    % Update air mass in chamber and barrel
    m_air_chamber(n) = m_air_chamber(n-1) - m_dot_orifice(n) * dt;  % Air leaving chamber
    m_air_barrel(n) = m_air_barrel(n-1) + m_dot_orifice(n) * dt;

    % Update barrel pressure (assuming ideal gas law)
    P_barrel(n) = m_air_barrel(n) * R * Temp(n-1) / (Lb * Ab);  % Lb is length barrel Ab area barrel

    % Update air density in chamber
    rho_air_barrel(n) =  P_barrel(n) / (R * Temp(n));

    % Spring force (Hooke's Law with pre-load)
    F_spring(n) = k * (x_preload - x_p(n-1)); % Spring force with pre-load
   
    F_friction(n) = sign(v_p(n-1))*((P(n) - P0) * A_seal * mu);  % Friction force on the piston

    %Force due to pressure buildup
    F_pressure(n) = (P(n)- P0)* Ap;

    %Net force on piston
    F_n(n) = F_spring(n) - F_pressure(n) - F_friction(n);

    % Piston dynamics
    a_p(n) = F_n(n) / m_p;
    v_p(n) = v_p(n-1) + a_p(n) * dt;
    x_p(n) = x_p(n-1) + v_p(n) * dt;
 
Last edited:
Back
Top