CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Problem with UDF : Interpreting successfully but not running

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 4, 2020, 03:08
Default Problem with UDF : Interpreting successfully but not running
  #1
New Member
 
Join Date: Sep 2019
Posts: 24
Rep Power: 6
NonStopEagle is on a distinguished road
hey guys,

I am trying to write a udf that varies the direction of air over my airfoil from 0 to 14 and back to 0 in 1 sec. While the udf I have written interprets successfully, it does not run. I interpret the udf, and define the x_velocity and y_velocity as values obtained from the udf. But for some reason, the angle of incidence of air never changes as it's supposed to.
One more thing that I noticed is that none of my printf statements are being displayed by ansys fluent.

Here's the udf

#include "udf.h"

DEFINE_PROFILE(x_inlet_velocity, thread, position)
{
real x[ND_ND]; // added
int a = 3;
real v;
real polarity= -1;
face_t f;
real t,ts;

ts = 0.125;


begin_f_loop(f,thread)
{

F_CENTROID(x,f,thread); // added
{
t = RP_Get_Real("flow-time");
{
//a = (int) (t/(tstep*2));

polarity = 1;
v = cos(9*(sin(90*2*ts*(t/ts)*3.1415/180))*3.1415/180)*10.95;
}
}


if(f==0)
{
printf("angle is %d \n", (9*(sin(90*2*ts*(t/ts)*3.1415/180))*3.1415/180));
printf("Flow Time is %f \n",t);
}
F_PROFILE(f,thread,position) = v;
}
end_f_loop(f,thread)

}

DEFINE_PROFILE(y_inlet_velocity, thread, position)
{
real y[ND_ND]; // added
int b= 3;
real v1;
face_t f1;
real t1, ts1 = 0.125;



begin_f_loop(f1,thread)
{
F_CENTROID(y,f1,thread); // added
{
t1 = RP_Get_Real("flow-time");
{

v1 = sin(9*(sin(90*2*ts1*(t1/ts1)*3.1415/180))*3.1415/180)*10.95;
}
}
if(f1==0)
{
printf("Angle verification : %d\n", (9*(sin(90*2*ts1*(t1/ts1)*3.1415/180))*3.1415/180));
}
F_PROFILE(f1,thread,position) = v1;
}
end_f_loop(f1,thread)

}

This udf is only for serial and cannot be used for parallel processing in fluent. Anyway, please do tell me what's wrong here.


NonStopEagle
NonStopEagle is offline   Reply With Quote

Reply

Tags
ansys, fluent, udf, velocity change


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem About Running Fluent In Linux mitra FLUENT 18 June 20, 2019 02:11
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Problem with interpreting UDF Boris Kloser Fluent UDF and Scheme Programming 1 December 29, 2009 23:48
A Loop problem when running UDF in the batch mode Jun Geng FLUENT 3 July 16, 2008 08:34
parallel UDF problem kerem FLUENT 2 June 20, 2006 06:56


All times are GMT -4. The time now is 01:13.