Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in BD linearization resulting from reference rotation change #2063

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

deslaughter
Copy link
Contributor

@deslaughter deslaughter commented Mar 1, 2024

This pull request is ready to be merged

Feature or improvement description

This PR fixes a bug in the BeamDyn Jacobian calculations related to rotating the states. When RotStates (input file) and ChangeRefFrame (BeamDyn.f90) were both True, the state Jacobians were rotated by the wrong amount leading to incorrect linearization results. This has been updated by setting RotStates to True when ChangeRefFrame is True and updating the way the difference in rotation is calculated for rotating the state Jacobians.

Impacted areas of the software

BeamDyn.f90

Additional supporting information

When the change in reference frame was implemented in v3.5.0, it effectively changed the states to be in the rotating frame. The existing method for putting the state Jacobians into the rotating frame involved calculating the difference in rotation between the root mesh reference orientation and the root mesh current orientation. Originally, the reference orientation always aligned with the blade root reference orientation inside BeamDyn. However, this is not a valid assumption when ChangeRefFrame = .true. as the blade root reference is updated by UpdateStates at every step.

This commit changes two things: first, if ChangeRefFrame is true, then p%RotStates is also set to true because the states are in the rotating frame; second, the Jacobian is now rotated by the difference between the root mesh current orientation and BeamDyn's root reference orientation. These orientations will be the same after UpdateStates, but the correction is still applied in case the Jacobian routines are called with a different root mesh orientation.

Test results, if applicable

This PR changes the 5MW_Land_BD_Linear regression test to linearize at 1 second instead of 0 so the blades have a chance to move away from their reference position/orientation. This issue was not discovered sooner because the tests passed since there was no difference between the root orientation and the reference orientation. The results for 5MW_Land_BD_Linear_Aero also changed now that BeamDyn is producing the correct Jacobians.

When the change in reference rotation was implemented in v3.5.0, it effectively changed the states to be in the rotating frame. The existing method for putting the state Jacobians into the rotating frame involved calculating the difference in rotation between the root mesh reference orientation and the root mesh current orientation. Originally, the reference orientation always aligned with the blade root reference orientation inside BeamDyn. However, this is not a valid assumption when ChangeRefFrame = .true. as the blade root reference is updated by UpdateStates at every step.

This commit changes two things: first, if ChangeRefFrame is true, then p%RotStates is also set to true because the states are in the rotating frame; second, the Jacobian is now rotated by the difference between the root mesh current orientation and BeamDyn's root reference orientation. These orientations will be the same after UpdateStates, but the correction is still applied in case the Jacobian routines are called with a different root mesh orientation.
@andrew-platt andrew-platt merged commit e5a3bbd into OpenFAST:rc-3.5.3 Mar 4, 2024
19 checks passed
@andrew-platt andrew-platt mentioned this pull request Mar 26, 2024
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants