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

help in udf i need export ave temperature on outlet to inlet to next step

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 16, 2022, 10:26
Default help in udf i need export ave temperature on outlet to inlet to next step
  #1
Senior Member
 
Martin_Sz's Avatar
 
Marcin
Join Date: May 2014
Location: Poland, Swiebodzin
Posts: 232
Rep Power: 12
Martin_Sz is on a distinguished road
Hello
Can Anyone help me to make udf file to export average temperature on outlet from previous step to inlet in next step - transient simulation
Best regards
__________________
Quick Tips and Tricks, Tutorials FLuent/ CFX (CFD)
https://howtooansys.blogspot.com/
Martin_Sz is offline   Reply With Quote

Old   December 19, 2022, 01:03
Default
  #2
Senior Member
 
Martin_Sz's Avatar
 
Marcin
Join Date: May 2014
Location: Poland, Swiebodzin
Posts: 232
Rep Power: 12
Martin_Sz is on a distinguished road
can anyone help ??/
__________________
Quick Tips and Tricks, Tutorials FLuent/ CFX (CFD)
https://howtooansys.blogspot.com/
Martin_Sz is offline   Reply With Quote

Old   December 19, 2022, 03:25
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
show the code you have, explain problems with it, compilation log, domain geometry, do your boundaries have the same mesh or not
__________________
best regards


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

Old   December 19, 2022, 04:27
Default
  #4
Senior Member
 
Martin_Sz's Avatar
 
Marcin
Join Date: May 2014
Location: Poland, Swiebodzin
Posts: 232
Rep Power: 12
Martin_Sz is on a distinguished road
So in the attachment U have schematic of my model with boundary conditions
I need to make recirculating gas over two gas domains and one porous , so that i need a average temeprature from outlet (domain 2 - previous step) to import on inlet to next step (domain 1 gas).
Mesh is different on outlet and inlet - different areas .
Attached Images
File Type: png BCs.png (92.6 KB, 8 views)
__________________
Quick Tips and Tricks, Tutorials FLuent/ CFX (CFD)
https://howtooansys.blogspot.com/
Martin_Sz is offline   Reply With Quote

Old   December 26, 2022, 03:33
Default
  #5
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 should define initial temperature, which will be applied (tavg = 300 K in code)
at define correct ID number for the outlet boundary from your model (you can find it in fluent GUI)
compile code
Code:
#include "udf.h"
real tavg = 300.;
int outlet_id = 11;

DEFINE_EXECUTE_AT_END(get_outlet_t)
{
Domain *d; /* declare domain pointer since it is not passed as an
argument to the DEFINE macro */

real temp,volume,vol_tot;
Thread *t;
cell_t c;

d = Get_Domain(1); /* Get the domain using ANSYS Fluent utility */
/* Loop over all cell threads in the domain */
t = Lookup_Thread (d, outlet_id);
tavg = 0.;
/* Loop over all cells */
begin_c_loop(c,t)
{
volume = C_VOLUME(c,t); /* get cell volume */
temp = C_T(c,t); /* get cell temperature */
vol_tot += volume;
tavg += temp*volume;
}
end_c_loop(c,t)
#if RP_NODE
vol_tot = PRF_GRSUM1(vol_tot);
tavg = PRF_GRSUM1(tavg);
#endif
tavg /= vol_tot;
Message0("\n Tavg = %f\n",tavg);
/* Compute temperature function and store in user-defined memory*/
/*(location index 0) */
}

DEFINE_PROFILE(inlet_temperature, t, position)
{
face_t f;
begin_f_loop(f,t)
{
F_PROFILE(f, t, position) = tavg;
}
end_f_loop(f, t)
}
Martin_Sz likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
export node temperature using udf jscsgh ANSYS 0 June 19, 2022 08:42
Inlet temperature as a function of outlet temperature UDF wimblo Fluent UDF and Scheme Programming 5 November 25, 2021 06:06
UDF writes the outlet temperature assignment to the inlet temperature of another calc ZengJiChuan FLUENT 7 May 27, 2020 04:14
Ansys Fluent UDF, Wall Average Temperature Depend On Inlet Velocity ozgeozge Fluent UDF and Scheme Programming 1 April 15, 2019 01:31
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 00:01


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