|
[Sponsors] |
May 3, 2001, 02:13 |
Momentum source UDF
|
#1 |
Guest
Posts: n/a
|
Hi, I've just written up some code for a momentum source compiled UDF, where the constant source is restricted by its position in the domain and is adjusted on each iteration. It compiled OK (which doesn't mean much) but I get an error when fluent tries to call the function:
Error: get_udf_function: function cell_x_source has wrong type: 5 != 3 Error Object: () What does this mean and how can I fix it? I am a novice at C programming so it is probably something majorly wrong with the variable and function types I'm using. Here's the code: #include "udf.h" /* ------------------------------------------------------------------------ X_Momentum_Source This routine returns the source term for the X-momentum term for each control volume in the domain. ------------------------------------------------------------------------ */ DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn) { real source; real xc[ND_ND]; /* 3D position in array */ C_CENTROID(xc,cell,thread); /* outputs xc (cell centroid) */ if (xc[0] > 0.95) { if (xc[0] < 1.05) if (xc[1] > 0) if (xc[1] < 1) /* Restricted position of momentum source */ /* source term */ source = 0.1; /* derivative of source term w.r.t. x-velocity. */ dS[eqn] = 0; } else source = dS[eqn] = 0.; return source; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 10:23 |
Pressure jump and momentum source | Tanya | FLUENT | 1 | June 4, 2009 15:22 |
UDF for energy source | João Fernandes | FLUENT | 4 | October 17, 2008 04:53 |
UDF: PROFILE + SOURCE | Nuno | FLUENT | 0 | September 1, 2008 15:31 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 13, 2000 23:03 |