From c9de2085f95bdf8bafcc2053ec6f408ddd0b3160 Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Wed, 14 Dec 2022 14:38:38 -0700 Subject: [PATCH] add transonic warning --- core/resources/l10n/messages.properties | 2 +- core/src/net/sf/openrocket/aerodynamics/Warning.java | 2 ++ .../openrocket/aerodynamics/barrowman/RailButtonCalc.java | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index c63e110ca..459cc134b 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -1865,7 +1865,7 @@ Warning.TUBE_SEPARATION = Space between tube fins may not result in accurate sim Warning.TUBE_OVERLAP = Overlapping tube fins may not result in accurate simulations. Warning.EMPTY_BRANCH = Simulation branch contains no data Warning.SEPARATION_ORDER = Stages separated in an unreasonable order - +Warning.RAILBUTTON_TRANSONIC = Railbutton drag calculations may be inaccurate at transonic or supersonic speeds ! Scale dialog ScaleDialog.lbl.scaleRocket = Entire rocket ScaleDialog.lbl.scaleSubselection = Selection and all subcomponents diff --git a/core/src/net/sf/openrocket/aerodynamics/Warning.java b/core/src/net/sf/openrocket/aerodynamics/Warning.java index ae7c94e35..2a3ff0eff 100644 --- a/core/src/net/sf/openrocket/aerodynamics/Warning.java +++ b/core/src/net/sf/openrocket/aerodynamics/Warning.java @@ -399,4 +399,6 @@ public abstract class Warning { public static final Warning SEPARATION_ORDER = new Other(trans.get("Warning.SEPARATION_ORDER")); public static final Warning EMPTY_BRANCH = new Other(trans.get("Warning.EMPTY_BRANCH")); + + public static final Warning RAILBUTTON_TRANSONIC = new Other(trans.get("Warning.RAILBUTTON_TRANSONIC")); } diff --git a/core/src/net/sf/openrocket/aerodynamics/barrowman/RailButtonCalc.java b/core/src/net/sf/openrocket/aerodynamics/barrowman/RailButtonCalc.java index 301566346..d5b095b11 100644 --- a/core/src/net/sf/openrocket/aerodynamics/barrowman/RailButtonCalc.java +++ b/core/src/net/sf/openrocket/aerodynamics/barrowman/RailButtonCalc.java @@ -2,6 +2,7 @@ package net.sf.openrocket.aerodynamics.barrowman; import net.sf.openrocket.aerodynamics.AerodynamicForces; import net.sf.openrocket.aerodynamics.FlightConditions; +import net.sf.openrocket.aerodynamics.Warning; import net.sf.openrocket.aerodynamics.WarningSet; import net.sf.openrocket.rocketcomponent.RailButton; import net.sf.openrocket.rocketcomponent.RocketComponent; @@ -44,7 +45,12 @@ public class RailButtonCalc extends RocketComponentCalc { // I expect we'll have compressibility effects having an impact well below that, so this is probably good up // to the transonic regime. double CDmul = 1.2; - + + // warn the user about accuracy if we're transonic (roughly Mach 0.8) or faster + if (conditions.getMach() > 0.8) { + warnings.add(Warning.RAILBUTTON_TRANSONIC); + } + return CDmul*stagnationCD * refArea / conditions.getRefArea(); } }