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

Population Balance Modeling (PBM) - Ansys Fluent

Register Blogs Community New Posts Updated Threads Search

Like Tree33Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2018, 05:35
Smile
  #101
Member
 
Roy
Join Date: Sep 2017
Posts: 80
Rep Power: 8
ROY4 is on a distinguished road
Quote:
Originally Posted by chittipo View Post
Dear Members,

If you have any specific questions on PBM implementation please post here. I will try to answer them, as I gained some experience in it.

on
- Existing module (or)
- Implementation through UDF
Dear chittipo
thanks for your generous offer. I have some questions about setting PBM.
1st) What is the ratio exponent and how should I calculate it?
2nd) is number of bins number of group classes?
3rd) when I set aggregation kernel to constant there is a constant of zero. Should I define it or let it be?
4th) in boundary conditions, as the boundary value how should I know what is the value of different bins? is that defined from the initial diameter? if it is please say how?
thank you in advance
ROY4 is offline   Reply With Quote

Old   February 26, 2018, 06:54
Default
  #102
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi ROY4,

Since chittipo made that kind offer some years ago, I might as well chip in now, in case there is some delay.

(1) The ratio exponent is more or less explained in the help files: in the discretised representation of the size distribution, the size bins are defined to increase geometrically: V_{i+1} / V_i = 2^q. This q is the ratio exponent or ratio factor. (Ratio exponent is a much better name for it.) In Fluent, you are allowed only integer values of q, and in my opinion anything greater than 1 is unacceptably coarse.

(2) Number of bins = number of discrete intervals for representing the size distribution. This sounds the same as your group classes.

(3) The aggregation kernel is basically the aggregation rate constant. If you leave it at the default of zero, you will get no aggregation. If you are in the position of wanting some aggegration to occur but having no information about the rate: this is not a comfortable position. Perhaps you have some idea about the timescale over which aggregation changes the size distribution. For a constant kernel "a" and a total number concentration of particles "N", the rate of change of N due to aggregation is (0.5*a*N^2), so the timescale is of order (2/(a*N)). N should have units (particles/m^3) and a should have units (m^3/s).

(4) Well, you are defining the size distribution of the flow entering the model, so you should have some information on this. If you have a single-sized inlet size distribution, you could put all the inlet particles in one bin. (From memory, I think you supply mass fractions in each bin, totalling 1.0. I do wish the GUI and help files were clearer on this, and many other fine details.) You can find which bin you want with the Print Bins button in model setup -- you may find that the bins are in reverse order compared to what you expected. (Also, there is a distressing lack of clarity about whether the sizes you specify, and the sizes that are then reported, are the lower/upper/average/etc sizes of the intervals.) A convenient option might be to use the log-normal distribution input specification: note from the help files that the std.dev. has units of metres -- the mean and std. dev. are the overall properties of the eventual number distribution, and the geometric mean and geometric std.dev. are calculated from them. If you use the log-normal option, it is your responsibility to make sure that your range of bin sizes is appropriate -- if you fail to do this, the actual mean and std.dev. that is generated could be substantially different from what you specify.

Good luck!
Ed
BlnPhoenix likes this.
obscureed is offline   Reply With Quote

Old   February 26, 2018, 14:02
Smile
  #103
Member
 
Roy
Join Date: Sep 2017
Posts: 80
Rep Power: 8
ROY4 is on a distinguished road
Quote:
Originally Posted by obscureed View Post
Hi ROY4,

Since chittipo made that kind offer some years ago, I might as well chip in now, in case there is some delay.

(1) The ratio exponent is more or less explained in the help files: in the discretised representation of the size distribution, the size bins are defined to increase geometrically: V_{i+1} / V_i = 2^q. This q is the ratio exponent or ratio factor. (Ratio exponent is a much better name for it.) In Fluent, you are allowed only integer values of q, and in my opinion anything greater than 1 is unacceptably coarse.

(2) Number of bins = number of discrete intervals for representing the size distribution. This sounds the same as your group classes.

(3) The aggregation kernel is basically the aggregation rate constant. If you leave it at the default of zero, you will get no aggregation. If you are in the position of wanting some aggegration to occur but having no information about the rate: this is not a comfortable position. Perhaps you have some idea about the timescale over which aggregation changes the size distribution. For a constant kernel "a" and a total number concentration of particles "N", the rate of change of N due to aggregation is (0.5*a*N^2), so the timescale is of order (2/(a*N)). N should have units (particles/m^3) and a should have units (m^3/s).

