|
[Sponsors] |
Computing Average Temperature using DEFINE_ADJUST macro |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 17, 2009, 06:54 |
Computing Average Temperature using DEFINE_ADJUST macro
|
#1 |
New Member
Join Date: Mar 2009
Posts: 15
Rep Power: 17 |
Hi!
I have the following 2D channel geometry, like my previous post: ..............____________________________ heat --> |............................................ | flux ---> |____________________________| fluid ---> ----------------axis-------------------- ..............____________________________ heat --> |............................................ | flux ---> |____________________________| I want to compute the average temperature of the walls (solid), in a transient analysis. First, I define a User-Defined Memory (Define-->User-Defined-->Memory...) Then I patch the value 1 for the User Memory O to the Solid Zone. Then I wrote the following code using the DEFINE_ADJUST macro, hooked it, but when I start the iterations I get: "Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()" What's wrong in my code? Thanks in advance. Explaining the code: In every iteration, if a region has a value > 0.5 for UDMI 0 (solid has the value 1, fluid 0), the code computes the sum of temperatures for this region, and then the average value. Code:
/***************************************************/ /* User-Defined Function for computing Solid Average Temperature */ /***************************************************/ #include "udf.h" DEFINE_ADJUST(my_adjust,d) { real n = 0.; real Tsum = 0.; real T_AVG = 0.; Thread *t; cell_t c; real flag = C_UDMI(c,t,0); thread_loop_c(t,d) { begin_c_loop(c,t) if (flag > 0.5) { Tsum = Tsum + C_T(c,t); n = n + 1; } end_c_loop(c,t) } T_AVG = Tsum/n; } |
|
Tags |
define_adjust, temperature average value, temperature summary value, udmi |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TEMPERATURE-AVERAGE | mech | FLUENT | 1 | April 25, 2007 16:06 |
Temperature Average | Danny | FLUENT | 0 | May 3, 2005 05:47 |
Define_Adjust Macro | Mahesh | FLUENT | 0 | November 10, 2004 05:54 |
average temperature | mehravar | FLUENT | 2 | January 1, 2004 00:43 |
Bug in the DEFINE_ADJUST macro? | Senthil | FLUENT | 5 | September 3, 2002 22:26 |