Skip to content

Conversation

@JoePfeiffer
Copy link
Contributor

@JoePfeiffer JoePfeiffer commented Mar 17, 2023

The underlying problem causing issue #2118 is that the base drag calculation loop in BarrowmanCalculator compares each SymmetricComponent's forward radius to the preceding component's aft radius, and then calculates the preceding component's base drag. In addition to requiring a special case for the final SymmetricComponent, it's also unclear which resulted in the bug.

This PR rewrites that loop, so each SymmetricComponent compares its aft radius to the forward radius of the component behind it, and sets its own base CD. This reduces the special case handling to just noticing whether there is no next component and treating its forward radius as 0 if not, and also fixes #2118.

Also adds a unit test.

@hcraigmiller
Copy link
Collaborator

Functions as described with no anomalous behavior found.

OR Build: 1620
Windows 11 Pro; Version 22H2; Build 22621.1265; Windows Feature Experience Pack 1000.22638.1000.0
Java version "11.0.18" 2023-01-17 LTS; Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)

@JoePfeiffer JoePfeiffer merged commit f26d0cb into openrocket:unstable Mar 24, 2023
@JoePfeiffer JoePfeiffer deleted the fix-base-drag-take-2 branch July 3, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Setting CD override on a SymmetricComponent sets base CD of preceding component to 0

2 participants