-
Notifications
You must be signed in to change notification settings - Fork 849
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
Implementing the gust encounter for 3D meshes and for free-flying, elastic aircraft #1954
Conversation
respect to the wavelength of 1-cos gusts to the config_template.
gust derivatives, which are zero in all implemented cases. This piece of code belongs to the split velocity method, which is currently not used as far as I understand. However, when trying to remove it, I broke the code elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you combining moving grid and deformation?
Is it possible the lift coefficient is different because the reference velocity is not the same in the 2 configurarions? Can you output the forces breakdown and see what is the force factor? |
You mean that only the coefficients are calculated wrong while the solution itself is correct? Actually, I checked that yesterday by calculating the lift coefficient manually from the nodal forces, which I obtained through the python interface with GetFlowLoad. I found that the CL from SU2 is correct, the results were numerically equivalent. It might be that the Vertex Tractions are calculated with a wrong reference value?? That would be something that happens deep in the solver, which is beyond my abilities... For the farfield, I set MACH_NUMBER= 0.0 and used MACH_MOTION= 0.2, which should be used for the scaling of coefficients, forces, etc. as far I understood. The velocity are u=68.0588 m/s, v=0.0, w=+/- 2.37 m/s, which corresponds exactly to Ma=0.2 at sea level with pressure=101325.0, density=1.225 and temperature=288.15. I checked the values by slicing through the volume mesh, and I can see exactly these numbers in far in front of the wing / close to the farfield. |
I think that is what is happening, the logic to use either MACH_MOTION or the farfield velocity as the reference is in CEulerSolver::SetReferenceValues, I think if you have fluid load markers we will assume FSI and not use MACH_MOTION. Give this a try and if it fixes the issue we need more robust logic. |
I tried changing line 1387 in CEulerSolver::SetReferenceValues to simply if (dynamic_grid) {...}, but that had no effect. |
In the meantime, I did a few additional comparisons. In the following plot, you can see a gust encounter of my 3m wing, in green color farfield onflow + gust and in violet color the same but with moving grid + gust. As we can see, there is a significant difference, which shouldn't be there. What is happening here?? |
I don't have an answer here unfortunately, have you ruled out issues or differences due to the GCL correction we make when computing the dual time source term? |
Do you have any idea where / in which file I should look? |
In CFVMFlowSolverBase<V, FlowRegime>::SetResidual_DualTime (CFVMFLowSolverBase.inl::~1600) there is different treatment for dynamic grid. And for rotating frame (which you have in some cases) we call CSolver::SetRotatingFrame_GCL from CEulerSolver::Source_Residual. Since you are combining things I don't know if this makes some weird interaction. |
Great, thank you! I will look into this within the next days. |
Hello Pedro,
The results look plausible to me: the green line shows farfield onflow + gust while the violet line shows moving grid + gust. If you zoom in (second plot) you see some small differences, for which I have no explanation so far. What do you think? |
Hi Pedro, Side note: Although the Naca0009 is a symmetric airfoil, my mesh appears to be not perfectly symmetric, resulting in non-zero lift at alpha=0.0 deg. I didn't look into this any further as the mesh is only a quick test case and symmetry probably not important for our problem. |
... and here are the two gust cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a somewhat tricky problem.
Moving reference frames are usually used in steady state, to do unsteady in a moving frame with variable velocity there are source terms due to the acceleration of the frame (we do not have those terms).
Then, the rotating frame source term is due to steady rotation. So based on your configs it doesn't have influence. As a side note, to combine rotation and translation the source term needs to be modified (I did not know this at the time you added the feature). See slide 11 https://courses.ansys.com/wp-content/uploads/2020/09/Flows-with-Moving-and-Rotating-Objects-Lesson-4-Handouts-1.pdf
On the GCL, the GCL term we have in the source term function, and the one in the dual time function are slightly different. The second one is normal for deforming meshes (see Tom's thesis). The first one (in sources) is to make steady-state rotating frame preserve free-stream better, and so it should probably not be called for unsteady problems.
Then the windgust derivatives do not look very healthy to be honest, commented out code is never a good sign. Have you looked at the paper mentioned in the code?
Thank you Pedro for the information, I will definitely have a look at the documents, although I admit that it sounds pretty complicated to me...
In the paper it says that the split velocity method (which uses the derivatives) didn't work out. So it is kind of a left-over in the code which I believe should clean up. |
I forgot to mention: I found that the small offset (delta Cl = 0.0001) between farfield onflow and grid velocities observed in the previous plots already exist in a normal time simulation with alpha=0.0 deg. So the offset has nothing to do with a) the mesh deformation or b) the gust. |
Maybe we can approach it from the minimal set of features you need. |
Hi Pedro, |
We have our developers meeting in 1h 30m, happy to chat about this https://meet.jit.si/SU2_DevMeeting |
Hi Pedro,
|
Hi Arne, |
OK, found it :) |
4ac98c9
to
cc353ee
Compare
Where do the meshes come from or where should I place the new mesh and the restart files? For example, there is no ./TestCases/gust/mesh_NACA0012_inv.su2 in the repository... |
Test duration: 0.83 min Not sure where the mesh and the restart files should go, so this will break the testing until I commit the missing files.
Is it possible to use the Onera M6 mesh that we already have in the repo? |
I see that the Onera M6 mesh is a half-wing with a symmetry plane and I'm not sure how the mesh deformation behaves in this case (for example, there should be zero out-of-plane movement). Personally, I like really simple examples where I know what should happen (symmetric airfoil, subsonic flow, no sweep) and I did all my testing during the last weeks with the NACA0012 3m wing. At the same time, it is closer to how I would model a "real" aircraft (aircraft in the center of a spherical farfield) than the Onera M6, which is more wind-tunnel-like. The mesh and everything is there, so it's no additional work for me and I would be happy to contribute this as a new example. What's the main argument in favor of the Onear M6 wing / objection against a new example? |
Just keeping the size of the repo on the small side. But go for it if it is better for the test, please use a binary restart instead of csv. |
How do I do this? To my understanding, SU2 currently needs both files. |
I haven't fully figured out how the two repositories interact, but if I copy the data from su2code/TestCases#124 into ./TestCases/gust and launch the hybrid_regression.py, the new testcase succeeds. |
Ah yes, that problem... I thought the csv was only needed for something else |
You'll have to take out the tecplot output from the config /~https://github.com/su2code/SU2/actions/runs/5006027201/jobs/8971286794 |
the SU2-internal option SURFACE_MOVEMENT= DEFORMING
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, now that there are some tests maybe you can remove the seemingly dead code in another PR
Thank you Pedro, the code removal is on my To-Do list 👍 |
Sounds good, go ahead and merge this when you can. |
I think I don't have the authority to merge, it says: "This pull request can be automatically merged by project collaborators" |
Ah right, I thought you were a member already, I've sent an invite. |
Proposed Changes
I would like to be able to calculate a gust encounter of a free-flying, elastic aircraft. The rigid body reaction (in terms of velocities u, v, w and rotation rates p, q, r) as well as the elastic structural dynamic reaction (displacement of all surface nodes of the CFD mesh) are calculated by our own aeroelastic solver, coupled via the python interface, while SU2 shall provide the aerodynamic side, as a higher fidelity alternative to panel methods such as VLM & DLM.
Update, 13.04.2023: The combination of grid velocities from the moving + deforming grid turned out to be more complicated as expected (at least for me) and the moving grid is not fully implemented for unsteady simulations (according to Pedro, some source terms are missing). The new approach uses a farfield onflow condition at alpha=0.0 and translates and rotates the whole aircraft in the elastic mesh for the rigid body + structural dynamic reaction. This is more laborious on my side (transformation of the surface, the deformation vector and the forces about the Euler angles) but simplifies the work on the SU2 side:
update the grid movement during the time domain simulation via the python interfaceInvolved parameters:
GRID_MOVEMENT= ROTATING_FRAME
TRANSLATION_RATE= u v w
ROTATION_RATE= p q r
Involved parameters:
DEFORM_MESH= YES
MARKER_DEFORM_MESH= ( list of markers )
Summing up, I will need to combine the grid velocities due to aircraft movement, elasticity and gust. Currently, this is not possible in SU2.
I split the work into the following steps. Here is what is working / not working:
gust + moving grid --> plausibility check by comparison with farfield onflow condition from abovenew python interface for grid movement update --> plausibility check with a) sudden jump in heave velocity w, b) sinusoidal velocity w at different frequencies to observe influence of unsteady aerodynamics (phase shift and reduction of resulting lift)mesh deformation + moving grid --> differences with respect to farfield onflow condition / does NOT lead to same results as above. The grid velocities look right though, both on the temporary screen output and when plotting them by slicing through the volume results, but the amplitude of the lift coefficient is too small. I guess that the velocities are not set properly / mixed up / require a call to some update function or similar. I'm stuck at this point. Does someone have any idea what I'm doing wrong?? I feel that I am missing an important step here...final test: mesh deformation + moving grid + gustApart from the steps above, the following questions / tasks remain:
The the Split Velocity Method (classes SetWind_GustField and CSourceWindGust) is not used in SU2 as far a I understand and for all gust types, the inputs are zero. Instead, the Field Velocity Method is used, but when trying to remove the functions SetWindGust and SetWindGustDer, I broke the code elsewhere. In order to enable 3D meshes, I simply set the outputs to zero for now. I believe that we should clean up the code, but my C++ skills are the limiting factor here, so I need some help with that.--> In a new, dedicated pull requestRelated Work
The gust encounter for 3D meshes was requested in #1319 and in the Forum https://www.cfd-online.com/Forums/su2/234021-gusts-3d.html and https://www.cfd-online.com/Forums/su2/225914-no-slip-condition-3d-gust.html
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.