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

Lin: CalcSteady, forcing linearization at end of simulation #958

Merged
merged 5 commits into from
Feb 15, 2022

Conversation

ebranlard
Copy link
Contributor

@ebranlard ebranlard commented Jan 5, 2022

This pull request is ready to be merged

Feature or improvement description
Perform linearization at end of simulation if no steady state is found. Only one linearization is done at the final time step.

Impacted areas of the software
OpenFAST-library / linearization

Additional supporting information
At times, the trim algorithm does not find a steady state. This might indicate an issue in the model or in the algorithm itself. It is yet slightly unfortunate if no linearization occurs even if the user specify a large TMax.

A warning is displayed and it's the user responsibility to check that the linearization occur at a somehow close to periodic steady state.

Copy link
Collaborator

@jjonkman jjonkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally OK. Please find two comments below.

@@ -5346,6 +5351,12 @@ SUBROUTINE FAST_CalcSteady( n_t_global, t_global, p_FAST, y_FAST, m_FAST, ED, BD
m_FAST%Lin%AzimIndx = 1
m_FAST%Lin%CopyOP_CtrlCode = MESH_UPDATECOPY
end if
! Forcing linearization if time is close to tmax
if ((t_global> p_FAST%TMax - 1.5*TwoPi_D/ED%y%RotSpeed) .and. .not.m_FAST%Lin%FoundSteady) then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the 1.5 come from? And I'm concerned that if the rotor speed is varying a lot during the trim solution, this condition may be met before the tail end of a simulation. It would probably be better to use the initial rotor speed, which is the target rotor speed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now replaced it with the Init rotor speed (this was a quick hack at first).

I do need a margin, and it seems that the margin is actually 2 revolutions. The problem is that the condition is triggered right after the first target azimuth, it then has to wait until the next target azimuth is reached (which takes one revolution), and then perform the saving of operating points (over one revolution). This is not ideal, but should be fine before we have a steady-state solve.

if ((t_global> p_FAST%TMax - 1.5*TwoPi_D/ED%y%RotSpeed) .and. .not.m_FAST%Lin%FoundSteady) then
call WrScr('')
call WrScr('[WARNING] Steady state not found before end of simulation. Forcing linearization')
m_FAST%Lin%ForceLin = .True.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you also warn that the linearized model may not be sufficiently representative of the solution in steady state?

Copy link
Contributor Author

@ebranlard ebranlard Jan 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now added a final warning at the end of the simulation.

@ebranlard
Copy link
Contributor Author

I've added some conditions so that the forced linearization occurs in "reasonable" circumstances, to avoid misusages. It should also work for a 0 rotational speed.

Copy link
Collaborator

@jjonkman jjonkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that a steady-state solution was never found, I would suggest simplifying the linearization by only forcing one linearization at the end of the simulation (as if, NLinTimes = 1 with LinTimes = TMax, rather than trying to linearize about a full rotor revolution). This would simplify the logic and given that the linearized matrices may not be representative anyway, it probably doesn't matter that a full periodic set of linearized matrices was not generated.

Copy link
Collaborator

@jjonkman jjonkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks,

@ebranlard
Copy link
Contributor Author

Doing only one linearization makes sense (I need to change lintime to 1). It will also be easy for the user to notice since less lin files are present. I've made the change now.

@rafmudaf rafmudaf merged commit c92f5fe into OpenFAST:dev Feb 15, 2022
@rafmudaf rafmudaf mentioned this pull request Mar 2, 2022
11 tasks
@ebranlard ebranlard deleted the f/forcelin branch March 12, 2022 03:07
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.

3 participants