Merge pull request #1949 from JoePfeiffer/fix-1910

Consider number of parachutes in landing drag calculation
This commit is contained in:
Billy Olsen 2023-01-05 14:46:22 -07:00 committed by GitHub
commit 96bc101b02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
package net.sf.openrocket.simulation;
import net.sf.openrocket.models.atmosphere.AtmosphericConditions;
import net.sf.openrocket.rocketcomponent.InstanceMap;
import net.sf.openrocket.rocketcomponent.RecoveryDevice;
import net.sf.openrocket.simulation.exception.SimulationException;
import net.sf.openrocket.util.Coordinate;
@ -35,8 +36,10 @@ public class BasicLandingStepper extends AbstractSimulationStepper {
// Get total CD
double mach = airSpeed.length() / atmosphere.getMachSpeed();
final InstanceMap imap = status.getConfiguration().getActiveInstances();
for (RecoveryDevice c : status.getDeployedRecoveryDevices()) {
totalCD += c.getCD(mach) * c.getArea() / refArea;
totalCD += imap.count(c) * c.getCD(mach) * c.getArea() / refArea;
}
// Compute drag force