|
[Sponsors] |
I receive "temperature limited to ... " after I Compile and Hook my UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 13, 2016, 10:45 |
I receive "temperature limited to ... " after I Compile and Hook my UDF
|
#1 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
Hello everyone!
I am trying to apply a time-varying temperature boundary condition to the inlet boundary of my porous zone geometry by reading the temperature values from a data file (.txt). My C file and the text file that I read from are attached. After I compile the UDF and Hook the read_data function, this message shows up in Console: “temperature limited to 1.000000e+00 in 141630 cells on zone 4” Zone 4 is my porous zone. My temperature limit setting is from 1K to 5000K. I don’t face this problem when I set constant inlet BC or when I don’t have a read_data function in the UDF. Does anybody have any idea what could be the problem? |
|
June 13, 2016, 11:46 |
Additional info ...
|
#2 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
I tried to make the meshing finer but I still received the same notice except with larger number of cells on the porous zone ( 192779 instead of 141630, mesh is denser)!
Please share your thinking with me ... |
|
June 14, 2016, 04:18 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Try to print the temperature to see if it is read in the way that you intended:
Code:
DEFINE_PROFILE(Tinlet, thread, position) { face_t f; real t = CURRENT_TIME*pow(1,-1); int i = t; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = Temp[i]; } end_f_loop(f, thread) Message("Temp = %f\n",Temp[i]); } |
|
June 14, 2016, 09:35 |
|
#4 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
I tried! It doesn't read it correctly. It lists out only Temp = 0.000000 in the TUI.
|
|
June 14, 2016, 09:42 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
And the following?
Code:
Message("t=%f, i=%d, Temp = %f\n",t,i,Temp[i]); |
|
June 14, 2016, 09:57 |
|
#6 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
Yes I did Hook the read-data function.
It prints t=0.000000, i=0, Temp = 0.000000 So it doesn't go trough the loop at all! right? |
|
June 14, 2016, 10:03 |
|
#7 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I think the problem is in your read_data.
In the following line: Code:
fscanf(fp,"%ld", &Temp[i]); Maybe: Code:
fscanf(fp,"%f", &Temp[i]); Message("Read: %f\n",Temp[i]); |
|
June 14, 2016, 10:25 |
|
#8 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
It is still same as before
it shows Read: 0.000000 for Message("Read: %f\n",Temp[i]); and t=0.000000, i=0, Temp = 0.000000 for Message("t=%f, i=%d, Temp = %f\n",t,i,Temp[i]); I don't understand what is the problem ? because my code works if I introduce Temp[i] as a function of time rather than using DEFINE_INIT(read_data, d) application. |
|
June 14, 2016, 10:42 |
|
#9 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The problem is in your read_data.
You are not reading the file properly. So of course it works if you skip this step and put the data directly in the sourcefile... You see: Quote:
You defined TEMP as a double, so you have to read it as a double. I don't remember exactly the code to do this, google for it. My next guess would be this: Code:
fscanf(fp,"%lf", &Temp[i]); |
||
June 14, 2016, 11:09 |
|
#10 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
You were right!
Problem Solved! Thank you so much! |
|
June 14, 2016, 11:12 |
|
#11 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Nice.
|
|
March 15, 2019, 09:59 |
|
#12 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
I have been working on a heat exchanger problem in which the molten metal kept stationary in outer shell of a concentric tube and a fluid is flowing in the inner tube. I am using UDS scalars to define temperature and velocity but results do not show any variation in temperature profile of fluid part(even if flow is there) and remains same as the stationary fluid kindly provide me some hint regarding this problem Thanks in Advance |
||
Tags |
define_init, function hookes, read data, temperature limited |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 07:05 |
UDF programming | fullmonty | FLUENT | 5 | June 30, 2011 03:40 |
interpret or compile an UDF (emergency) | Lotfi | FLUENT | 1 | August 26, 2007 13:58 |
Compile the UDF | Eric | FLUENT | 7 | August 18, 2006 15:46 |