(4) Well, you are defining the size distribution of the flow entering the model, so you should have some information on this. If you have a single-sized inlet size distribution, you could put all the inlet particles in one bin. (From memory, I think you supply mass fractions in each bin, totalling 1.0. I do wish the GUI and help files were clearer on this, and many other fine details.) You can find which bin you want with the Print Bins button in model setup -- you may find that the bins are in reverse order compared to what you expected. (Also, there is a distressing lack of clarity about whether the sizes you specify, and the sizes that are then reported, are the lower/upper/average/etc sizes of the intervals.) A convenient option might be to use the log-normal distribution input specification: note from the help files that the std.dev. has units of metres -- the mean and std. dev. are the overall properties of the eventual number distribution, and the geometric mean and geometric std.dev. are calculated from them. If you use the log-normal option, it is your responsibility to make sure that your range of bin sizes is appropriate -- if you fail to do this, the actual mean and std.dev. that is generated could be substantially different from what you specify.

Good luck!
Ed

Dear friend
Thank you so much for answering my questions
But I still have some other questions:

- does aggregation mean coalescence? Is Luo a good model for modeling it?

- you said that ratio exponent is better to be set less than 1. And integer. So the only value for it that is better is 1. Is this right?Because in paper I saw that q=0.76. and when I set it for pbm fluent it does not give an error. bins are printed.

- I want to model a paper. And in this paper it has just mentioned that they used Luo coalescence model. No other information about aggregation rate is given. I suppose when I'm using a model there is no need for a constant.

- By the way I am modeling a bubble column and I have 61 sparger holes that are modeled as velocity inlet. if my initial diameter is 5mm. As I understood, I should print bins and see that this diameter(5mm) falls in which bin and set the boundary value of that bin 1/61.because the summation of all these bin values should be equal to 1...is this right?

- And please tell me how can I define drag force? If I should write a UDF, in which part of the settings it should be given t the model?

Thanks alot

Last edited by ROY4; February 27, 2018 at 02:12.
ROY4 is offline   Reply With Quote

Old   February 28, 2018, 06:16
Default
  #104
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi there.

Aggregation means coalescence. It is your job to work out whether the assumptions in the Luo-Svendsen model are appropriate to your case. It is aimed at liquid-liquid droplets and bubbles, and the coalescence is assumed to be driven by turbulence. It is a theoretically based model, which has the advantage that there are no adjustable parameters, but has the disadvantage that there are no adjustable parameters (except surface tension). From memory, I think that it has a flaw that small-with-large collisions are always encouraged -- so you should not define an excessive range of sizes to be considered. (One of the authors discussed this flaw in a later paper.)

I see you are correct that ratio exponents can now be non-integer -- I think I was remembering an earlier limitation.

For the constant aggregation model, you supply a rate constant, and the default of 0 means no aggregation (which is pointless). For the Luo-Svendsen model, the rate is deduced from the surface tension and the turbulence, so you do not need to supply a rate constant.

I do not follow your logic about a value of 1/61 -- the size distribution is not an extensive quantity that is shared between all holes. I would assume the correct approach is to put 1.0 in the relevant bin.

Drag is defined in Models...Multiphase...Phase interactions. The default is Schiller-Naumann, which applies to rigid spheres. If you have large bubbles (large enough to deform into spherical caps -- several millimetres, maybe), you should consider the Grace model, etc. The size should come from the size distribution (in the definition of the secondary phase, diameter = Sauter mean). If you read up on the different options in Fluent, you probably do not need a UDF.
obscureed is offline   Reply With Quote

Old   February 28, 2018, 07:12
Default
  #105
New Member
 
Masooma
Join Date: Feb 2018
Location: spain
Posts: 2
Rep Power: 0
masoomabilal is on a distinguished road
Hello
I am a new user in CFD APOPULATION BALANCE MODELING
Initially I am trying to generate a geometry of mixing tank of width 0.12 m but when I set the dimensions it did not accept it same problem is for cm and other units same problem I am facing for impellers geometry inside the tank can any body plz help me out I tried so many comands but same error plz correct me
Thank you
Masooma
masoomabilal is offline   Reply With Quote

