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

Define_dpm_scalar_update

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By abolfazl

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2019, 14:11
Default Define_dpm_scalar_update
  #1
New Member
 
Ebi
Join Date: Apr 2009
Posts: 9
Rep Power: 18
abolfazl is on a distinguished road
Dear friends,

What follows is the UDF file which aims to calculate the number of "escaped" particles from the domain in a dpm (discrete phase model) problem. Although the number of those particles is reported in the Fluent console, I need that UDF file for an optimization study.


When I compile that, the following warning and error is reported by Fluent:


--------------------------------
..\..\src\particle_cells_count11.c(19): warning C4133: '=': incompatible types - from 'particle_struct *' to 'Tracked_Particle *'
..\..\src\particle_cells_count11.c(19): error C2039: 'next': is not a member of 'tracked_particle_struct'
C:\PROGRA~1\ANSYSI~1\v162\fluent\fluent16.2.0\src\ dpm\dpm_types.h(680): note: see declaration of 'tracked_particle_struct'

--------------------------------


Line number 19 was highlighted below (loop(p,I->p)).

Any idea is highly appreciated.


Thank you...
--------------------------------

#include "udf.h"
DEFINE_DPM_SCALAR_UPDATE(particle_cells_count11, cell, thread, initialize, p)
{
cell_t c;
Thread *c_t;
/*c=RP_CELL(&(p->cCell));*/
/*c_t=RP_THREAD(&(p->cCell));*/
Injection *Ilist;
Injection *I;
/*Particle *p;*/
int particles_in_the_domain = 0;
int total=950;
int e;
real iter = N_ITER;
static real iter_old = 0;
Ilist = Get_dpm_injections();
loop(I,Ilist)
{
loop(p,I->p)
{
c = P_CELL(p);
c_t = P_CELL_THREAD(p);

particles_in_the_domain+=1;
}
}
if (iter != iter_old) /* i.e. We are on a new iteration */
{
iter_old = iter;
e=total-particles_in_the_domain;
}
Message("Number of particles in the domain: %d\n",particles_in_the_domain);
Message("Number of escaped particles: %d\n",e);
}


--------------------------------


Erfan75 likes this.
abolfazl is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



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