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

Sos!!! Udf code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 8, 2012, 09:53
Default Sos!!! Udf code
  #1
New Member
 
zhuoweili
Join Date: Oct 2011
Posts: 14
Rep Power: 15
Jo_vivian_lee is on a distinguished road
Hi there,
I am working on a UDF CODE which is as below, but it doesn`t work for me, could you please check what mistakes I have made? Thank you in advance.
I think the problem is the function what I used, I want to describe that power 1/6 of (0.003125-fabs(x)), how? and also, x should be an absolute value

#include "udf.h"
DEFINE_PROFILE(unsteady_velocity,thread,index)
{
real pos[ND_ND];
real x, t;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(pos, f, thread);
x=pos[0];
t=CURRENT_TIME;
F_PROFILE(f,thread,index) =pow((0.003125-fabs(x)),(1/6))*39.75287884+0.3*15.2*sin(1600*3.1415926*t);
}
end_f_loop(f, thread)
}

Last edited by Jo_vivian_lee; August 8, 2012 at 10:23.
Jo_vivian_lee is offline   Reply With Quote

Old   August 16, 2012, 01:09
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
Use 1.0/6 instead of 1/6, the latter is 0 which may not what you expected. Also make sure that abs(x) does not exceed 0.003125
blackmask 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
Brownian Motion UDF Code Confuser FLUENT 3 August 13, 2021 02:14
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 13:30
UDF code yahya_azizi Fluent UDF and Scheme Programming 4 August 6, 2012 09:06
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 15:03.