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

temperature profile variation -UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ousegui

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2013, 05:57
Default temperature profile variation -UDF
  #1
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Does fluent allow the external temperature function to be defined "by branches": i.e. one equation for 0<t<10000s and another for t>10000s for example. This way, the fitting would become much easier with distinct equations for distinct branches of time…


I have this code but it has only one fitting curve equation, while I have two equations for distinct times. how to do this ?


Code:
/***********************************************************************
udfexample.c 
UDF for specifying transient temperature profile boundary condition
 ************************************************************************/
#include "udf.h"
#include "mem.h"
DEFINE_PROFILE(Temp_Profile, thread, position)    
{
real x[ND_ND];                                       
real y; 
real theProfile;
face_t f;
begin_f_loop(f, thread);
 {
 F_CENTROID(x,f,thread);
 y = CURRENT_TIME;    
  theProfile=(283.7656)+25.44573*exp(-0.5*((y-49657.42)*(y-49657.42)/(11529.66*11529.66))); 
 F_PROFILE(f, thread, position) =theProfile;
 }
end_f_loop(f,thread)
}

regards,
ahvz is offline   Reply With Quote

Old   June 10, 2013, 15:11
Default
  #2
New Member
 
ousegui
Join Date: Oct 2010
Posts: 19
Rep Power: 16
ousegui is on a distinguished road
See Added part to your code (in red)
Quote:
Originally Posted by ahvz View Post
Code:
/***********************************************************************
udfexample.c 
UDF for specifying transient temperature profile boundary condition
 ************************************************************************/
#include "udf.h"
#include "mem.h"
DEFINE_PROFILE(Temp_Profile, thread, position)    
{
real x[ND_ND];                                       
real y; 
real t1; //time whre your equation profile changes
real theProfile;
face_t f;
begin_f_loop(f, thread);
 {
 F_CENTROID(x,f,thread);
 y = CURRENT_TIME;    
if(y<t1)
  theProfile=(283.7656)+25.44573*exp(-0.5*((y-49657.42)*(y-49657.42)/(11529.66*11529.66))); 
 F_PROFILE(f, thread, position) =theProfile;
else
theProfile=other expressions
 F_PROFILE(f, thread, position) =theProfile;
 }
end_f_loop(f,thread)
}

regards,
ahvz likes this.
ousegui is offline   Reply With Quote

Old   June 10, 2013, 16:10
Default
  #3
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
thank you very much
ahvz is offline   Reply With Quote

Old   June 17, 2013, 20:07
Default
  #4
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
I tried to change the domain of my temperature profile by defining time limits:

but the results are very strange. is the code written properly ?

Code:
/***********************************************************************
udfexample.c 
UDF for specifying transient temperature profile boundary condition
 ************************************************************************/
#include "udf.h"
#include "mem.h"
DEFINE_PROFILE(Temp_Profile, thread, position)    
{
real x[ND_ND];                                       
real y; 
real t1=32399;
real t2=89999;
real t3=118799;
real theProfile;
face_t f;
begin_f_loop(f, thread);
 {
 F_CENTROID(x,f,thread);
 y = CURRENT_TIME;     
if(y<=t1) 
   
       theProfile=(-3e-12*pow(y,3.))+(1e-7*pow(y,2.))-(-0.0004*pow(y,1.))+(282.08);
       F_PROFILE(f, thread, position) =theProfile;    
      {
     if(t1<y<=t2)
       theProfile=(-3e-13*pow(y,3.))+(7e-8*pow(y,2.))-(0.0055*pow(y,1.))+426.51;
       F_PROFILE(f, thread, position) =theProfile;
      }
      {
      if(t2<y<=t3)
      theProfile=(-2e-12*pow(y,3.))+(6e-7*pow(y,2.))-(0.0587*pow(y,1.))+2143.9;
      F_PROFILE(f, thread, position) =theProfile;
      }
      {
      if(y>t3)
      theProfile=(-4e-13*pow(y,3.))-(2e-7*pow(y,2.))-(0.0301*pow(y,1.))+1881.6;
      F_PROFILE(f, thread, position) =theProfile;
      }
 }
end_f_loop(f,thread)
}

regards,
ahvz is offline   Reply With Quote

Old   July 23, 2013, 08:55
Default
  #5
Member
 
sooraj
Join Date: Dec 2012
Posts: 38
Rep Power: 13
str6073 is on a distinguished road
hi

I need a udf for a work.I'm quite new in this area, so i really need your help. i need a linear varying temperature profile boundary condition to be applied on a circular face of a cylinder. temperature varies from 25 to 50 degrees from bottom to top of circle. diameter of circle is 470 mm . can you please help???
str6073 is offline   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
UDF error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 9 June 25, 2016 20:08
Define profile inlet_temperature in UDF mohammadkm Fluent UDF and Scheme Programming 19 December 24, 2013 23:42
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 02:27
UDF temp. profile BC Shashikant FLUENT 0 June 24, 2006 04:16
temperature profile on boundary sivakumar FLUENT 5 November 24, 2002 01:58


All times are GMT -4. The time now is 21:02.