The efficiency of a gun is less than 100 % because some energy will be lost by heating the barrel and, for rifled guns, in rotating the projectile. EB9 suggests an efficiency ("factor of effect) ranging from 0.6–0.65 for field guns up to 0.85-0.95 for heavy guns.
In the nineteenth century, the "gold standard" for predicting muzzle velocity was Sarrau's monomial (for quick powders) or binomial (for slow powders) approximation. This had a couple of adjustable parameters to account for the differences between powders and these were determined by measuring the muzzle velocity for the same powder fired in two dissimilar guns. You could then apply the same formula to any other gun using the same powder.
The Sarrau formula was available in a few texts for general readers, including Johnson's Universal Cyclopaedia (1895), and the Encyclopedia Britannica 10th edition (the 1902 supplement to the 9th edition), but these are not, as far as I know, among the books that traveled back with Grantville.
Optimal Bore Length. Bore length is probably 92–94 % of the length of the piece. (Douglas 293). In general, the longer the effective bore (from projectile starting position to muzzle), the greater the muzzle velocity for a given powder charge; the muzzle velocity in turn determines range and penetrating power.
But there are definitely diminishing returns. Experiments have been conducted in which a barrel is successively cut down and the new muzzle velocity determined. In 1862, Benton (130) reported that for a small change in length of a 12-pounder, the velocity was in fact proportional to the fourth root of the length. Another writer says that it's proportional to something between the square and cube root of the length of the bore (Douglas 101). I have seen the opinion expressed that there was no advantage to making a sixteenth-century gun longer than ten feet (Rodger 215). A 24-pounder of Douglas' time would have a bore length of 5.5–8.92 feet (293).
Theory also predicts diminishing returns. If the powder burns at a constant rate, slowly enough so the last of the powder is consumed just as the projectile exits the barrel, and the gas expansion is isothermal, the muzzle velocity will be proportional to the cube root of the barrel length. If we instead assume that the gas expansion is adiabatic (no heat lost), then it will be proportional to the fifth root of the length. (Denny 183-5). Note that this requires that the powder charge be proportional to the length of the barrel, which was not usually the case!
The analysis above is for black powder propellant; with smokeless powder, the pressure-position curve is different, and the optimal barrel length depends on the shape of the curve. (Denny 67ff, 188ff).
The advantage of increasing length is not so much the increased muzzle velocity, but rather that one can then use a slower-burning powder and thus reduce the maximum pressure-permitting reduction of barrel thickness and increasing barrel life. (Sladen 34).
Is there a limit beyond which increasing length has no effect or even reduces muzzle velocity? If the force propelling the projectile merely diminished as it traveled down bore, then there would be no bore length at which muzzle velocity was maximized, merely diminishing returns from lengthening it. But there is such a length, because the projectile's movement faces opposition even as the propulsive forces decline.
Benton (128) suggested three opposing forces: (1) friction, (2) inelastic collision, and (3) the pressure of the air in front of the projectile, and urged that if the length is increased too much, keeping the charge constant, the muzzle velocity will decrease.
Friction comes into play only for rifled barrels, where the projectile engages the rifling. The frictional force is presumably constant throughout the length of the barrel, whereas the propulsive force declines as the projectile moves down-barrel. It's possible to show that if you assume constant burn rate, isothermal expansion, constant frictional force along barrel, and optimal projectile length (powder completely burnt, and frictional force equal propulsive force, just as projectile reaches muzzle), the length at which the frictional force equals the propulsive force must be proportional to the mass of the projectile and the square of the muzzle speed, and inversely proportional to the frictional force in the barrel (this results from combining Denny equations N7.6, N7.9, and N8.2). Since the length of the region of contact is kept small, the frictional force at any given moment should be proportional to the circumference of the bore and thus to the diameter.
For smoothbores, interior collisions slow down the projectile, but as noted in the discussion of "windage," they should be less common as the diameter increases.
Like friction, outside atmospheric force is a constant resistive force, but it's proportional to the area and thus to the square of the diameter of the bore.
Powder charge. The expectation was that up to a point, increasing the powder charge (relative to the shot weight) would increase muzzle velocity. Obviously, once the projectile left the muzzle, any unconsumed powder would fail to provide any further boost to its speed.
There was great controversy, however, as to whether a point could be reached where any further increase in charge would actually reduce the muzzle velocity. Robins was insistent that this could not possibly be the case. However, Benton (130) reported a progressive decrease in muzzle velocity for a 36-pounder firing charges ranging from 36–77 pounds, and Farrow (289) suggests that the charge yielding the maximum velocity is half to two-thirds projectile weight. Still, it's not clear from the underlying physics why this diminution should occur.
Even if there weren't diminishing returns vis-a-vis muzzle velocity, the amount of powder used would be constrained by the size of the powder chamber, fear of bursting the gun, and the recoil.
It has also been reported that the maximum velocity charge increases with the length of the gun. This makes sense as, for the same rate of acceleration, it gives more time for useful consumption of powder.(Simpson 177).
Multi-Chamber Guns
High-Low Pressure Gun. These have a divided propellant chamber, with two compartments separated by a plate with holes. The powder is ignited in the first compartment, generating a high pressure. Because of the constricted communication with the second, the pressure there is lower, resulting in a lower muzzle velocity but also a lower recoil. If you are wondering why not just use a conventional gun with a low powder charge, it's because the high pressure results in a better "burn" curve, and only the first chamber needs a thick wall. The concept was first implemented in the Panzerabwehrwerfer 600 (1945) and copied in the British Limbo depth charge launcher (1955) and later the American M79 grenade launcher.
Lyman-Haskell Multicharge Gun. The American government tested a 6-inch multicharge gun in 1883. This had five powder chambers, one at the breech, and the remaining four distributed along the length of the bore. The charge at the breech was smaller than the others, and the nearer the powder chamber to the muzzle, the faster burning the powder used. The theory was that the pressure created by their deflagration would also be distributed, allowing one to achieve a much higher muzzle velocity without overstressing the barrel. The breech charge was ignited in the usual way and the other charges by the passage of the combustion gases propelling the projectile.
The multicharge gun, with 119 pounds of powder, accelerated a 111-pound projectile to a muzzle velocity of 2004 fps, but with a barrel pressure of only 31,550 psi. In contrast, the Krupp 5.9 inch gun used a single charge to propel a 112.2 pound shell, achieving a muzzle velocity of 1676 fps with a pressure of 40,320 psi. So what's the catch, other than the profligate use of powder?