|
[Sponsors] |
September 25, 2015, 05:09 |
a problem about P_FLOW_RATE(p)
|
#1 |
New Member
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11 |
I use the DEFINE_DPM_INIT macro to define the initial flow rate of particles, and use DEFINE_DPM_BC macro and global variables to get the information of outlet particles, such as particle no. and total mass.
the question is, when I set the P_FLOW_RATE(p) larger than 1, it shows the total mass of particles is 0, but the particle no. is as usual. I check the velocity of particles in particle tracks, and find out that the initial velocity(3m at first) of some particles is larger than 5000. how can I solve it? thanks a lot. the simplification program as following: #include "udf.h" #include "dpm.h" #include "global.h" static int PN=0; static int pn=0; static double PMASS=0.; static double pmass=0.; DEFINE_DPM_BC(test1, p,t,f,f_normal,dim) { int i=0; PN++; pn=PN; PMASS+=P_FLOW_RATE(p) pmass=PMASS; return PATH_ABORT; } DEFINE_DPM_INIT(test2,I) { Particle *p; loop(p,I->p) { P_VEL(0)=0; P_VEL(1)=0; P_VEL(2)=-3; P_DIAM(p)=0.01; P_T(p)=300; P_FLOW_RATE(p)=2; } } DEFINE_ADJUST(time,domain) { PN=0; PMASS=0; } |
|
September 27, 2015, 18:07 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The format of the particle velocity macro is P_VEL(p)[i] where p is the pointer to the tracked particle and i is the position (i = 0 for x etc). It's good practice to include trailing periods on numbers intended as real numbers (otherwise they may or may not be implicitly cast from an integer).
|
|
September 27, 2015, 21:33 |
|
#3 | |
New Member
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Gambit - meshing over airfoil wrapping (?) problem | JFDC | FLUENT | 1 | July 11, 2011 06:59 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 15:52 |