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

Enhanced linear solver #196

Merged
merged 170 commits into from Jun 15, 2022
Merged

Enhanced linear solver #196

merged 170 commits into from Jun 15, 2022

Conversation

ngoiz
Copy link
Collaborator

@ngoiz ngoiz commented May 10, 2022

Numerous additions and improvements to the SHARPy linear solver. A big PR, but hopefully it will be worth it

New features

  • State-space variable tracker. Keeps track of state-space variables (inputs, outputs and states), showing as the system is modified by new gains or projections, how the input and output channels evolve. This is implemented in the sharpy.linear.src.libss.StateSpace and sharpy.linear.src.libss.Gain classes, using the variable tracker features developed in sharpy.linear.utils.ss_interface. Recommended for all new developments using state-spaces and gains.

  • Stability derivatives post-processor. Detail settings here

  • New linear gusts. Support for single, span-wise constant input (LeadingEdge). Spanwise varying gusts supported through MultiLeadingEdge gust. This is done using interpolation from gust "monitoring-stations", that keep track of the convection of the gust onto the lattice vertices.

  • Enhanced LinDynamicSim solver with easier input settings. May present a few issues but in general it is working, although linear time domain simulations are not the stronghold of SHARPy

  • Can convert linear UVLM to continuous time and assemble the aeroelastic state-space in CT as well

Other changes

Initial rework on LinearVector to improve tracking on linear variables as the state-space changes size.
Another major overhaul. Methods adjusted to check for the type of variable. Variables made properties of the SS object and checks implemented in the ss.series() method
Variables were not being deep copied, causing trouble
ngoiz and others added 10 commits May 10, 2022 17:04
Since PRs require a successful test run and our workflow only runs if python files, submodules or test files are changed, it could be the case that for a PR that only changes docs (for example), the status could be left as pending.

Therefore, this test runs when a PR is opened and no changes are made to these files, thus reporting a successful test that allows the merger
Update AsymptoticStability and FrequencyResponse post-processors
@@ -14,6 +14,7 @@
import sharpy.utils.cout_utils as cout
import sharpy.structure.utils.modalutils as modalutils
import warnings
from sharpy.linear.utils.ss_interface import LinearVector, StateVariable, OutputVariable, InputVariable


class FlexDynamic():
Copy link
Collaborator

Choose a reason for hiding this comment

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

How well the linearisation plays with the polars corrections in the aero? It should be all right since the linearised external forcing terms are taken from the .structure.steady_app_forces which includes those...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A few things are missing, yes, the steady forces with the corrections are included but these only appear in the stiffening and damping terms added to the UVLM (i.e. geometric effects only). The UVLM matrices would be missing the updated-with-polar circulation at the ref state.

The other correction is done on the output of the aeroelastic system, with the polars being modified in stability axes to change the lift only at this stage. I just realised I have this elsewhere so I'll merge it in a separate PR in a second.

This is Sec 4.1.1 and Ch8 further work of my thesis :)

@@ -121,3 +121,55 @@ def span_chord(i_node_surf, zeta):
dir_chord = algebra.unit_vector(dir_chord)

return dir_span, span, dir_chord, chord


def find_aerodynamic_solver(settings):
Copy link
Collaborator

@ACea15 ACea15 May 18, 2022

Choose a reason for hiding this comment

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

This is amendable for a general solution:
solver_interface.dictionary_of_solvers -> to give you the solvers or even solver_interface.solver_from_string(solver) such that looping over the solvers in flow you can directly get the classification:
if solver_i.solver_classification == 'Aero':
... (same structure as in the code)
elif solver_i.solver_classification == 'Coupled:
...

Worthy? Only if more solvers are to be added in the equilibrium solution. But it shows off the nice possibilities of the solvers class!!


return self.data

def get_freestream_velocity(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't be the same one that u_inf in settings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but a few quirks are needed in the case of restarted solutions, because the settings may have not been parsed and thus are still strings

Copy link
Collaborator

@ACea15 ACea15 left a comment

Choose a reason for hiding this comment

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

Very good stuff, see if some of the comments are worth a quick update and let's merge!

@ngoiz ngoiz marked this pull request as ready for review June 15, 2022 10:10
@ngoiz ngoiz merged commit 5a2f22e into develop Jun 15, 2022
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.

None yet

5 participants