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