|
[Sponsors] |
April 6, 2005, 03:44 |
UDF
|
#1 |
Guest
Posts: n/a
|
Hi How can I write a UDF of the boundary condition T(t)=Tm+Asin(wt), where T is the temperature, t=time, Tm=mean temaperature, A= amplitude=DeltaT/2, w=2pi/P=angular freequency, P=24 for the fluent....
|
|
April 6, 2005, 06:10 |
Re: UDF
|
#2 |
Guest
Posts: n/a
|
ITs very easy just check some examples in udf document. P
|
|
April 6, 2005, 06:41 |
Re: UDF
|
#3 |
Guest
Posts: n/a
|
Hi P, Thanks for your advice. I wrote the following but could not getting the result.
#include "udf.h" DEFINE_PROFILE(Surface_hotflux_profile,t,i) { real x[ND_ND]; /* this will hold the position vector */ /* real xS; y direction */ /* real tempS; surface temperature*/ /* real Bi=1.; Biot number*/ real deltaTime=86400.; /* recycling time of day and night*/ real timeB=RP_Get_Real("flow-time"); real vt; face_t f; if ( timeB<deltaTime) /*1 recycling*/ { vt=timeB; } if ( timeB>=deltaTime) /*2 recycling*/ { vt=timeB-deltaTime; } if ( timeB>=deltaTime*2.) /*3 recycling*/ { vt=vt-deltaTime; } if ( timeB>=deltaTime*3.) /*4 recycling*/ { vt=vt-deltaTime; } if ( timeB>=deltaTime*4.) /*5 recycling*/ { vt=vt-deltaTime; } if ( timeB>=deltaTime*5.) /*6 recycling*/ { vt=vt-deltaTime; } if ( timeB>=deltaTime*6.) /*7 recycling*/ { vt=vt-deltaTime; } if ( timeB>=deltaTime*7.) /*8 recycling*/ { vt=vt-deltaTime; } if ( timeB>=deltaTime*8.) /*9 recycling*/ { vt=vt-deltaTime; } if ( timeB>=deltaTime*9.) /*10 recycling*/ { vt=vt-deltaTime; } if ( timeB>=deltaTime*10.) /*11 recycling*/ { vt=vt-deltaTime; } if ( vt>deltaTime/2.) { begin_f_loop(f,t) { /* tempS=F_T(f,t); get temp in surface */ F_CENTROID(x,f,t); F_PROFILE(f, t, i)=290.+5.*sin(2*3.141592654*vt/deltaTime); } end_f_loop(f,t) } else { begin_f_loop(f,t) { F_CENTROID(x,f,t); F_PROFILE(f, t, i)=0.; } end_f_loop(f,t) } } |
|
April 6, 2005, 07:58 |
Re: UDF
|
#4 |
Guest
Posts: n/a
|
Do you get some error message then cut and paste them here in order for us to help u. P
|
|
April 7, 2005, 00:57 |
Re: UDF
|
#5 |
Guest
Posts: n/a
|
That's because you have not define sin function in the library. You need to write include math.h as well afer the include udf.h. This will define the sin function. Only UDF library is noy enough to recognise it.
Hope this help. Sham. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 08:37 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
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 |