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

UDF for time dependent heat flux

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 23, 2015, 14:00
Question UDF for time dependent heat flux
  #1
New Member
 
Join Date: Dec 2015
Posts: 2
Rep Power: 0
rontgen5 is on a distinguished road
Hello!

I am very new to ANSYS. I am modeling a simple conduction + convection model. Although the heat source in this is more like a PULSE. In a 300 msec cycle, a heat pulse of 10 msec long is sent at 50th msec. All the time except for the pulse duration is for cooling.

I have written an UDF, that can be seen below (with my negligible knowledge of writing an UDF). When I try to interpret it, I am getting an errors: 1. line 35arse error, 2. f_loop_last: undeclared variable. I am not able to understand the cause of these errors. I tried looking at other threads, but I still couldn't understand what's wrong.

Can some one please have a look and give me some kind of feedback?

I highly appreciate your time, thank you very much.


Code:

# include "udf.h"
# include "unsteady.h"

DEFINE_EXECUTE_AT_END (execute_loop)
{
face_t f;
Thread *t;
real c_time=0.0000;
real q;
c_time=CURRENT_TIME;

if (c_time<0.05)
{
q=0;
}

if ((c_time>=0.05)&&(c_time<=0.06))
{
q=10000;
}

if (c_time>0.06)
{
q=0;
}

DEFINE_PROFILE(HeatPulse, t, i)
{
begin_f_loop (f,t)
F_PROFILE(f,t,i) = q;
end_f_loop(f,t)
}
}
rontgen5 is offline   Reply With Quote

Old   January 2, 2016, 18:53
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 793
Rep Power: 9
`e` is on a distinguished road
Are you sure you're interpreting the code you've copied above? There are less than 35 lines of code (your first error mentions an error on line 35) and "f_loop_last" (your second error) is not found in your code.

Try compiling instead of interpreting UDFs (more stable) and the pulse can be applied within the DEFINE_PROFILE macro without using the second macro (CURRENT_TIME is available at each step the profile is applied to the boundary).
`e` is offline   Reply With Quote

Old   January 2, 2016, 19:29
Default
  #3
New Member
 
Join Date: Dec 2015
Posts: 2
Rep Power: 0
rontgen5 is on a distinguished road
Sorry about that, I did not copy the comments at the beginning of the code, which I had written for my benefit.

Thank you very much for your help. But, I figured out yesterday that DEFINE_PROFILE with CURRENT_TIME was all I needed. So I was able to interpret the UDF. Although now, I am trying to find a way to check if the pulse was applied or not. So its its more like a question of reading the data.

Let's see what happens, once I figure out how to read if the pulse was applied at the instances I wanted.
rontgen5 is offline   Reply With Quote

Reply

Tags
fluent, heat flux, udf

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
temperature dependent heat flux on wall tjliang OpenFOAM Running, Solving & CFD 0 December 8, 2014 10:37
Variable heat flux with UDF with respect to Duct Area famon FLUENT 1 November 25, 2014 10:42
Problem in UDF time dependent vloumetric heat source eng_yasser_2020 Fluent UDF and Scheme Programming 0 March 30, 2014 08:07
UDF for a time varying heat flux boundary condition B.Hamada Fluent UDF and Scheme Programming 4 November 27, 2013 04:44
Space- and time-dependant heat flux via UDF flotus1 Fluent UDF and Scheme Programming 4 September 10, 2012 08:00


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