diff --git a/core/src/net/sf/openrocket/aerodynamics/barrowman/TubeCalc.java b/core/src/net/sf/openrocket/aerodynamics/barrowman/TubeCalc.java index 60117d808..5a0f96283 100644 --- a/core/src/net/sf/openrocket/aerodynamics/barrowman/TubeCalc.java +++ b/core/src/net/sf/openrocket/aerodynamics/barrowman/TubeCalc.java @@ -6,8 +6,17 @@ import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.Tube; import net.sf.openrocket.util.MathUtil; -public abstract class TubeCalc extends RocketComponentCalc { +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class TubeCalc extends RocketComponentCalc { + + private final static Logger log = LoggerFactory.getLogger(TubeFinSetCalc.class); + + // air density (standard conditions) + private final double rho = 1.225; // kg/m^3 + private final double diameter; private final double length; protected double refArea; @@ -25,18 +34,37 @@ public abstract class TubeCalc extends RocketComponentCalc { @Override public double calculatePressureCD(FlightConditions conditions, double stagnationCD, double baseCD, WarningSet warnings) { + // These calculations come from a mix of theoretical and empirical + // results, and are marked with (t) for theoretical and (e) for empirical. + // The theoretical results should not be modified; the empirical can be adjusted + // to better simulate real rockets. - // calculation of pressure drop through pipe from "Atlas Copco Air Compendium", 1975, - // quoted as equation 14 in Carello, Ivanov, and Mazza, "Pressure drop in pipe + // Temperature + final double T = conditions.getAtmosphericConditions().getTemperature(); + + // Sutherland Equation for viscosity of air (e) + final double mu = 1.458e-6 * Math.pow(T, 3/2) / (T + 110.4); // + + // Volume flow rate (t) + final double Q = conditions.getVelocity() * refArea; + + // Reynolds number (note Reynolds number for the interior of a pipe is based on diameter, + // not length (t) + final double Re = (4 * rho * Q) / (Math.PI * diameter * mu); + + // quoted as equation 12 in Carello, Ivanov, and Mazza, "Pressure drop in pipe // lines for compressed air: comparison between experimental and theoretical analysis", // Transactions on Engineering Sciences vol 18, ISSN 1743-35331998, 1998. - // Volume flow rate - final double Q = conditions.getVelocity() * refArea; - - // pressure drop - final double deltap = 1.6 * Math.pow(Q, 1.85) * length / - (Math.pow(diameter, 5) * conditions.getAtmosphericConditions().getPressure()); + // friction coefficient (for tube interior) (e) + final double lambda = 0.3164 * Math.pow(Re, -0.25); + + // pressure drop (e) + // 101.325 is standard pressure + // Power in equation is 5 in original source. That was experimentally derived; I'm adjusting + // it to match the data I've got from two rockets. + final double deltap = (lambda * 8 * length * rho * MathUtil.pow2(Q) * T * 101.325) / + (MathUtil.pow2(Math.PI) * Math.pow(diameter, 4.8) * 273 * conditions.getAtmosphericConditions().getPressure()); // convert to CD and return return deltap * refArea / conditions.getRefArea();