|
[Sponsors] |
December 23, 2015, 14:00 |
UDF for time dependent heat flux
|
#1 |
New Member
Join Date: Dec 2015
Posts: 2
Rep Power: 0 |
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) } } |
|
January 2, 2016, 18:53 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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). |
|
January 2, 2016, 19:29 |
|
#3 |
New Member
Join Date: Dec 2015
Posts: 2
Rep Power: 0 |
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. |
|
August 7, 2019, 03:20 |
|
#4 |
New Member
Azim Memon
Join Date: Jul 2019
Posts: 12
Rep Power: 7 |
Rontgen can you please send your UDF which ran without error?
|
|
August 8, 2019, 01:56 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
#include "udf.h" DEFINE_PROFILE(HeatPulse, t, i) { face_t f; real time=0; real q; time=CURRENT_TIME; if ((time>=0.05)&&(time<=0.06)) q=10000; else q=0; begin_f_loop (f,t) { F_PROFILE(f,t,i) = q; } end_f_loop(f,t) } |
|
August 8, 2019, 04:04 |
|
#6 |
New Member
Azim Memon
Join Date: Jul 2019
Posts: 12
Rep Power: 7 |
Thanks a lott Alaxender
|
|
Tags |
fluent, heat flux, udf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for a time varying heat flux boundary condition | B.Hamada | Fluent UDF and Scheme Programming | 9 | August 8, 2018 13:51 |
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 09:07 |
Space- and time-dependant heat flux via UDF | flotus1 | Fluent UDF and Scheme Programming | 4 | September 10, 2012 09:00 |