|
[Sponsors] |
April 3, 2015, 05:55 |
DEFINE_DPM_BC question~
|
#1 |
New Member
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11 |
Hi~
I want to get the average temperature of droplets in an interior in flow zone. I use DEFINE_DPM_BC macro to get the temperature of each droplets and end the status with PATH_ABORT. my question is how can I add all the droplets temperature together? tks alot~ |
|
April 3, 2015, 08:34 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Add two global variables (for example "temperaturesum" and "particlecount"), which you initialize both at one.
Just before you return PATH_ABORT, say Code:
temperaturesum+=particle->temperature; particlecount++; Message("Average temperature until now: %f.\n",temperaturesum/particlecount); |
|
April 4, 2015, 23:41 |
|
#3 | |
New Member
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11 |
Quote:
Tks for your response~ I have tried this method~it works~ but there‘s another problem the temsum and count are still adding with the fluent iterations how can I reset the global variables to zero before every step? |
||
|
|