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

a problem about P_FLOW_RATE(p)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2015, 04:09
Default a problem about P_FLOW_RATE(p)
  #1
New Member
 
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11
potatoning is on a distinguished road
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;
}
potatoning is offline   Reply With Quote

Old   September 27, 2015, 17:07
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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).
`e` is offline   Reply With Quote

Old   September 27, 2015, 20:33
Default
  #3
New Member
 
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11
potatoning is on a distinguished road
Quote:
Originally Posted by `e` View Post
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).
that's my mistake. in the program, it is P_VEL(p)[i].
potatoning 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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


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