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

User defined function for backflow temperature in fluent

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By macfly

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2012, 15:58
Smile User defined function for backflow temperature in fluent
  #1
New Member
 
Harshit Dahiya
Join Date: Apr 2012
Posts: 8
Rep Power: 13
harshit is on a distinguished road
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.
harshit is offline   Reply With Quote

Old   January 29, 2013, 21:21
Default
  #2
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
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)
}
GM_XIII likes this.
macfly is offline   Reply With Quote

Old   January 29, 2013, 21:22
Default
  #3
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
Nevermind the present post, I can't find how to erase it.
macfly is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
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


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