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

my udf dos not work

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By diamondx
  • 1 Post By diamondx
  • 1 Post By diamondx

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 7, 2013, 10:44
Default my udf dos not work
  #1
New Member
 
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 13
amir_14 is on a distinguished road
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;
}
Can everybody help me about this ?
amir_14 is offline   Reply With Quote

Old   January 7, 2013, 11:35
Default
  #2
Super Moderator
 
diamondx's Avatar
 
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,385
Blog Entries: 23
Rep Power: 28
diamondx will become famous soon enough
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...
amir_14 likes this.
__________________
Regards,
New to ICEM CFD, try this document --> https://goo.gl/KAOIwm
Ali
diamondx is offline   Reply With Quote

Old   January 7, 2013, 12:15
Default
  #3
New Member
 
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 13
amir_14 is on a distinguished road
Quote:
Originally Posted by diamondx View Post
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...
hi dear M. Ali
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?
amir_14 is offline   Reply With Quote

Old   January 7, 2013, 12:18
Default
  #4
Super Moderator
 
diamondx's Avatar
 
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,385
Blog Entries: 23
Rep Power: 28
diamondx will become famous soon enough
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
amir_14 likes this.
__________________
Regards,
New to ICEM CFD, try this document --> https://goo.gl/KAOIwm
Ali
diamondx is offline   Reply With Quote

Old   January 7, 2013, 13:44
Default
  #5
New Member
 
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 13
amir_14 is on a distinguished road
Quote:
Originally Posted by diamondx View Post
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
can you help me about Number of User-Defined Memory Locations ?
Is it important?
amir_14 is offline   Reply With Quote

Old   January 7, 2013, 13:46
Default
  #6
Super Moderator
 
diamondx's Avatar
 
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,385
Blog Entries: 23
Rep Power: 28
diamondx will become famous soon enough
no, where do you see that. did you follow the tutorial about UDF integration ???
It can really help
__________________
Regards,
New to ICEM CFD, try this document --> https://goo.gl/KAOIwm
Ali
diamondx is offline   Reply With Quote

Old   January 7, 2013, 13:53
Default
  #7
New Member
 
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 13
amir_14 is on a distinguished road
Quote:
Originally Posted by diamondx View Post
no, where do you see that. did you follow the tutorial about UDF integration ???
It can really help
it is necessary because of C_UDMI but i don't know number of this
amir_14 is offline   Reply With Quote

Old   January 7, 2013, 13:59
Default
  #8
Super Moderator
 
diamondx's Avatar
 
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,385
Blog Entries: 23
Rep Power: 28
diamondx will become famous soon enough
are talking about the zero in the C_UDMI
__________________
Regards,
New to ICEM CFD, try this document --> https://goo.gl/KAOIwm
Ali
diamondx is offline   Reply With Quote

Old   January 7, 2013, 14:04
Default
  #9
New Member
 
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 13
amir_14 is on a distinguished road
Quote:
Originally Posted by diamondx View Post
are talking about the zero in the C_UDMI
yes
without change of this in define menu i have an error at ansys running
when i define 1 for Number of User-Defined Memory Locations run will start
amir_14 is offline   Reply With Quote

Old   January 7, 2013, 14:21
Default
  #10
New Member
 
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 13
amir_14 is on a distinguished road
Dear Ali
do you suggest me change magnitude and position of source term?
amir_14 is offline   Reply With Quote

Old   January 7, 2013, 14:29
Default
  #11
Super Moderator
 
diamondx's Avatar
 
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,385
Blog Entries: 23
Rep Power: 28
diamondx will become famous soon enough
yes of course do it so you can pinpoint the problem....
amir_14 likes this.
__________________
Regards,
New to ICEM CFD, try this document --> https://goo.gl/KAOIwm
Ali
diamondx is offline   Reply With Quote

Old   January 7, 2013, 14:46
Default
  #12
New Member
 
amir
Join Date: Dec 2012
Posts: 29
Rep Power: 13
amir_14 is on a distinguished road
Quote:
Originally Posted by diamondx View Post
yes of course do it so you can pinpoint the problem....
tanx for your help dear Ali
I will try this
amir_14 is offline   Reply With Quote

Reply


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
udf doesn't work blaid FLUENT 0 March 6, 2012 12:29
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
Help Parallelizing UDF AndresC FLUENT 0 February 25, 2010 15:50
udf - c++ compiler does not work Matthias FLUENT 1 January 9, 2009 00:44
Will the UDF work?? H.S.Fang FLUENT 0 December 27, 2001 21:21


All times are GMT -4. The time now is 22:56.