[fix][simulation] Adds 2 warnings about fins on Phantom-Bodies

This commit is contained in:
Daniel_M_Williams 2020-05-17 18:29:45 -04:00
parent 93e34c47d8
commit 530744d4cc
3 changed files with 19 additions and 5 deletions

View File

@ -1695,6 +1695,8 @@ Warning.RECOVERY_LAUNCH_ROD = Recovery device device deployed while on the launc
Warning.RECOVERY_HIGH_SPEED = Recovery device deployment at high speed
Warning.TUMBLE_UNDER_THRUST = Stage began to tumble under thrust.
Warning.EVENT_AFTER_LANDING = Flight Event occurred after landing:
Warning.ZERO_LENGTH_BODY = Zero length bodies may not result in accurate simulations.
Warning.ZERO_RADIUS_BODY = Zero length bodies may not result in accurate simulations.
! Scale dialog
ScaleDialog.lbl.scaleRocket = Entire rocket

View File

@ -380,7 +380,7 @@ public abstract class Warning {
public static final Warning FILE_INVALID_PARAMETER = new Other(trans.get("Warning.FILE_INVALID_PARAMETER"));
public static final Warning PARALLEL_FINS = new Other(trans.get("Warning.PARALLEL_FINS"));
public static final Warning SUPERSONIC = new Other(trans.get("Warning.SUPERSONIC"));
public static final Warning RECOVERY_LAUNCH_ROD = new Other(trans.get("Warning.RECOVERY_LAUNCH_ROD"));
@ -388,5 +388,8 @@ public abstract class Warning {
public static final Warning TUMBLE_UNDER_THRUST = new Other(trans.get("Warning.TUMBLE_UNDER_THRUST"));
public static final Warning EVENT_AFTER_LANDING = new Other(trans.get("Warning.EVENT_AFTER_LANDING"));
public static final Warning ZERO_LENGTH_BODY = new Other(trans.get("Warning.ZERO_LENGTH_BODY"));
public static final Warning ZERO_RADIUS_BODY = new Other(trans.get("Warning.ZERO_RADIUS_BODY"));
}

View File

@ -1,6 +1,7 @@
package net.sf.openrocket.aerodynamics.barrowman;
import static java.lang.Math.pow;
import static net.sf.openrocket.util.MathUtil.EPSILON;
import static net.sf.openrocket.util.MathUtil.pow2;
import java.util.Arrays;
@ -48,6 +49,7 @@ public class FinSetCalc extends RocketComponentCalc {
private final double thickness;
private final double bodyRadius;
private final double bodyLength;
private final int finCount;
private final double cantAngle;
private final FinSet.CrossSection crossSection;
@ -64,6 +66,7 @@ public class FinSetCalc extends RocketComponentCalc {
FinSet fin = (FinSet) component;
thickness = fin.getThickness();
bodyLength = component.getParent().getLength();
bodyRadius = fin.getBodyRadius();
finCount = fin.getFinCount();
@ -97,9 +100,15 @@ public class FinSetCalc extends RocketComponentCalc {
forces.setCyaw(0);
return;
}
// Add warnings (radius/2 == diameter/4)
if( (0 < bodyRadius) && (thickness > bodyRadius / 2)){
if((EPSILON > bodyLength)) {
// Add warnings: Phantom Body
warnings.add(Warning.ZERO_LENGTH_BODY);
}else if((EPSILON > bodyRadius)){
// Add warnings: Phantom Body
warnings.add(Warning.ZERO_RADIUS_BODY);
}else if( (0 < bodyRadius) && (thickness > bodyRadius / 2)){
// Add warnings (radius/2 == diameter/4)
warnings.add(Warning.THICK_FIN);
}
warnings.addAll(geometryWarnings);