Don't let fins with zero area cause NaN exceptions.
This commit is contained in:
parent
512ce78b51
commit
1011f2df94
@ -86,7 +86,7 @@ public class FinSetCalc extends RocketComponentCalc {
|
|||||||
|
|
||||||
warnings.addAll(geometryWarnings);
|
warnings.addAll(geometryWarnings);
|
||||||
|
|
||||||
if (span < 0.001) {
|
if (finArea < MathUtil.EPSILON) {
|
||||||
forces.setCm(0);
|
forces.setCm(0);
|
||||||
forces.setCN(0);
|
forces.setCN(0);
|
||||||
forces.setCNa(0);
|
forces.setCNa(0);
|
||||||
@ -618,6 +618,11 @@ public class FinSetCalc extends RocketComponentCalc {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double calculateFrictionCD(FlightConditions conditions, double componentCf, WarningSet warnings) {
|
public double calculateFrictionCD(FlightConditions conditions, double componentCf, WarningSet warnings) {
|
||||||
|
// a fin with 0 area contributes no drag
|
||||||
|
if (finArea < MathUtil.EPSILON) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
double cd = componentCf * (1 + 2 * thickness / macLength) * 2 * finArea / conditions.getRefArea();
|
double cd = componentCf * (1 + 2 * thickness / macLength) * 2 * finArea / conditions.getRefArea();
|
||||||
return cd;
|
return cd;
|
||||||
}
|
}
|
||||||
@ -626,6 +631,11 @@ public class FinSetCalc extends RocketComponentCalc {
|
|||||||
public double calculatePressureCD(FlightConditions conditions,
|
public double calculatePressureCD(FlightConditions conditions,
|
||||||
double stagnationCD, double baseCD, WarningSet warnings) {
|
double stagnationCD, double baseCD, WarningSet warnings) {
|
||||||
|
|
||||||
|
// a fin with 0 area contributes no drag
|
||||||
|
if (finArea < MathUtil.EPSILON) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
double mach = conditions.getMach();
|
double mach = conditions.getMach();
|
||||||
double cd = 0;
|
double cd = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user