CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   concentration (https://www.cfd-online.com/Forums/fluent/31638-concentration.html)

Umesh Shah June 11, 2003 11:00

concentration
 
Does anyone know how to get the DPM concentraion in each cell of the domain?

Alex Munoz June 11, 2003 14:28

Re: concentration
 
Hi

There isnot a direct macro that can report the number of particles in each cell ( at least that I am aware of). However, you can write a UDF where you count the number of particles in a cells as follow:

There is a macro P_CELL(p) ---cell index of the cell that the particle is currently in---

Then you can count the number of particles in each cell through the whole domain.

I hope I could help you

Alex Munoz

Umesh Shah June 11, 2003 14:57

Re: concentration
 
Hi Alex,

Thanx for your help. I hope u can help me more for the same. Now u know, we can get DPM concentrarion contours. What does that mean is, Fluent has some variables which store Particle concentration value for each cell.

On the otherside, I have looked on to the option of counting no. of particles in each cell. But I didn't find it possible or better to say found very difficult. Can U help me giving some hints regarding?

Alex Munoz June 12, 2003 00:04

Re: concentration
 
Hi

First at all, Fluent user's guide define DPM concentration as the total concentration of discrete phase, and its unit quantity is density.

As I understood DPM concentration gives you the mass of discrete phase per control volume.

As a results you can get both the P_MASS(p) at the current position and the C_VOLUME(c,t)

For instance if you want to get the concentration at the end of a time step or iteration you can write a UDF simmilar to this example in fluent

/************************************************** *********

Example UDF that demonstrates DEFINE_DPM_SPRAY_COLLIDE ************************************************** **********/ #include "udf.h" #include "dpm.h" #include "surf.h"

DEFINE_DPM_SPRAY_COLLIDE(udf_man_spray_collide, tp, p) { /* non-physical collision UDF that relaxes the particle */ /* velocity and diameter in a cell to the mean over the */ /* specified time scale t_relax */

const real t_relax = 0.001; /* seconds */

/* get the cell and Thread that the particle is currently in */ cell_t c = RP_CELL(&(tp->cCell)); Thread *t = RP_THREAD(&(tp->cCell));

/* Particle index for looping over all particles in the cell */ Particle *pi;

/* loop over all particles in the cell to find their mass */ /* weighted mean velocity and diameter */ int i; real u_mean[3]={0.}, mass_mean=0.; real d_orig = tp->state.diam; real decay = 1. - exp(-t_relax); begin_particle_cell_loop(pi,c,t)

{

mass_mean += pi->state.mass;

for(i=0;i<3;i++)

u_mean[i] += pi->state.V[i]*pi->state.mass;

} end_particle_cell_loop(pi,c,t)

/* relax particle velocity to the mean and diameter to the */ /* initial diameter over the relaxation time scale t_relax */ if( mass_mean > 0. )

{

for(i=0;i<3;i++)

u_mean[i] /= mass_mean;

for(i=0;i<3;i++)

tp->state.V[i] += decay*( u_mean[i] - tp->state.V[i] );

tp->state.diam += decay*( P_INIT_DIAM(tp) - tp->state.diam );

/* adjust the number in the droplet parcel to conserve mass */

tp->number_in_parcel *= CUB( d_orig/tp->state.diam );

} }

================================================= see in this example how they get the cell index throgh the macro cell_t c = RP_CELL(&(tp->cCell)); Thread *t = RP_THREAD(&(tp->cCell));

and then how they loop over all the particles in the cell to find their mass, you can define a "real conc"to calculate the concentation on that cell as follow

begin_particle_cell_loop(pi,c,t)

{

mass_mean += pi->state.mass;

conc=mass_mean/C_volume(c,t)

C_UDMI(c,t,UDM_RH)=conc; } end_particle_cell_loop(pi,c,t)

do not forget a pointer to the particle Particle *pi; ================================================== = The only doubt that I have is if this DPM macro will allow to print the concentration.

I guess you can define a UDM to store the value (donot forget to define a UDM_RH (i.e.#define UDM_RH 0) ================================================== == I cannot help you more, you have to work on your own to implement the UDF

Best regards

Alex Munoz

Umesh Shah June 12, 2003 15:10

Re: concentration
 
Many thanx for yr help.

Umesh

Alex Munoz June 12, 2003 15:17

Re: concentration
 
Hi

Let me know if it work!! Just I still having some doubt of which DPM macro to use for this purpose.

Fluent does not provide an especific DPM macro meither for the concentration nor for UDF estimation.

Regards

Alex Munoz

cg June 12, 2003 20:05

Re: concentration
 
Fluent stores the DPM concetration in the variable:

C_STORAGE_R(c,t,SV_DPMS_CONCENTRATION)

Umesh Shah June 16, 2003 13:07

Re: concentration
 
Do U know what value C_STORAGE_R(c,t,SV_DPMS_CONCENTRATION) returns?

Does it return, kg_of_DPM/c_volume

or kg_of_DPM/unit_volume.

cg June 17, 2003 13:35

Re: concentration
 
kg / m^3 == kg_of_DPM/c_volume


All times are GMT -4. The time now is 01:10.