|
[Sponsors] |
User defined function for backflow temperature in fluent |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 10, 2012, 15:58 |
User defined function for backflow temperature in fluent
|
#1 |
New Member
Harshit Dahiya
Join Date: Apr 2012
Posts: 8
Rep Power: 14 |
Hello everyone,
I am looking forward for making a UDF that calculates the area-weighted average of all the faces where backflow doesn't occurs and assign it as the backflow temperature. I have never done coding in fluent before, therfore I have the algo in my mind but couldn't find apt commands. Can someone please brief me with some commands that will be useful to me and also there uses. I will greatly appreciate your help. Harshit. |
|
January 29, 2013, 21:21 |
|
#2 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
Here's a code that calculates the arithmetic mean temperature of outgoing flow in the x direction. It's ok if the outlet cell faces have the same area. Then the mean T is used in a profile.
#include "udf.h" real T_mean; DEFINE_ADJUST(u_outflow, domain,t) { real T_tot; real u; real counter = 0; face_t f; int ID = 20; /* outlet ID displayed in Fluent boundary conditions panel */ Thread *thread; thread = Lookup_Thread(domain, ID); begin_f_loop(f, thread) { u = F_U(f,thread); /* x velocity */ if (u >= 0) { T_tot += F_T(f,thread); counter = counter + 1; } } end_f_loop(f,thread) T_mean = T_tot/counter; /* arithmetic mean T of outflow */ } DEFINE_PROFILE(T_backflow, thread, position) { face_t f; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = T_mean; } end_f_loop(f, thread) } |
|
January 29, 2013, 21:22 |
|
#3 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
Nevermind the present post, I can't find how to erase it.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User Defined function for scalar gradient caculation with Star ccm+ V4 | coolio | STAR-CCM+ | 4 | August 11, 2023 06:38 |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
Question about user defined memories in FLUENT 6.3 | lordofnoldor | FLUENT | 0 | August 18, 2011 11:17 |
user defined function for thermoacoustic primemover | nmhariharan | Fluent UDF and Scheme Programming | 0 | January 6, 2011 02:49 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |