User defined Particle Diameter Profile

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
senartcon
Posts: 37
Joined: Wed May 08, 2013 6:46 pm

User defined Particle Diameter Profile

Post 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
Yvan Fournier
Posts: 4209
Joined: Mon Feb 20, 2012 3:25 pm

Re: User defined Particle Diameter Profile

Post by Yvan Fournier »

Hello,

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

Regards,

Yvan
senartcon
Posts: 37
Joined: Wed May 08, 2013 6:46 pm

Re: User defined Particle Diameter Profile

Post 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
Yvan Fournier
Posts: 4209
Joined: Mon Feb 20, 2012 3:25 pm

Re: User defined Particle Diameter Profile

Post 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
Post Reply