CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF doesn't work how I need it to - problems with the coordinate system in Fluent (https://www.cfd-online.com/Forums/fluent-udf/147433-udf-doesnt-work-how-i-need-problems-coordinate-system-fluent.html)

SarahG January 21, 2015 07:28

UDF doesn't work how I need it to - problems with the coordinate system in Fluent
 
Hi. I am comparing the case of an oscillating aerofoil in a constant freeflow to the case of stationary aerofoil and oscillating flow. The first case is complete though I noticed something strange about the UDF and how it works...

Now I have this UDF to oscillate my x velocity and y velocity components;

#include "udf.h"
#define PI 3.14159

DEFINE_PROFILE(unsteady_xvelocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) =-cos((0.2321)+(0.1815)*sin((2*PI*0.6*t)+(PI/2)+((3*PI)/2)));
}
end_f_loop(f, thread)
}


DEFINE_PROFILE(unsteady_yvelocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) =sin((0.2321)+(0.1815)*sin((2*PI*0.6*t)+(PI/2)+((3*PI)/2)));
}
end_f_loop(f, thread)
}

This is to give a pitching amplitude of A= 20.8/2 (starting at 2.9 degrees and going up to 23.7 in an oscillatory manner) and mean angle of attack is 13.3 degrees.

I've messed around a bit with introduction of a phase change in different places. It seems to me as though Fluent picks a different axis each time. Last time I wrote an UDF for a sliding mesh it would not rotate below the x axis until I had introduced an arbitrary pi/2 in the function.

What I would like to know is; is there a kind of different coordinate system in Fluent ? My function does as I expect when it's calculated somewhere else, like in Excel.

Thanks in advance

pakk January 21, 2015 10:01

I read your question, but I can not see the difference between what your UDF does and what you want your UDF to do.

Quote:

This is to give a pitching amplitude of A= 20.8/2 (starting at 2.9 degrees and going up to 23.7 in an oscillatory manner) and mean angle of attack is 13.3 degrees.
And? Did you get it? If no, what did you get instead? If yes, what is the problem?

SarahG January 21, 2015 11:48

Hello and thanks for your reply.
I want it to oscillate the flow so that the y velocity component is always positive and the x velocity component is always negative. The x works this way but the y velocity becomes negative. I can show you the aerofoil lift curve so you can maybe infer what is happening;
http://tinypic.com/m/igdf9x/3

pakk January 21, 2015 11:59

For me it is more useful if you could show the y-velocity, if that is the one that is wrong. I am more an expert in UDFs than in aerofoils, I don't know what the aerofoil lift curve shows...

SarahG January 21, 2015 16:45

Here is a time history of the y velocity at a point just before the aerofoil nose;

http://tinypic.com/m/igdi0h/3

pakk January 22, 2015 04:20

Is that the location where you apply "unsteady_yvelocity"?

SarahG January 22, 2015 11:07

Ahh, okay. It is doing what is expected at the inlet;
http://tinypic.com/m/igdxyb/3
but at the same time I got the same graph as before for just before the aerofoil;
http://tinypic.com/m/igdi0h/3

I have an interface, because I'm comparing the case of oscillating aerofoil to oscillating flow, and for a direct comparison I need to keep the mesh the same.
The mesh looks like this with the interface.
http://s46.photobucket.com/user/merl...4ded6.jpg.html

pakk January 22, 2015 11:15

If the velocity at the inlet is what it should be, then the UDF is behaving correctly.

I understand that the flow at point 11 is not what you expect. I can't help you with that; I don't know what you expect there, and if I knew what you were expecting there, I would not know if your expectation was wrong or if the simulation was wrong, and if I knew that the simulation would be wrong, I would have no idea which aspect of the simulation is wrong.
All I can say is that the UDF works as you want, but you also saw that, so I am useless for you, I'm afraid...

SarahG January 22, 2015 11:26

I want it to do the same at that point-11 as it does at the inlet, except with a bit of a phase delay obviously because the flow has to get from the inlet to the aerofoil.
I'm running a simulation with another mesh without an interface to see if it might have to do with the interface

pakk January 22, 2015 11:38

I don't know where your inlet is, and where your point 11 is, so I don't know how reasonable it is to expect that the flow at point 11 is the same as the flow at the inlet.

SarahG January 25, 2015 17:51

Hello again. I will try to illustrate my problem with a bit more clarity (although not a problem with the UDF after all).
Here is where 'point-11' is, now called nose-point
http://s46.photobucket.com/user/merl...0f48f.jpg.html

This is the Y velocity that is desired at the nose-point, which is okay at the inlet
http://s46.photobucket.com/user/merl...65c74.jpg.html

This was the Y velocity at the nose;
http://s46.photobucket.com/user/merl...a2601.jpg.html

It has overshot the amplitude, and this is what the velocity vectors look like, to show the interface works properly
http://s46.photobucket.com/user/merl...244dd.jpg.html


I found out that I got a better match if I made the slip walls into a periodic boundary;
http://s46.photobucket.com/user/merl...de312.jpg.html
but there is still a problem in that it overshoots the amplitude in the -y axis direction.

Edit: I think I have it working now with periodic boundary conditions and reducing the distance between the inlet and the aerofoil.

Thanks


All times are GMT -4. The time now is 05:44.