Merge pull request #1333 from JoePfeiffer/refine-tube-drag

Refine tube drag
This commit is contained in:
Joe Pfeiffer 2022-05-06 07:18:13 -06:00 committed by GitHub
commit 5b49275ac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 17 deletions

View File

@ -51,4 +51,19 @@ public abstract class RocketComponentCalc {
*/
public abstract double calculatePressureCD(FlightConditions conditions,
double stagnationCD, double baseCD, WarningSet warnings);
/**
* Calculation of Reynolds Number
*
* @param length characteristic length
* @param conditions Flight conditions taken into account
* @return Reynolds Number
*/
public double calculateReynoldsNumber(double length, FlightConditions conditions) {
return conditions.getVelocity() * length /
conditions.getAtmosphericConditions().getKinematicViscosity();
}
}

View File

@ -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 final double innerArea;
@ -29,29 +38,49 @@ 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 as we get data.
// For the sources of the empirical formulas, see 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.
// For the rockets for which we have data, the effect of the stagnation CD appears to be
// overstated. This code multiplies it be a factor of 0.7 to better match experimental
// data
// Need to check for tube inner area 0 in case of rockets using launch lugs with
// an inner radius of 0 to emulate rail buttons (or just weird rockets, of course)
final double deltap;
double deltap;
if (innerArea > MathUtil.EPSILON) {
// 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 lines for compressed air: comparison between experimental and
// theoretical analysis", Transactions on Engineering Sciences vol 18,
// ISSN 1743-35331998, 1998.
// Volume flow rate
// Temperature
final double T = conditions.getAtmosphericConditions().getTemperature();
// Volume flow rate (t)
final double Q = conditions.getVelocity() * innerArea;
// pressure drop
deltap = 1.6 * Math.pow(Q, 1.85) * length /
(Math.pow(diameter, 5) * conditions.getAtmosphericConditions().getPressure());
// Reynolds number (note Reynolds number for the interior of a pipe is based on diameter,
// not length (t))
final double Re = conditions.getVelocity() * diameter /
conditions.getAtmosphericConditions().getKinematicViscosity();
// friction coefficient (for smooth tube interior) (e)
final double lambda = 1/MathUtil.pow2(2 * Math.log(0.5625 * Math.pow(Re, 0.875)) - 0.8);
// pressure drop (e)
final double P0 = 100; // standard pressure
final double T0 = 273.15; // standard temperature
deltap = (lambda * 8 * length * rho * MathUtil.pow2(Q) * T * P0) /
(MathUtil.pow2(Math.PI) * Math.pow(diameter, 5) * T0 * conditions.getAtmosphericConditions().getPressure());
} else {
deltap = 0.0;
}
// convert to CD and return
return (deltap * innerArea + stagnationCD * frontalArea) / conditions.getRefArea();
return (deltap * innerArea + 0.7 * stagnationCD * frontalArea) / conditions.getRefArea();
}
}

View File

@ -101,9 +101,9 @@ public class TubeFinSetCalc extends TubeCalc {
// body tube, only consider the other half of the area
final double outerArea = tubes.getLength() * Math.PI * tubes.getOuterRadius();
// Surface area of the portion of the body tube masked by the tube fins
// Surface area of the portion of the body tube masked by the tube fins, per tube
final BodyTube parent = (BodyTube) tubes.getParent();
final double maskedArea = tubes.getLength() * 2.0 * Math.PI * parent.getOuterRadius();
final double maskedArea = tubes.getLength() * 2.0 * Math.PI * parent.getOuterRadius() / tubes.getFinCount();
wettedArea = outerArea - maskedArea;
log.debug("wetted area of tube fins " + wettedArea);