|
[Sponsors] |
UDF : GetPlane AreaAverageTemperature ver 17.2 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 1, 2020, 03:13 |
UDF : GetPlane AreaAverageTemperature ver 17.2
|
#1 |
New Member
Join Date: Aug 2018
Posts: 18
Rep Power: 7 |
Hi.
i'm new at UDF coding by fluent. I use fluent ver 17.2. I'm very worried about UDF coding, because there's no kind reference... I wanna make UDF following steps. 1. get areaAveragedPlaneTemperature of a plane surface. 2. using value of 1, calculate heat source (by using Temperature polynomial ) 3. using value of 2, adapt heat source to one cell zone. I'll use this UDF in transient calculation. Does anyone know how do I do it ? if you have any sample code, please show me... reagrd. |
|
April 1, 2020, 03:25 |
Udf
|
#2 |
Senior Member
|
Refer Fluent's UDF manual for details. Here are the hints (I am assuming you know C basics)
1. Use DEFINE_ADJUST and begin_f_loop{}end_f_loop to loop over the boundary for which you want area averaged temperature. Do note that this can only be done on boundaries defined in Fluent's Boundary Conditions Panel. If it is to be done on a plane surface, then you can still do it but not by using begin_f_loop{}end_f_loop. 2. Store the averaged value in a global C variable. 3. Use DEFINE_SOURCE to calculate source value. DEFINE_SOURCE automatically goes to each cell. Hence, each cell can have a different value of source. The averaged value stored in global C variable can be fetched in this code and used in calculation. If you are using latest version, you may not require a UDF for this. Expressions might work. https://www.afs.enea.it/project/nept...f/main_pre.htm
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 1, 2020, 04:30 |
plane surface ...
|
#3 |
New Member
Join Date: Aug 2018
Posts: 18
Rep Power: 7 |
vinerm, thanks for your quick reply.
I wanna calc average Temp to plane surface. how can I get average Temperature without using begin-end_f-loop? thanks for your information about Expressions. If i cannot make UDF correctly, I'll consider to use recent version of FL. |
|
April 1, 2020, 04:36 |
Temperature
|
#4 |
Senior Member
|
Look at the examples given at
https://www.afs.enea.it/project/nept...udf/node20.htm C_CENTROID returns the (x y z) coordinates of a cell and C_T returns its temperature. By using the coordinates, you can check if it lies within the vicinity of the plane or not and then consider its temperature. Since the plane may not pass exactly through the centers of the cells, you will have to do some interpolation. Therefore, easiest would be to use an interior boundary for averaging. Or define a three-dimensional region for averaging instead of a plane. Then you can just use volume averaging.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
Tags |
fluent 17.2 udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
udf for one dimensional linear motion based on force | maccheese | Fluent UDF and Scheme Programming | 2 | September 1, 2019 02:18 |
Save output of udf in another udf! | JuanJoMex | FLUENT | 0 | February 8, 2018 12:43 |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 00:53 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 22:14 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 04:01 |