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

UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2005, 03:44
Default UDF
  #1
Suvash
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....
  Reply With Quote

Old   April 6, 2005, 06:10
Default Re: UDF
  #2
P
Guest
 
Posts: n/a
ITs very easy just check some examples in udf document. P
  Reply With Quote

Old   April 6, 2005, 06:41
Default Re: UDF
  #3
Suvash
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)

} }
  Reply With Quote

Old   April 6, 2005, 07:58
Default Re: UDF
  #4
P
Guest
 
Posts: n/a
Do you get some error message then cut and paste them here in order for us to help u. P
  Reply With Quote

Old   April 7, 2005, 00:57
Default Re: UDF
  #5
Sham
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.
  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
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


All times are GMT -4. The time now is 05:39.