Old   February 28, 2018, 10:20
Default
  #106
Member
 
Roy
Join Date: Sep 2017
Posts: 80
Rep Power: 8
ROY4 is on a distinguished road
Quote:
Originally Posted by obscureed View Post
Hi there.

Aggregation means coalescence. It is your job to work out whether the assumptions in the Luo-Svendsen model are appropriate to your case. It is aimed at liquid-liquid droplets and bubbles, and the coalescence is assumed to be driven by turbulence. It is a theoretically based model, which has the advantage that there are no adjustable parameters, but has the disadvantage that there are no adjustable parameters (except surface tension). From memory, I think that it has a flaw that small-with-large collisions are always encouraged -- so you should not define an excessive range of sizes to be considered. (One of the authors discussed this flaw in a later paper.)

I see you are correct that ratio exponents can now be non-integer -- I think I was remembering an earlier limitation.

For the constant aggregation model, you supply a rate constant, and the default of 0 means no aggregation (which is pointless). For the Luo-Svendsen model, the rate is deduced from the surface tension and the turbulence, so you do not need to supply a rate constant.

I do not follow your logic about a value of 1/61 -- the size distribution is not an extensive quantity that is shared between all holes. I would assume the correct approach is to put 1.0 in the relevant bin.

Drag is defined in Models...Multiphase...Phase interactions. The default is Schiller-Naumann, which applies to rigid spheres. If you have large bubbles (large enough to deform into spherical caps -- several millimetres, maybe), you should consider the Grace model, etc. The size should come from the size distribution (in the definition of the secondary phase, diameter = Sauter mean). If you read up on the different options in Fluent, you probably do not need a UDF.
Dear obscureed
Thanks a lot for your complete answer. I really used it.
ROY4 is offline   Reply With Quote

Old   March 7, 2018, 12:06
Post
  #107
New Member
 
Roytor
Join Date: Feb 2018
Posts: 3
Rep Power: 8
roytorc is on a distinguished road
Hi,

Is it possible to use the population balance model with non-premixed combustion?

I understand that in order to enable the PBM, the multiphase model has to be turned on which makes me cannot use the non-premixed combustion in species.
roytorc is offline   Reply With Quote

Old   March 31, 2018, 09:10
Default
  #108
Member
 
Masoud Ravan
Join Date: May 2016
Location: Tehran
Posts: 59
Rep Power: 9
masoud.ravan is on a distinguished road
Hi everyone
I have two questions about Population Balance Model
1- Does anyone know the correct and derived formulation of (Lehr 2002) breakup kernel? I mentioned correct term because there is a mistake in the original paper (Eq. 11) that has been reported by YixiangLiao & DirkLucas https://doi.org/10.1016/j.ces.2009.04.026 page 3395
2- Does the Inhomogeneous PBM in Ansys CFX could consider mass transfer between velocity groups (NOT subsize groups) due to coalescence and breakup?
Thanks in Advance
masoud.ravan is offline   Reply With Quote

Old   April 4, 2018, 05:53
Default
  #109
Member
 
Masoud Ravan
Join Date: May 2016
Location: Tehran
Posts: 59
Rep Power: 9
masoud.ravan is on a distinguished road
Hi everyone

I want to implement Luo breakup frequency by UDF (DEFINE_PB_BREAK_UP_FREQ(name, cell, thread, d_1))but there is no way to calculate number density of ith size bin because we do not know that the d_1 that has been passed to UDF belongs to which size bin. If we find this, we can calculate number density of ith size bin by the relationship between number density and size fraction (C_PB_DISCI).

I would be grateful if you can help me.
nhendre likes this.
masoud.ravan is offline   Reply With Quote

Old   April 21, 2018, 04:56
Default Finding Ni and Nj
  #110
New Member
 
nilesh
Join Date: Jan 2017
Posts: 22
Rep Power: 9
nhendre is on a distinguished road
Quote:
Originally Posted by shaham View Post
Hi Chittipo,

I want to write a UDF for Luo aggregation kernel, same as the built-in one in Fluent. However, there are some problems.
Can you tell me how I can insert the "number density of bin i" into the UDF from the Fluent? Because in the DEFINE_PB_COALESCENCE_RATE macro there is no argument for number density. Is there any other way to find out the number density for bin i related to the d_1 (the argument for the macro)? even through RP_GET_REAL,...?

