[test] expands aerodynamics unit-test to verify CP.y, and .z coordinates (of fins on boosters)
This commit is contained in:
parent
c5733b9b68
commit
055132aa99
@ -15,12 +15,12 @@ import net.sf.openrocket.ServicesForTesting;
|
|||||||
import net.sf.openrocket.plugin.PluginModule;
|
import net.sf.openrocket.plugin.PluginModule;
|
||||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||||
import net.sf.openrocket.rocketcomponent.BodyTube;
|
import net.sf.openrocket.rocketcomponent.BodyTube;
|
||||||
import net.sf.openrocket.rocketcomponent.FinSet;
|
|
||||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||||
import net.sf.openrocket.rocketcomponent.NoseCone;
|
import net.sf.openrocket.rocketcomponent.NoseCone;
|
||||||
import net.sf.openrocket.rocketcomponent.ParallelStage;
|
import net.sf.openrocket.rocketcomponent.ParallelStage;
|
||||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||||
import net.sf.openrocket.rocketcomponent.Transition;
|
import net.sf.openrocket.rocketcomponent.Transition;
|
||||||
|
import net.sf.openrocket.rocketcomponent.TrapezoidFinSet;
|
||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
import net.sf.openrocket.util.Coordinate;
|
import net.sf.openrocket.util.Coordinate;
|
||||||
import net.sf.openrocket.util.TestRockets;
|
import net.sf.openrocket.util.TestRockets;
|
||||||
@ -111,18 +111,38 @@ public class BarrowmanCalculatorTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCPDoubleStrapOn() {
|
public void testCPDoubleStrapOn() {
|
||||||
Rocket rocket = TestRockets.makeFalcon9Heavy();
|
final Rocket rocket = TestRockets.makeFalcon9Heavy();
|
||||||
FlightConfiguration config = rocket.getSelectedConfiguration();
|
final ParallelStage boosterStage = (ParallelStage) rocket.getChild(1).getChild(0).getChild(0);
|
||||||
BarrowmanCalculator calc = new BarrowmanCalculator();
|
final TrapezoidFinSet boosterFins = (TrapezoidFinSet) boosterStage.getChild(1).getChild(1);
|
||||||
FlightConditions conditions = new FlightConditions(config);
|
final FlightConfiguration config = rocket.getSelectedConfiguration();
|
||||||
WarningSet warnings = new WarningSet();
|
final BarrowmanCalculator calc = new BarrowmanCalculator();
|
||||||
|
final FlightConditions conditions = new FlightConditions(config);
|
||||||
|
final WarningSet warnings = new WarningSet();
|
||||||
|
|
||||||
double expCPx = 1.04662388;
|
{
|
||||||
double expCNa = 21.5111598;
|
boosterFins.setFinCount(3);
|
||||||
Coordinate calcCP = calc.getCP(config, conditions, warnings);
|
final Coordinate cp_3fin = calc.getCP(config, conditions, warnings);
|
||||||
|
assertEquals(" Falcon 9 Heavy CNa value is incorrect:", 21.5111598, cp_3fin.weight, EPSILON);
|
||||||
assertEquals(" Falcon 9 Heavy CP x value is incorrect:", expCPx, calcCP.x, EPSILON);
|
assertEquals(" Falcon 9 Heavy CP x value is incorrect:", 1.04662388, cp_3fin.x, EPSILON);
|
||||||
assertEquals(" Falcon 9 Heavy CNa value is incorrect:", expCNa, calcCP.weight, EPSILON);
|
assertEquals(" Falcon 9 Heavy CP y value is incorrect:", 0.0, cp_3fin.y, EPSILON);
|
||||||
|
assertEquals(" Falcon 9 Heavy CP z value is incorrect:", 0.0, cp_3fin.z, EPSILON);
|
||||||
|
}{
|
||||||
|
boosterFins.setFinCount(2);
|
||||||
|
final Coordinate cp_2fin = calc.getCP(config, conditions, warnings);
|
||||||
|
assertEquals(" Falcon 9 Heavy CNa value is incorrect:", 15.43711197, cp_2fin.weight, EPSILON);
|
||||||
|
assertEquals(" Falcon 9 Heavy CP x value is incorrect:", 0.99464238, cp_2fin.x, EPSILON);
|
||||||
|
assertEquals(" Falcon 9 Heavy CP y value is incorrect:", 0.0, cp_2fin.y, EPSILON);
|
||||||
|
assertEquals(" Falcon 9 Heavy CP z value is incorrect:", 0.0, cp_2fin.z, EPSILON);
|
||||||
|
}{
|
||||||
|
boosterFins.setFinCount(1);
|
||||||
|
final Coordinate cp_1fin = calc.getCP(config, conditions, warnings);
|
||||||
|
assertEquals(" Falcon 9 Heavy CNa value is incorrect:", 9.36306412, cp_1fin.weight, EPSILON);
|
||||||
|
assertEquals(" Falcon 9 Heavy CP x value is incorrect:", 0.87521867, cp_1fin.x, EPSILON);
|
||||||
|
assertEquals(" Falcon 9 Heavy CP y value is incorrect:", 0.08564455, cp_1fin.y, EPSILON);
|
||||||
|
assertEquals(" Falcon 9 Heavy CP z value is incorrect:", 0.01766062, cp_1fin.z, EPSILON);
|
||||||
|
}{
|
||||||
|
// absent -- 3.28901627g @[0.31469937,0.05133333,0.00000000]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -152,7 +172,6 @@ public class BarrowmanCalculatorTest {
|
|||||||
assertTrue("Estes Alpha III should be continous: ", calc.isContinuous( rocket));
|
assertTrue("Estes Alpha III should be continous: ", calc.isContinuous( rocket));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testContinuousRocketWithStrapOns() {
|
public void testContinuousRocketWithStrapOns() {
|
||||||
Rocket rocket = TestRockets.makeFalcon9Heavy();
|
Rocket rocket = TestRockets.makeFalcon9Heavy();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user