Convert BasicTumbleStepper and BasicTumbleStatus to use CD instead of drag
(for consistency with everywhere else)
This commit is contained in:
parent
905f79dfe1
commit
b6aaa3857a
@ -21,29 +21,29 @@ public class BasicTumbleStatus extends SimulationStatus {
|
||||
// offset the indexes so finEff[1] is the coefficient for one fin from the table in techdoc.pdf
|
||||
private final static double[] finEff = { 0.0, 0.5, 1.0, 1.41, 1.81, 1.73, 1.90, 1.85 };
|
||||
|
||||
private final double drag;
|
||||
private final double cd;
|
||||
|
||||
public BasicTumbleStatus(FlightConfiguration configuration,
|
||||
SimulationConditions simulationConditions) {
|
||||
super(configuration, simulationConditions);
|
||||
this.drag = computeTumbleDrag();
|
||||
this.cd = computeTumbleCD();
|
||||
}
|
||||
|
||||
public BasicTumbleStatus(SimulationStatus orig) {
|
||||
super(orig);
|
||||
if (orig instanceof BasicTumbleStatus) {
|
||||
this.drag = ((BasicTumbleStatus) orig).drag;
|
||||
this.cd = ((BasicTumbleStatus) orig).cd;
|
||||
} else {
|
||||
this.drag = computeTumbleDrag();
|
||||
this.cd = computeTumbleCD();
|
||||
}
|
||||
}
|
||||
|
||||
public double getTumbleDrag() {
|
||||
return drag;
|
||||
public double getCD() {
|
||||
return cd;
|
||||
}
|
||||
|
||||
|
||||
private double computeTumbleDrag() {
|
||||
private double computeTumbleCD() {
|
||||
|
||||
// Computed based on Sampo's experimentation as documented in the pdf.
|
||||
|
||||
@ -80,6 +80,6 @@ public class BasicTumbleStatus extends SimulationStatus {
|
||||
}
|
||||
}
|
||||
|
||||
return (cDFin * aFins + cDBt * aBt);
|
||||
return (cDFin * aFins + cDBt * aBt)/getConfiguration().getReferenceArea();
|
||||
}
|
||||
}
|
||||
|
@ -33,11 +33,11 @@ public class BasicTumbleStepper extends AbstractSimulationStepper {
|
||||
// Get total CD
|
||||
double mach = airSpeed.length() / atmosphere.getMachSpeed();
|
||||
|
||||
double tumbleDrag = ((BasicTumbleStatus)status).getTumbleDrag();
|
||||
double tumbleCD = ((BasicTumbleStatus)status).getCD();
|
||||
|
||||
// Compute drag force
|
||||
double dynP = (0.5 * atmosphere.getDensity() * airSpeed.length2());
|
||||
double dragForce = tumbleDrag * dynP;
|
||||
double dragForce = status.getConfiguration().getReferenceArea() * tumbleCD * dynP;
|
||||
|
||||
// n.b. this is constant, and could be calculated once at the beginning of this simulation branch...
|
||||
double rocketMass = calculateStructureMass(status).getMass();
|
||||
|
Loading…
x
Reference in New Issue
Block a user