|
[Sponsors] |
|
January 26, 2018, 03:46 |
Airfoil AoA steped increment
|
#1 |
New Member
Join Date: Jan 2018
Posts: 4
Rep Power: 8 |
Dear All,
I am fairly new to Fluent and UDF, therefore i would like to request some help on the following matter. I intend to perform a simulation on a 2D airfoil. The airfoil will remain stationary until the solution approaches convergence. After that it should update the angle of attack by 1 degree every, let's say t = c/U, where c is the chord length and U the freestream velocity. The range of angles of attack would be from -180 to 180 degrees. However it is ok for each simulation to go from 0 until the extreme angle. I have tried to create a '' for loop'' however it seems that something like that doesn't work. Also regarding the rotation function: can i simply use axis rotation equations? x'=x\cos \theta +y\sin \theta y'=-x\sin \theta +y\cos \theta .} These also didn't seem to work, but i'm guessing it's more of a coding issue. Thank you in advance for all the help on the matter. Best regards |
|
January 26, 2018, 04:39 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
If you use these equations, you will rotate around the origin x=y=0, which may or may not be what you want.
Furthermore: be aware that in the code, the angle should not be in degrees but in in radians. Having said that: your problems are most likely a coding problem, and it is nearly impossible to give further advise without seeing your code. |
|
January 26, 2018, 04:45 |
|
#3 |
New Member
Join Date: Jan 2018
Posts: 4
Rep Power: 8 |
I've tried two options. The first was just to try if i could make the axis move:
#include "udf.h" DEFINE_ZONE_MOTION(fmotion,omega,axis,origin,veloc ity,time,dtime) { if (flow_time >= 0.10) { origin[0] = 0.5; origin[1] = 0.0; origin[2] = 0.0; axis[0] = axis[0] + (axis[0]*cos(0.0175)-axis[1]*sin(0.0175)); axis[1] = axis[1] + (axis[1]*sin(0.0175)+axis[1]*cos(0.0175)); axis[2] = 1.0; } else { *omega = 0.0; } return; } The second try regards the loop it: #include "udf.h" DEFINE_ZONE_MOTION(fmotion,omega,axis,origin,veloc ity,time,dtime) { for( dtime = 10; dtime = 1000; dtime = 10 ) { origin[0] = 0.5; origin[1] = 0.0; origin[2] = 0.0; axis[0] = axis[0] + (axis[0]*cos(0.0175)-axis[1]*sin(0.0175)); axis[1] = axis[1] + (axis[1]*sin(0.0175)+axis[1]*cos(0.0175)); axis[2] = 1.0; } return; } Without further due, thank you very much. |
|
January 26, 2018, 06:35 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
I think you were successfully rotating the axis. (With a minor detail: you take the wrong components of the axis in updating the y-component.)
But this does not have the effect that you want. "Axis" does not mean the axis of your coordinate system, but the axis around which you want to rotate. You never asked Fluent to rotate anything, so it keeps the default rotation of 0 degree. If you rotate 0 degree, it does not matter in which direction the rotation axis points. It looks like you want to rotate around the z-axis, so: Code:
axis[0] = 0.0; axis[1] = 0.0; axis[2] = 1.0; Code:
*omega = 0.0175; |
|
January 26, 2018, 07:49 |
|
#5 |
New Member
Join Date: Jan 2018
Posts: 4
Rep Power: 8 |
Yes, that seems like aplausible solution. However by setting omega it will generate a constant rotational speed and increment of the angle of attack. As i explained in my first post i intend to have a sequenced update of the angle. Below i've posted a picture to ilustrate more cleared what i mean.
https://imgur.com/hfGRG6O |
|
January 26, 2018, 08:30 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Then set omega to zero for 0.099 seconds, and to (0.0175/0.001) for 0.001 seconds.
|
|
January 26, 2018, 08:47 |
|
#7 |
New Member
Join Date: Jan 2018
Posts: 4
Rep Power: 8 |
What about the code crtucture? Is it a loop? And what macro would be the best to consider the steps?
|
|
January 26, 2018, 09:30 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
No loops are required, I don't even see what you want to loop over...
You want something like this: Code:
if (time<0.099) { *omega = 0.0; } else if (time<0.1) { *omega = (0.0175/0.001); } else if (time<0.199) { *omega = 0.0; } else if (time<0.2) { *omega = (0.0175/0.001); } else ... /*and go on as many times as you need */ Code:
if ((1000*time)%100<99) { *omega = 0.0; } else { *omega = (0.0175/0.001); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with airfoil shape optimization | robyTKD | SU2 Shape Design | 7 | March 7, 2022 17:18 |
SU2 AOA optimization | 454514566@qq.com | SU2 | 9 | March 7, 2022 17:17 |
Ffd_control_point_2d | feiyi | SU2 | 4 | September 30, 2019 13:42 |
High drag for airfoil compared to XFOIL and wind tunnel data | Ry10 | SU2 | 15 | October 30, 2016 18:27 |
2D FFD Optimization | RLangtry | SU2 | 2 | August 5, 2014 10:48 |