Thank you
Shaham
Hello Shaham,
Did you get the solution for this ?
nhendre is offline   Reply With Quote

Old   April 21, 2018, 04:57
Smile defining ni and nj in Luo model
  #111
New Member
 
nilesh
Join Date: Jan 2017
Posts: 22
Rep Power: 9
nhendre is on a distinguished road
Quote:
Originally Posted by syed_alizeb@live.com View Post
could anyone tell me how to define ni and nj in luo coalescence model via udf?
Dear Syed, did you find the solution for defining ni and nj? I am also trying to find out the solution. If yes, can you suggest how to define ni and nj.. Also please share the udf if possible
Thanks..
nhendre is offline   Reply With Quote

Old   April 21, 2018, 05:25
Default calculating ni nj
  #112
New Member
 
shaham
Join Date: Feb 2011
Posts: 9
Rep Power: 15
shaham is on a distinguished road
Quote:
Originally Posted by nhendre View Post
Hello Shaham,
Did you get the solution for this ?
I think I did and I think it multiplies it after it gets your udf. but there were some model that are not a multiple of ni. So you need to find ni. As it is a little old, I am not sure what was the final solution I did to get ni, but from one of the C files I found this lines that are related to calculating ni nj

first defined the bins in the code
double dbin[11]={2.048e-3,1.024e-3,5.12e-4,2.56e-4,1.28e-4,6.4e-5,3.2e-5,1.6e-5,8e-6,4e-6,2e-6};

then
for (i=0;i<11;i++)
{
if (ROUND(1e10*d_1)==ROUND(1e10*dbin[i]))
{
fi=C_PB_DISCI(c,t,i);
break;
}
}
afi=vofV*fi;
nbi=afi/Vol;

if you find the lines not related, you may look at this one:
for (i=0;i<11;i++)
{
Di=dbin[i]/pow(rhog,1./3.);
fi=C_PB_DISCI(c,t,i);
Sum+=fi/Di;
}
SMD=1/Sum;

I guess this is the way to calculate Sauter mean diameter.

Good luck
Tran Van Bay likes this.
shaham is offline   Reply With Quote

Old   April 21, 2018, 05:39
Default
  #113
Member
 
Masoud Ravan
Join Date: May 2016
Location: Tehran
Posts: 59
Rep Power: 9
masoud.ravan is on a distinguished road
Quote:
Originally Posted by nhendre View Post
Dear Syed, did you find the solution for defining ni and nj? I am also trying to find out the solution. If yes, can you suggest how to define ni and nj.. Also please share the udf if possible
Thanks..
Hi
Fluent doesn't have a function that gives you the number density because it solves PBM equations based on size fraction of bins. But fortunately, we know the relationship between number density and size fraction.
So you have to find the number density with an easy trick!
Follow these steps:
1- find size fraction of the bin with C_PB_DISCI(...)
2- Now you could access the number density with this formulation:
{number density of bin i*volume of bubble i=size fraction of bin i* vof of dispersed phase}

Good luck
Tran Van Bay and dannd like this.
masoud.ravan is offline   Reply With Quote

Old   April 21, 2018, 08:21
Default
  #114
New Member
 
nilesh
Join Date: Jan 2017
Posts: 22
Rep Power: 9
nhendre is on a distinguished road
Quote:
Originally Posted by masoud.ravan View Post
Hi
Fluent doesn't have a function that gives you the number density because it solves PBM equations based on size fraction of bins. But fortunately, we know the relationship between number density and size fraction.
So you have to find the number density with an easy trick!
Follow these steps:
1- find size fraction of the bin with C_PB_DISCI(...)
2- Now you could access the number density with this formulation:
{number density of bin i*volume of bubble i=size fraction of bin i* vof of dispersed phase}

Good luck
Thank you for your reply.
I have written the udf and compared with in-built model in Fluent. But the results are not matching. Here is my udf.
/************************************************** ****************
UDF that computes particle aggregation rate
************************************************** *****************/
#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"

