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

Need UDF code for time dependent temperature BC

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By blackmask

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 23, 2018, 04:34
Default Need UDF code for time dependent temperature BC
  #1
New Member
 
Karthik
Join Date: Apr 2017
Posts: 29
Rep Power: 9
kr660170 is on a distinguished road
Hello Everyone,

Can someone write me a UDF code for time dependent temperature BC.

The hot wall temperature is initially at 298K and it raised linearly for 10K/min and make it steady after it reaches 348 K.

Step 1: at time = 0s, temp = 298K
Step 2: Should raise 10K/min
Step 3: Once it reached 348K, make it steady.

I hope somone will help me. Thanks in advance.
kr660170 is offline   Reply With Quote

Old   August 23, 2018, 04:51
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
Something like the code below should do.
Code:
#include "udf.h"

DEFINE_PROFILE(time_dep_temp,th,i)
{
    face_t f;
    real flow_time = CURRENT_TIME;
    real K0=298.0, K1=348.0, rate = 10.0/60.0;
    real t0 = 0.0, t1 = t0 + (K1-K0)/rate;
    begin_f_loop(f,th)
    {   
        if(flow_time <= t1) 
            F_PROFILE(f,th,i) = K0 + rate*(flow_time - t0);
        else
            F_PROFILE(f,th,i) = K1; 
    }   
    end_f_loop(f,th);
}
Oula likes this.
blackmask is offline   Reply With Quote

Old   August 23, 2018, 08:23
Default
  #3
New Member
 
Karthik
Join Date: Apr 2017
Posts: 29
Rep Power: 9
kr660170 is on a distinguished road
Thank you very much and it's working.
kr660170 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
write code UDF Fluent solve kinetic reaction rate equation palm oil zirkov FLUENT 0 February 13, 2017 10:16
UDF for linear temperature variation nonstopthinker Fluent UDF and Scheme Programming 2 September 4, 2016 00:36
Please Help! Temperature profile UDF for 3D geometry subhankar_bhandari FLUENT 2 April 16, 2011 05:30
Please Help! Temperature profile UDF for 3D geometry subhankar_bhandari FLUENT 0 August 16, 2010 08:40
Help please! UDF for Temperature profile in 3D subhankar_bhandari Fluent UDF and Scheme Programming 2 August 16, 2010 08:37


All times are GMT -4. The time now is 13:06.