Page 1 of 1

User defined Particle Diameter Profile

Posted: Tue Feb 27, 2018 6:40 am
by senartcon
Dear All,

the GUI leads us to specify either single particle diameter or diameters of normal distribution.
I would want to impose an arbitrary size distribution. The EXAMPLEs in cs_user_lagr_boundary_conditions.c do not tell us how to do this.
I know of the inverse transform sampling to generate a random variable for a given distribution. But how to do this in Code_Saturne ?

Is this doable at all?

Thanks
Anand

Re: User defined Particle Diameter Profile

Posted: Tue Feb 27, 2018 12:10 pm
by Yvan Fournier
Hello,

There is no reason why this could not be doable. Which version of the code are you using ?

Regards,

Yvan

Re: User defined Particle Diameter Profile

Posted: Thu Mar 08, 2018 12:31 pm
by senartcon
Hello,

I am using CS V 5.07.

Yes, I found how to do it, although in a less elegant way.
Generate the sampled values from a distribution and store in a text file.
Read the file once for all (using some static declarations) and input those values right into "cs_real_t diam = " for each nbclas and time step.

Regards
Anand

Re: User defined Particle Diameter Profile

Posted: Thu Mar 08, 2018 3:37 pm
by Yvan Fournier
Hello,

That's ugly. You can do it in a cleaner manner using the cs_user_lagr_in or cs_user_lagr_new_p_attr functions from the cs_user_lagr_particle.c user file.

Best regards,

Yvan