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

Average Temperature

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 21, 2017, 13:34
Default Average Temperature
  #1
New Member
 
Join Date: Jan 2014
Posts: 10
Rep Power: 12
FRibeiro is on a distinguished road
Hi,

I am simulating a sub-channel flow (in a nuclear reactor), so I have 4 domains (fuel, gap, clad and fluid).
I have a volumetric heat generation into the fuel and I and to calculate the fluid average temperature by using a UDF.

I wrote something like that:

#include "udf.h"

DEFINE_TEMPERATURA(temp_ave_fluid)

{
Domain *d;
cell_t c;
Thread *tc;
ind ID = 30; */ ID of the domain fluid
d = Get_Domain(1);
real volume = 0.0;
real temper = 0.0;
real temperature_fluid;
tc = Lookup_Thread(d,ID);

begin_c_loop(c,tc)
{
volume = C_VOLUME(c,tc);
temper += C_T(c,tc)*C_VOLUME(c,tc);
vol_tot += volume;
tsum += temper
}
end_c_loop(c,tc)

temperature_fluid=tsum/vol_tot;

printf("\n Temperature sonde: %e K \n , temperature_fluid);

}

But I can not interpret the UDF, Fluent says:
"unterminated string or character constant"
"possible real start of unterminated constant"
"line 7: parse error"

Could someone helps me? Please

Thanks
FRibeiro is offline   Reply With Quote

 

Tags
t average, udf


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
heat transfer coefficient value in floefd jason kid FloEFD, FloWorks & FloTHERM 10 October 16, 2016 16:55
Anys Average temperature apo FLUENT 2 November 4, 2014 12:31
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 01:27
Is wall ajacent temperature equal to conservative temperature of the wall? shenying0710 CFX 8 January 4, 2013 04:03
average interior temperature less than the operating temperature Naher FLUENT 4 March 31, 2011 23:14


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