|
[Sponsors] |
January 7, 2013, 11:44 |
my udf dos not work
|
#1 |
New Member
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 14 |
Hi dear friend
I wrote a udf code to add a momentum source on flow around my airfoil,but it has no effect on my solution. HTML Code:
#include "udf.h" DEFINE_SOURCE(my_source,c,t,dS,eqn) { /* Declare Variables */ real xc[ND_ND]; real source, x, y; real m1, m2; real b_bottom, b_left, b_top, b_right; real check_bottom, check_left, check_top, check_right; /* Call x and y data from FLUENT */ C_CENTROID(xc,c,t); x=xc[0]; y=xc[1]; /* Define region. Four inequalities are used to define the rectangular region. */ m1=0.5250; m2=-1.9048; b_bottom=0.0089; b_left=0.0575; b_top=0.0090; b_right=0.0790; check_bottom=m1*x+b_bottom; check_left=m2*x+b_left; check_top=m1*x+b_top; check_right=m2*x+b_right; /* Apply source term to region inside the four inequalities */ if ((y>=check_bottom)&&(y>=check_left)&&(y<=check_top)&&(y<=check_right)) { source = 1000.0; dS[eqn] = 0; } else { source = 0; dS[eqn] = 0; } C_UDMI(c,t,0)=source; return source; } |
|
January 7, 2013, 12:35 |
|
#2 |
Super Moderator
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,385
Blog Entries: 23
Rep Power: 29 |
I'm not an expert, please look at this thread : http://www.cfd-online.com/Forums/flu...g-happens.html
I hope it can solve your problem... |
|
January 7, 2013, 13:15 |
|
#3 | |
New Member
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 14 |
Quote:
tanx for your answer i have some question about this (PLZ) 1.my mesh is not enough fine and i should adapt mesh near airfoil's wall to be cell centroids within the ranges. Is this wrong? 2.you increase the amount of source from 1000 to 10000.Why? |
||
January 7, 2013, 13:18 |
|
#4 |
Super Moderator
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,385
Blog Entries: 23
Rep Power: 29 |
back in those days i didn't know the magnitude of the value of the source i was giving. i wa thinking that may be 1000 will do nothing to my flow...
Try playing a little bit with your bottom left right limits, see if it can changes the solution |
|
January 7, 2013, 14:44 |
|
#5 | |
New Member
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 14 |
Quote:
Is it important? |
||
January 7, 2013, 14:53 |
|
#7 |
New Member
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 14 |
||
January 7, 2013, 15:04 |
|
#9 |
New Member
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 14 |
||
January 7, 2013, 15:21 |
|
#10 |
New Member
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 14 |
Dear Ali
do you suggest me change magnitude and position of source term? |
|
January 7, 2013, 15:46 |
|
#12 |
New Member
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 14 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
udf doesn't work | blaid | FLUENT | 0 | March 6, 2012 13:29 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
Help Parallelizing UDF | AndresC | FLUENT | 0 | February 25, 2010 16:50 |
udf - c++ compiler does not work | Matthias | FLUENT | 1 | January 9, 2009 01:44 |
Will the UDF work?? | H.S.Fang | FLUENT | 0 | December 27, 2001 22:21 |