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

Boundary condition temerature profile

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 5, 2014, 04:54
Default Boundary condition temerature profile
  #1
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Hello,
I have been working on transient analysis with considering the below code but I have strange results. is there anyone to help me to find my problem?

(indeed I divide the temperature profile to some branches to get accurate fitting curve, that's why I have more than one equation in the code)

Code:
/***********************************************************************
UDF example.c 
UDF for specifying transient temperature profile boundary condition S
 ************************************************************************/
#include "udf.h"
#include "mem.h"
DEFINE_PROFILE(TempS_Profile, thread, position)    
{
real x[ND_ND];                                       
real y; 
real t1=10019;
real t2=13529;
real t3=20009;
real t4=29999;
real t5=40019;
real t6=50009;
real t7=59999;
real t8=70019;
real t9=80009;

real theProfile;
face_t f;
begin_f_loop(f, thread);
 {
 F_CENTROID(x,f,thread);
 y = CURRENT_TIME;     
  
     if(y<=t1) 
      {       
       theProfile=(-2E-13*pow(y,3.))+(3E-08*pow(y,2.))+(9E-06*pow(y,1.))+283.78; 
       F_PROFILE(f, thread, position) =theProfile;    
       }
      else if (y<=t2 && y>t1)
       {
       theProfile=(1E-11*pow(y,3.))-(4E-07*pow(y,2.))+(0.0061*pow(y,1.))+257.77;  
       F_PROFILE(f, thread, position) =theProfile;
       }
       else if (y<=t3 && y>t2)
       {
       theProfile=(-4E-11*pow(y,3.))+(2E-06*pow(y,2.))-(0.035*pow(y,1.))+482.71;  
       F_PROFILE(f, thread, position) =theProfile;
       }
       else if (y<=t4 && y>t3)
       {
       theProfile=(4E-12*pow(y,3.))-(3E-07*pow(y,2.))+(0.0091*pow(y,1.))+203.7;  
       F_PROFILE(f, thread, position) =theProfile;
       }
       else if (y<=t5 && y>t4)
       {
       theProfile=(-7E-12*pow(y,3.))+(7E-07*pow(y,2.))-(0.0233*pow(y,1.))+550.94;  
       F_PROFILE(f, thread, position) =theProfile;
       }
       else if (y<=t6 && y>t5)
       {
       theProfile=(9E-12*pow(y,3.))-(1E-06*pow(y,2.))+(0.0575*pow(y,1.))+566.62;  
       F_PROFILE(f, thread, position) =theProfile;
       }
       else if (y<=t7 && y>t6)
       {
       theProfile=(1E-12*pow(y,3.))-(2E-07*pow(y,2.))+(0.0094*pow(y,1.))+171.39;  
       F_PROFILE(f, thread, position) =theProfile;
       }
       else if (y<=t8 && y>t7)
       {
       theProfile=(-6E-12*pow(y,3.))+(1E-06*pow(y,2.))-(0.0849*pow(y,1.))+2180.8;  
       F_PROFILE(f, thread, position) =theProfile;
       }
       else if (y<=t9 && y>t8)
       {
       theProfile=(-1E-11*pow(y,3.))+(3E-06*pow(y,2.))-(0.2083*pow(y,1.))+5510.9;  
       F_PROFILE(f, thread, position) =theProfile;
       }
       else
       {
       theProfile=(-6E-11*pow(y,3.))+(1E-05*pow(y,2.))-(1.2143*pow(y,1.))+33813;  
       F_PROFILE(f, thread, position) =theProfile;
       }
 }
end_f_loop(f,thread)
}

regards,
ahvz is offline   Reply With Quote

 


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
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
Velocity profile boundary condition Tuca FLOW-3D 1 April 23, 2013 12:02
No-slip condition for non-resolved boundary layer in open channel banks Lupocci Main CFD Forum 1 January 17, 2013 03:11
velocity profile inlet boundary condition question Lcw FLUENT 3 August 3, 2012 05:53
applying profile data as a boundary condition vadivel CFX 1 June 9, 2007 07:11


All times are GMT -4. The time now is 07:57.