|
[Sponsors] |
November 14, 2021, 11:20 |
UDF problem to obtain maximum temperature
|
#1 |
New Member
Erfan
Join Date: Oct 2021
Posts: 14
Rep Power: 5 |
Hello all
I use a udf to obtain the maximum temperature in each timestep and use it in another udf.to get the maximum temperature I wrote this udf: Code:
real tmax=0.; DEFINE_ON_DEMAND(on_demand_calc) { Domain *d; real temp; Thread *t; cell_t c; d = Get_Domain(1); /* Get the domain using ANSYS Fluent utility */ /* Loop over all cell threads in the domain */ thread_loop_c(t,d) { /* Compute max temperature */ /* Loop over all cells */ begin_c_loop(c,t) { temp = C_T(c,t); /* get cell temperature */ if (temp > tmax || tmax == 0.) tmax = temp; } end_c_loop(c,t) printf("\n Tmax = %g ",tmax); } } Can anyone Help me please or it will work properly? P.S: My case consist of several zones. thanks in advanced |
|
November 15, 2021, 00:20 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
parallelize your code, make it works on several nodes
more information in ansys fluent customization manual
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 15, 2021, 06:19 |
|
#3 |
New Member
Erfan
Join Date: Oct 2021
Posts: 14
Rep Power: 5 |
thank you Alexander for your help but as I'm not an expert in writing a UDF I want to know if my code works properly without any changes then I just use it.
In the first timesteps, the last printed tmax for each timestep was correct. |
|
November 16, 2021, 01:03 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
as you are not an expert in writing a UDF, you've asked question here, got an answer.
now you can follow recommendations or ignore
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
tmax, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
temperature store and monitoring UDF | indsujin | Fluent UDF and Scheme Programming | 1 | July 9, 2021 05:08 |
UDF problem- time dependent temperature at inlet | kaeran | FLUENT | 1 | June 16, 2015 22:48 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 07:56 |
UDF Wall Temperature Problem - Coordinates | Marc | FLUENT | 1 | July 3, 2008 12:10 |