|
[Sponsors] |
help in udf i need export ave temperature on outlet to inlet to next step |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 16, 2022, 11:26 |
help in udf i need export ave temperature on outlet to inlet to next step
|
#1 |
Senior Member
Marcin
Join Date: May 2014
Location: Poland, Swiebodzin
Posts: 313
Rep Power: 13 |
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/ |
|
December 19, 2022, 02:03 |
|
#2 |
Senior Member
Marcin
Join Date: May 2014
Location: Poland, Swiebodzin
Posts: 313
Rep Power: 13 |
can anyone help ??/
__________________
Quick Tips and Tricks, Tutorials FLuent/ CFX (CFD) https://howtooansys.blogspot.com/ |
|
December 19, 2022, 04:25 |
|
#3 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
December 19, 2022, 05:27 |
|
#4 |
Senior Member
Marcin
Join Date: May 2014
Location: Poland, Swiebodzin
Posts: 313
Rep Power: 13 |
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 .
__________________
Quick Tips and Tricks, Tutorials FLuent/ CFX (CFD) https://howtooansys.blogspot.com/ |
|
December 26, 2022, 04:33 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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) }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
export node temperature using udf | jscsgh | ANSYS | 0 | June 19, 2022 09:42 |
Inlet temperature as a function of outlet temperature UDF | wimblo | Fluent UDF and Scheme Programming | 5 | November 25, 2021 07:06 |
UDF writes the outlet temperature assignment to the inlet temperature of another calc | ZengJiChuan | FLUENT | 7 | May 27, 2020 05:14 |
Ansys Fluent UDF, Wall Average Temperature Depend On Inlet Velocity | ozgeozge | Fluent UDF and Scheme Programming | 1 | April 15, 2019 02:31 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 01:01 |