|
[Sponsors] |
December 11, 2021, 10:59 |
inlet temp based on outlet temp
|
#1 |
New Member
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5 |
Hello every one ...
My udf code which i prepared it to calculate inlet temp based on outlet temp always give me intial temp of inlet condition 4.7 k but i need it 288.15 k so what is the problem ? This My code .. #include "udf.h" #define Q 5600 #define m 0.283 #define Cp 4200 #define stop_time 252000 real ave_T; DEFINE_ADJUST(temp_ave, domain) { int ID = 16; int i=0; real total_temp = 0; real T; Thread *thread = Lookup_Thread(domain, ID); face_t face; begin_f_loop(face, thread) { T = F_T(face, thread); total_temp = total_temp + T; i = i + 1; } end_f_loop(face, thread) ave_T = total_temp / i ; printf("outlet average of temp : %f\n" , ave_T); } DEFINE_PROFILE(Temp_inlet,t,i) { face_t f; real current_time; current_time=CURRENT_TIME; if (current_time < stop_time) { begin_f_loop(f,t) { F_PROFILE(f,t,i)= (Q/(m*Cp)) + ave_T; } end_f_loop(f,t) } else { begin_f_loop(f,t) { F_PROFILE(f,t,i)= 288.15; } end_f_loop(f,t) } } |
|
December 12, 2021, 04:04 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
What is the reported outlet temperature?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
December 12, 2021, 07:47 |
|
#3 |
New Member
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5 |
There are no outlet temp at starting this is logic as there are no flow occur yet but in report file at Tin=4.7 k , Tout=288.15 k...
I think Tin =4.7K get from heat equation at I=0... |
|
December 12, 2021, 08:56 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Your answer is unclear. Let me ask in a different way.
Your code contains the following line: Code:
printf("outlet average of temp : %f\n" , ave_T);
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
December 12, 2021, 15:49 |
|
#5 |
New Member
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5 |
Yes I see it and it give me average outlet temp
|
|
December 12, 2021, 18:07 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Yes, I know that. My question is what it is showing. I can not see your screen...
I guess that it shows 288.15, but it would really be helpful if you can just confirm that, so I don't have to guess... Exactly what do you see on your screen? Copy the text, make a screenshot, just be clear and don't let us guess...
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
December 13, 2021, 02:28 |
|
#7 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you code is valid for single core computation only
__________________
best regards ****************************** press LIKE if this message was helpful |
|
December 15, 2021, 17:25 |
|
#8 |
New Member
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5 |
I don’t understand what you mean
|
|
December 15, 2021, 17:42 |
|
#9 |
New Member
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5 |
I will clear this code ..
I want from this code to do process called thermal response test For geothermal heat pump this process use water as a fluid there are initial value for inlet temp which is equal =288.15 K this fluid with this temp passes through earth and then cooled and exit from pipe with temp = Tout and then I calculate Tin again from heating equation and fluid inlet again to earth (value of Tin will be more accurate ) and so on .... When I interpret this UDF code and click on initialization and choose inlet condition I found Tin 4.7 k and the solution start from this point this will take more iteration to get correct value of Tin .... |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
twoPhaseEulerFoam confined plunging jet simulation failed | ves | OpenFOAM Running, Solving & CFD | 2 | June 17, 2020 06:08 |
[blockMesh] Changing Inlet Outlet Surfaces without Re-meshing | noodleluvmay | OpenFOAM Meshing & Mesh Conversion | 3 | February 20, 2020 12:38 |
natural convection in square cavity having inlet and outlet | sujeet | OpenFOAM Running, Solving & CFD | 1 | November 2, 2019 03:17 |
simpleFoam: Non-uniform mesh near inlet & outlet causes incorrect velocity profile? | Zaphod'sSecondHead | OpenFOAM Running, Solving & CFD | 0 | January 28, 2015 06:17 |
VOF Outlet boundary condition in cfd - ace | JM | Main CFD Forum | 0 | December 15, 2006 09:07 |