|
[Sponsors] |
September 1, 2008, 16:31 |
UDF: PROFILE + SOURCE
|
#1 |
Guest
Posts: n/a
|
Hi people im a newbie of Fluent and i want put the profile of velocity on x direccion and a source term on x-momentum. So i copied the exemples of Fluent Manual. I did two files, one for profile (profile.txt) and other for source (source.txt). On Fluent i selected the Fluid and chose the source term. I chose on Boundary Conditions for inlet the velocity profile. So, when i Interpreted the its all ok but when i select Iterate appear the follow error: xmom_source:wrong return type: void udf function expect. My flow is turbulent and the fluid is air. How i can fixed that. Thank you for all help
#include "udf.h" /* must be at the beginning of every UDF you write */ DEFINE_PROFILE(x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f,thread) /* loops over all faces in the thread passed in the DEFINE macro argument */ { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f,thread,index) = 1.5*pow(y/42,0.14); } end_f_loop(f,thread) } ********SOURCE********* #include "udf.h" #define C2 100.0 DEFINE_SOURCE(xmom_source, c, t, dS, eqn) { real x[ND_ND]; real con, source; C_CENTROID(x, c, t); con = C2*0.5*C_R(c, t)*x[1]; source = -con*fabs(C_U(c, t))*C_U(c, t); dS[eqn] = -2.*con*fabs(C_U(c, t)); return source; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
contribution of convective source in total source? | Antony | Phoenics | 4 | July 30, 2008 06:15 |
Volumetric source or Inlet source | Kumar | CFX | 0 | May 12, 2008 10:33 |
profile as BC | bohis | FLUENT | 0 | April 16, 2008 08:18 |
Source and Source coefficient | Ramcharan | CFX | 0 | February 13, 2008 08:27 |
how to identify profile file source? | Ralf Schmidt | FLUENT | 0 | November 8, 2006 10:45 |