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

Calculating Bulk Temperature-UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2013, 18:56
Default Calculating Bulk Temperature-UDF
  #1
Senior Member
 
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Dear Friends,

I have written a piece of UDF to compute bulk mean temperature inside a 2-D straight pipe with structured grid. I hope it comes to work.


begin_f_loop(f,t0)
{
F_AREA(x2,f,t0);
F_CENTROID(x,f,t0);
BD = x[0];
thread_loop_c(t,d)
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c,t) /* loops over cells in a cell thread */
{
C_CENTROID(xc,c,t);
if (ABS(xc[0]-BD) < 0.5*NV_MAG(x2))
{
AREA = C_VOLUME(c,t)/(NV_MAG(x2)*ABS(x2[1]));
S_T = S_T + C_T(c,t)*C_R(c,t)*C_U(c,t)*AREA;
S_V = S_V + C_R(c,t)*C_U(c,t)*AREA;
}
}
end_c_loop(c,t)
}
}
T_AVE = S_T/S_V;
S_T = 0.0;
S_V = 0.0;
C_UDMI(F_C0(f,t0),THREAD_T0(t0),0) = T_AVE;
}
end_f_loop(f,t0)

Last edited by syavash; August 27, 2013 at 05:44.
syavash is offline   Reply With Quote

Old   March 19, 2019, 08:04
Default Bulk mean temperature
  #2
New Member
 
Vilas
Join Date: Oct 2018
Location: Pune maharashtra,india
Posts: 13
Rep Power: 8
tadevilas is on a distinguished road



Hello sir.
I'm trying to do simulation for synthetic jet (3D) and I want to find out the bulk mean temperature of air. I attached the image of synthetic jet (3D) please go through it. Can you please me for it, I'm not used any udf for this.
tadevilas is offline   Reply With Quote

Old   September 4, 2019, 15:13
Default
  #3
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
Quote:
Originally Posted by syavash View Post
Dear Friends,

I have written a piece of UDF to compute bulk mean temperature inside a 2-D straight pipe with structured grid. I hope it comes to work.


begin_f_loop(f,t0)
{
F_AREA(x2,f,t0);
F_CENTROID(x,f,t0);
BD = x[0];
thread_loop_c(t,d)
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c,t) /* loops over cells in a cell thread */
{
C_CENTROID(xc,c,t);
if (ABS(xc[0]-BD) < 0.5*NV_MAG(x2))
{
AREA = C_VOLUME(c,t)/(NV_MAG(x2)*ABS(x2[1]));
S_T = S_T + C_T(c,t)*C_R(c,t)*C_U(c,t)*AREA;
S_V = S_V + C_R(c,t)*C_U(c,t)*AREA;
}
}
end_c_loop(c,t)
}
}
T_AVE = S_T/S_V;
S_T = 0.0;
S_V = 0.0;
C_UDMI(F_C0(f,t0),THREAD_T0(t0),0) = T_AVE;
}
end_f_loop(f,t0)
Dear syavash
which type of macro we should add to upper of code?
Quote:
#include "udf.h“
DEFINE_***(TBULK,t0)
Hgholami is offline   Reply With Quote

Old   September 4, 2019, 23:09
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
code above is wrong

you may find good base to define mean temperature in Ansys FLuent Customization manual
look for DEFINE_ON_DEMAND macro -> example

best regards
Hgholami likes this.
AlexanderZ is offline   Reply With Quote

Reply


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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 08:15
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 02:27
UDF or any approach for Bulk Temperature calculation vemps FLUENT 0 May 1, 2009 02:09
UDF velocity and temperature Raj FLUENT 3 February 1, 2009 19:29
how to write a 3D linear temperature of UDF venus FLUENT 1 October 28, 2008 03:46


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