DEFINE_PB_COALESCENCE_RATE(aggregation_kernel,cell ,thread,d_1,thread_2, d_2)
{
Thread *thread_p, *thread_s;
real agg_kernel, mu_p, epsi, u_1, u_2, d_l, u_12, x_12, weber, w_ag, p_ag, A, B, C, D, t, n_1, n_2, f_1, f_2, void_s, alpha_1, alpha_2;

real rho_p = 1000.0, rho_s = 1.0, sig = 0.072;

Thread *tm = THREAD_SUPER_THREAD(thread);


void_s = C_VOF(cell, thread);

/*find bin size fractions of particle 1 and 2*/
f_1 = C_PB_DISCI(cell, thread, 1);
f_2 = C_PB_DISCI(cell, thread_2, 2);

/*find volume fractions of particle 1 and 2*/
alpha_1 = f_1*void_s;
alpha_2 = f_2*void_s;

/*find the number density of particle 1 and 2*/
n_1 = (alpha_1)/((3.1416/6)*d_1*d_1*d_1);

n_2 = (alpha_2)/((3.1416/6)*d_2*d_2*d_2);



/*find dissipation rate*/
epsi = C_D(cell, tm);

/*calculation of characteristic velocity of collision of two particles, line 18*/
u_1 = 1.43*pow((epsi*d_1),0.3333);
u_2 = 1.43*pow((epsi*d_2),0.3333);
u_12 = pow(((u_1*u_1)+(u_2*u_2)),0.5);

/*calculation of weber number*/
weber = (rho_p*d_1*u_12*u_12)/sig;

/*ratio of diameter of particles*/
x_12 = (d_1/d_2);

/*calculation of aggregation freaquency of collision*/
w_ag = (3.14/4)*(d_1+d_2)*(d_1+d_2)*u_12*n_1*n_2;

/*probability of aggregation, line 36*/
A = pow((0.75*(1+x_12*x_12)*(1+x_12*x_12*x_12)),0.5);
B = pow(weber,0.5);
C = pow((rho_s/rho_p+0.5),0.5);
D = pow((1+x_12),3);

p_ag = exp((-1)*A*B/C/D);


/*compute agregation kernel*/
agg_kernel = (w_ag)*(p_ag);

return agg_kernel;
}

Can you suggest if any change is required?
Thanks again.
nhendre is offline   Reply With Quote

Old   April 21, 2018, 08:28
Default
  #115
New Member
 
nilesh
Join Date: Jan 2017
Posts: 22
Rep Power: 9
nhendre is on a distinguished road
Quote:
Originally Posted by shaham View Post
I think I did and I think it multiplies it after it gets your udf. but there were some model that are not a multiple of ni. So you need to find ni. As it is a little old, I am not sure what was the final solution I did to get ni, but from one of the C files I found this lines that are related to calculating ni nj

first defined the bins in the code
double dbin[11]={2.048e-3,1.024e-3,5.12e-4,2.56e-4,1.28e-4,6.4e-5,3.2e-5,1.6e-5,8e-6,4e-6,2e-6};

then
for (i=0;i<11;i++)
{
if (ROUND(1e10*d_1)==ROUND(1e10*dbin[i]))
{
fi=C_PB_DISCI(c,t,i);
break;
}
}
afi=vofV*fi;
nbi=afi/Vol;

if you find the lines not related, you may look at this one:
for (i=0;i<11;i++)
{
Di=dbin[i]/pow(rhog,1./3.);
fi=C_PB_DISCI(c,t,i);
Sum+=fi/Di;
}
SMD=1/Sum;

I guess this is the way to calculate Sauter mean diameter.

Good luck
Thank you Shaham for your reply.
As suggested by one of the reader to calculate number density, I have written udf but the results are not matching.
nhendre is offline   Reply With Quote

Old   April 21, 2018, 10:28
Default
  #116
New Member
 
shaham
Join Date: Feb 2011
Posts: 9
Rep Power: 15
shaham is on a distinguished road
Quote:
Originally Posted by nhendre View Post
Thank you Shaham for your reply.
As suggested by one of the reader to calculate number density, I have written udf but the results are not matching.
I think the reason is this part: f_1 = C_PB_DISCI(cell, thread, 1);
f_2 = C_PB_DISCI(cell, thread_2, 2);

