Clean up imports.
This commit is contained in:
parent
db286c3293
commit
faf5f12d27
@ -2,9 +2,6 @@ package net.sf.openrocket.simulation;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.sf.openrocket.aerodynamics.AerodynamicForces;
|
||||
import net.sf.openrocket.aerodynamics.FlightConditions;
|
||||
import net.sf.openrocket.aerodynamics.WarningSet;
|
||||
import net.sf.openrocket.motor.MotorInstanceConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.Configuration;
|
||||
import net.sf.openrocket.rocketcomponent.FinSet;
|
||||
@ -13,14 +10,14 @@ import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.rocketcomponent.SymmetricComponent;
|
||||
|
||||
public class BasicTumbleStatus extends SimulationStatus {
|
||||
|
||||
|
||||
// Magic constants from techdoc.pdf
|
||||
private final static double cDFin = 1.42;
|
||||
private final static double cDBt = 0.56;
|
||||
// Fin efficiency. Index is number of fins. The 0th entry is arbitrary and used to
|
||||
// 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 double drag;
|
||||
|
||||
public BasicTumbleStatus(Configuration configuration,
|
||||
@ -29,21 +26,21 @@ public class BasicTumbleStatus extends SimulationStatus {
|
||||
super(configuration, motorConfiguration, simulationConditions);
|
||||
computeTumbleDrag();
|
||||
}
|
||||
|
||||
|
||||
public BasicTumbleStatus(SimulationStatus orig) {
|
||||
super(orig);
|
||||
if ( orig instanceof BasicTumbleStatus ) {
|
||||
if (orig instanceof BasicTumbleStatus) {
|
||||
this.drag = ((BasicTumbleStatus) orig).drag;
|
||||
}
|
||||
}
|
||||
|
||||
public double getTumbleDrag( ) {
|
||||
|
||||
public double getTumbleDrag() {
|
||||
return drag;
|
||||
}
|
||||
|
||||
|
||||
public void computeTumbleDrag() {
|
||||
|
||||
|
||||
// Computed based on Sampo's experimentation as documented in the pdf.
|
||||
|
||||
// compute the fin and body tube projected areas
|
||||
@ -51,27 +48,27 @@ public class BasicTumbleStatus extends SimulationStatus {
|
||||
double aBt = 0.0;
|
||||
Rocket r = this.getConfiguration().getRocket();
|
||||
Iterator<RocketComponent> componentIterator = r.iterator();
|
||||
while ( componentIterator.hasNext() ) {
|
||||
while (componentIterator.hasNext()) {
|
||||
RocketComponent component = componentIterator.next();
|
||||
if ( ! component.isAerodynamic() ) {
|
||||
if (!component.isAerodynamic()) {
|
||||
continue;
|
||||
}
|
||||
if ( component instanceof FinSet ) {
|
||||
if (component instanceof FinSet) {
|
||||
|
||||
double finComponent = ((FinSet)component).getFinArea();
|
||||
int finCount = ((FinSet)component).getFinCount();
|
||||
double finComponent = ((FinSet) component).getFinArea();
|
||||
int finCount = ((FinSet) component).getFinCount();
|
||||
// check bounds on finCount.
|
||||
if ( finCount >= finEff.length ) {
|
||||
finCount = finEff.length-1;
|
||||
if (finCount >= finEff.length) {
|
||||
finCount = finEff.length - 1;
|
||||
}
|
||||
|
||||
aFins += finComponent * finEff[finCount];
|
||||
|
||||
} else if (component instanceof SymmetricComponent ){
|
||||
aBt += ((SymmetricComponent) component) .getComponentPlanformArea();
|
||||
} else if (component instanceof SymmetricComponent) {
|
||||
aBt += ((SymmetricComponent) component).getComponentPlanformArea();
|
||||
}
|
||||
}
|
||||
|
||||
drag = ( cDFin * aFins + cDBt * aBt );
|
||||
drag = (cDFin * aFins + cDBt * aBt);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user