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

inlet temp based on outlet temp

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2021, 10:59
Question inlet temp based on outlet temp
  #1
New Member
 
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5
Ahmed kandil is on a distinguished road
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)
}
}
Ahmed kandil is offline   Reply With Quote

Old   December 12, 2021, 04:04
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   December 12, 2021, 07:47
Default
  #3
New Member
 
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5
Ahmed kandil is on a distinguished road
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...
Ahmed kandil is offline   Reply With Quote

Old   December 12, 2021, 08:56
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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);
What does this line give as output? Do you see it showing up in your console?
__________________
"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".
pakk is offline   Reply With Quote

Old   December 12, 2021, 15:49
Default
  #5
New Member
 
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5
Ahmed kandil is on a distinguished road
Yes I see it and it give me average outlet temp
Ahmed kandil is offline   Reply With Quote

Old   December 12, 2021, 18:07
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   December 13, 2021, 02:28
Default
  #7
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
you code is valid for single core computation only
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 15, 2021, 17:25
Default
  #8
New Member
 
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5
Ahmed kandil is on a distinguished road
I don’t understand what you mean
Ahmed kandil is offline   Reply With Quote

Old   December 15, 2021, 17:42
Default
  #9
New Member
 
AHMED KANDIL
Join Date: Oct 2021
Posts: 14
Rep Power: 5
Ahmed kandil is on a distinguished road
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 ....
Ahmed kandil 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
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


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