this gives you f1 and f2 in the bin 1 and 2. so the whole trick is how you can get and know which bin you are cause you are not given the been but the diameter for that bin. That's why I wrote the for loop to compare the d with the diameter of the bin which I put manually in the code (you have to change the values you specify for the bin in the code if you change your bins in Fluent)

I have tested this and it works as I remember. if it doesn't match then let me know and I can dig more for a version that is correct

ps: it is quite stupid that the model doesn't give you ni or at list the i of the bin!!!
ps2: as I found out when you return the value in the function, Fluent will multiply it by ni*nj. so If your model does have one ni*nj then ignore them and return the rest of the values in the model by the udf. if it is some other multiples such as no ni*nj or ni^2 or something else then you can get the value using what I gave you.
nhendre and Tran Van Bay like this.
shaham is offline   Reply With Quote

Old   April 21, 2018, 15:54
Default
  #117
Member
 
Masoud Ravan
Join Date: May 2016
Location: Tehran
Posts: 59
Rep Power: 9
masoud.ravan is on a distinguished road
Quote:
Originally Posted by nhendre View Post
Thank you for your reply.
I have written the udf and compared with in-built model in Fluent. But the results are not matching. Here is my udf.
/************************************************** ****************
UDF that computes particle aggregation rate
************************************************** *****************/
#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"

DEFINE_PB_COALESCENCE_RATE(aggregation_kernel,cell ,thread,d_1,thread_2, d_2)
{
Thread *thread_p, *thread_s;
real agg_kernel, mu_p, epsi, u_1, u_2, d_l, u_12, x_12, weber, w_ag, p_ag, A, B, C, D, t, n_1, n_2, f_1, f_2, void_s, alpha_1, alpha_2;

real rho_p = 1000.0, rho_s = 1.0, sig = 0.072;

Thread *tm = THREAD_SUPER_THREAD(thread);


void_s = C_VOF(cell, thread);

/*find bin size fractions of particle 1 and 2*/
f_1 = C_PB_DISCI(cell, thread, 1);
f_2 = C_PB_DISCI(cell, thread_2, 2);

/*find volume fractions of particle 1 and 2*/
alpha_1 = f_1*void_s;
alpha_2 = f_2*void_s;

/*find the number density of particle 1 and 2*/
n_1 = (alpha_1)/((3.1416/6)*d_1*d_1*d_1);

n_2 = (alpha_2)/((3.1416/6)*d_2*d_2*d_2);



/*find dissipation rate*/
epsi = C_D(cell, tm);

/*calculation of characteristic velocity of collision of two particles, line 18*/
u_1 = 1.43*pow((epsi*d_1),0.3333);
u_2 = 1.43*pow((epsi*d_2),0.3333);
u_12 = pow(((u_1*u_1)+(u_2*u_2)),0.5);

/*calculation of weber number*/
weber = (rho_p*d_1*u_12*u_12)/sig;

/*ratio of diameter of particles*/
x_12 = (d_1/d_2);

/*calculation of aggregation freaquency of collision*/
w_ag = (3.14/4)*(d_1+d_2)*(d_1+d_2)*u_12*n_1*n_2;

/*probability of aggregation, line 36*/
A = pow((0.75*(1+x_12*x_12)*(1+x_12*x_12*x_12)),0.5);
B = pow(weber,0.5);
C = pow((rho_s/rho_p+0.5),0.5);
D = pow((1+x_12),3);

p_ag = exp((-1)*A*B/C/D);


/*compute agregation kernel*/
agg_kernel = (w_ag)*(p_ag);

return agg_kernel;
}

Can you suggest if any change is required?
Thanks again.
as shaham said, I think the problem is here:
f_1 = C_PB_DISCI(cell, thread, 1);
f_2 = C_PB_DISCI(cell, thread_2, 2);
...
first, you have to find d_1 (or d_2) belongs to which bin fraction, then use it for the third argument of C_PB_DISCI.

Let us know the results
nhendre likes this.
masoud.ravan is offline   Reply With Quote

Old   April 22, 2018, 13:27
Smile
  #118
New Member
 
nilesh
Join Date: Jan 2017
Posts: 22
Rep Power: 9
nhendre is on a distinguished road
Quote:
Originally Posted by shaham View Post
I think the reason is this part: f_1 = C_PB_DISCI(cell, thread, 1);
f_2 = C_PB_DISCI(cell, thread_2, 2);

