Merge pull request #1328 from JoePfeiffer/fix-1325

On second thought, I think I can do better than this.
This commit is contained in:
Joe Pfeiffer 2022-05-04 10:53:17 -06:00 committed by GitHub
commit f45e2c36c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 12 deletions

View File

@ -1759,7 +1759,6 @@ Warning.ZERO_RADIUS_BODY = Zero length bodies may not result in accurate simulat
Warning.TUBE_STABILITY = Tube fin stability calculations may not be accurate. Warning.TUBE_STABILITY = Tube fin stability calculations may not be accurate.
Warning.TUBE_SEPARATION = Space between tube fins may not result in accurate simulations. Warning.TUBE_SEPARATION = Space between tube fins may not result in accurate simulations.
Warning.TUBE_OVERLAP = Overlapping tube fins may not result in accurate simulations. Warning.TUBE_OVERLAP = Overlapping tube fins may not result in accurate simulations.
Warning.ZERO_INNER_RADIUS = Tube with inner radius 0 may not result in accurate simulations.
! Scale dialog ! Scale dialog
ScaleDialog.lbl.scaleRocket = Entire rocket ScaleDialog.lbl.scaleRocket = Entire rocket

View File

@ -395,5 +395,4 @@ public abstract class Warning {
public static final Warning TUBE_STABILITY = new Other(trans.get("Warning.TUBE_STABILITY")); public static final Warning TUBE_STABILITY = new Other(trans.get("Warning.TUBE_STABILITY"));
public static final Warning TUBE_SEPARATION = new Other(trans.get("Warning.TUBE_SEPARATION")); public static final Warning TUBE_SEPARATION = new Other(trans.get("Warning.TUBE_SEPARATION"));
public static final Warning TUBE_OVERLAP = new Other(trans.get("Warning.TUBE_OVERLAP")); public static final Warning TUBE_OVERLAP = new Other(trans.get("Warning.TUBE_OVERLAP"));
public static final Warning ZERO_INNER_RADIUS = new Other(trans.get("Warning.ZERO_INNER_RADIUS"));
} }

View File

@ -1,7 +1,6 @@
package net.sf.openrocket.aerodynamics.barrowman; package net.sf.openrocket.aerodynamics.barrowman;
import net.sf.openrocket.aerodynamics.FlightConditions; import net.sf.openrocket.aerodynamics.FlightConditions;
import net.sf.openrocket.aerodynamics.Warning;
import net.sf.openrocket.aerodynamics.WarningSet; import net.sf.openrocket.aerodynamics.WarningSet;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.rocketcomponent.Tube; import net.sf.openrocket.rocketcomponent.Tube;
@ -35,16 +34,10 @@ public abstract class TubeCalc extends RocketComponentCalc {
// Volume flow rate // Volume flow rate
final double Q = conditions.getVelocity() * refArea; final double Q = conditions.getVelocity() * refArea;
// pressure drop. // pressure drop
final double deltap; final double deltap = 1.6 * Math.pow(Q, 1.85) * length /
if (refArea == 0) {
warnings.add(Warning.ZERO_INNER_RADIUS);
deltap = 0;
} else {
deltap = 1.6 * Math.pow(Q, 1.85) * length /
(Math.pow(diameter, 5) * conditions.getAtmosphericConditions().getPressure()); (Math.pow(diameter, 5) * conditions.getAtmosphericConditions().getPressure());
}
// convert to CD and return // convert to CD and return
return deltap * refArea / conditions.getRefArea(); return deltap * refArea / conditions.getRefArea();
} }