this gives you f1 and f2 in the bin 1 and 2. so the whole trick is how you can get and know which bin you are cause you are not given the been but the diameter for that bin. That's why I wrote the for loop to compare the d with the diameter of the bin which I put manually in the code (you have to change the values you specify for the bin in the code if you change your bins in Fluent)

I have tested this and it works as I remember. if it doesn't match then let me know and I can dig more for a version that is correct

ps: it is quite stupid that the model doesn't give you ni or at list the i of the bin!!!
ps2: as I found out when you return the value in the function, Fluent will multiply it by ni*nj. so If your model does have one ni*nj then ignore them and return the rest of the values in the model by the udf. if it is some other multiples such as no ni*nj or ni^2 or something else then you can get the value using what I gave you.

Dear Shaham,
1) Can you please explain the loop:
'if (ROUND(1e10*d_1)==ROUND(1e10*dbin[i]))'
2) Also is it required to write second 'for' loop for calculating number density of second particle?
Thanks
nhendre is offline   Reply With Quote

Old   April 23, 2018, 03:47
Default
  #119
Member
 
Masoud Ravan
Join Date: May 2016
Location: Tehran
Posts: 59
Rep Power: 9
masoud.ravan is on a distinguished road
Quote:
Originally Posted by nhendre View Post
Dear Shaham,
1) Can you please explain the loop:
'if (ROUND(1e10*d_1)==ROUND(1e10*dbin[i]))'
2) Also is it required to write second 'for' loop for calculating number density of second particle?
Thanks
This part is for finding the index of bin fraction that bubble with size d_1 belongs to.
Here is the other way:
for example, if we have 5 bins with diameters:
Bin-0: 0.0038097
Bin-1: 0.0024
Bin-2: 0.0015119053
Bin-3: 0.00095244
Bin-4: 0.0006
we could find the index and then size fraction by:
if(d<.0007)
{
index=4;
}
else if(d<.001)
{
index=3;
}
else if(d<.002)
{
index=2;
}
else if(d<.003)
{
index=1;
}
else if(d<.004)
{
index=0;
}

size_fraction=C_PB_DISCI(cell, thread, index);
masoud.ravan is offline   Reply With Quote

Old   April 23, 2018, 05:29
Default
  #120
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi All,

I think Shaham has pointed out something important: the UDF is intended to return the value of the kernel (which is effectively a rate constant), not the aggregation rate. (This is fairly clear in the documentation, and you have to ignore the fact that the UDF type's name ends in "_RATE".)

So, you do not need the factor of "*n1*n2". You do not need to look up which intervals d_1 and d_2 fall into. In fact, your UDF should not need to know anything about the size intervals -- it is defining the size behaviour of the aggregation phenomenon. You definitely should not need to hard-code the bin sizes into your UDF (either by a fixed array "double dbin[11]={..." or nested inside lots of "if" statements) -- this would be difficult to maintain.

OK, this structure makes some assumptions about the nature of the aggregation phenomenon -- for example, it assumes that there are no effects that are second-order in concentration, etc. Within those assumptions, this is a much cleaner way to define the UDF interface.

By the way, for the sake of my sanity, please do not use two different approximations to pi -- you should find that M_PI will work (without the need for any extra #include statements).

I have to admit that I once tried to reconstruct the fine detail of how Fluent's discrete-PB model treats size distributions: exactly what mean size is used inside each interval? does it assume constant length-based number density, or constant volume-based number density, or some other approximation of the distribution inside each interval? These are very small details, but I wanted to get them right. I did not finish this in the time available. If you make any solid conclusions about what Fluent is doing under the hood, please post them here.

Good luck!
Ed
obscureed 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
Modeling porous media with FLUENT newcomer FLUENT 4 September 26, 2013 00:08
Loading of Temperature datas from ansys to fluent! need help!! tensun FLUENT 0 November 6, 2010 00:35
Import Soliworks geometry to Ansys Fluent 12.0 nunolopes FLUENT 0 October 7, 2010 11:24
FSI, Fluent Ansys coupling Greg Carnie FLUENT 5 January 7, 2010 19:15
Population Balance Theory student Main CFD Forum 2 August 10, 2008 04:12


All times are GMT -4. The time now is 20:17.