CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for body force in DPM (https://www.cfd-online.com/Forums/fluent-udf/85719-udf-body-force-dpm.html)

Amir August 23, 2011 09:12

Quote:

Originally Posted by elah599 (Post 321183)
Dear Amir
I read the help of fluent for UDS and unfortunately I didn't get what should I do. do I have to solve the flow for multiphase flow or single phase flow? is just enough to consider coefficient of diffusion in material tab? if you have a simple case file, it would be great if you can send me that until I know what should I do. because I didn't find a proper tutorial for this concept.
thanks for your support:)

Dear Iman,

Generally, you can add number of extra scalar transport to current solver; e.g.: \partial(\rho C)/\partial t+\nabla.(\rho UC)=\nabla.(D\nabla C) + sources
They are added to another equations which are provided; something like energy equation, so it's not need to use multiphase models, it's applicable to single phase as well. Just note dimension of diffusion coefficient which you have to set in kg/(m.s); i.e, it's \rho D not D. Other setting is like setting of energy equation, you would need B.C and .... The result is particle concentration (C) as it's expected.
Unfortunately, I don't have small case which I can upload now; nevertheless, if these tips couldn't help you, inform me and I'll prepare one.;)

Bests,

m.salemi January 26, 2012 15:41

Quote:

Originally Posted by Amir (Post 321206)
Dear Iman,

Generally, you can add number of extra scalar transport to current solver; e.g.: \partial(\rho C)/\partial t+\nabla.(\rho UC)=\nabla.(D\nabla C) + sources
They are added to another equations which are provided; something like energy equation, so it's not need to use multiphase models, it's applicable to single phase as well. Just note dimension of diffusion coefficient which you have to set in kg/(m.s); i.e, it's \rho D not D. Other setting is like setting of energy equation, you would need B.C and .... The result is particle concentration (C) as it's expected.
Unfortunately, I don't have small case which I can upload now; nevertheless, if these tips couldn't help you, inform me and I'll prepare one.;)

Bests,

Hi Amir,
I'm interested in scalar transport for solving such problem,can you help me about this or send a case about this for me???

Amir January 27, 2012 03:35

Hi,

Do not hesitate to ask if it's not clear. Just preparing a case is not helpful I think, because it's really case dependent.

Bests,

m.salemi January 28, 2012 14:34

Quote:

Originally Posted by Amir (Post 341453)
Hi,

Do not hesitate to ask if it's not clear. Just preparing a case is not helpful I think, because it's really case dependent.

Bests,

Hi Amir,
thanks a lot,
i want to modeling effect of nanoparticles in water,can you help me???

Amir January 28, 2012 15:50

Quote:

Originally Posted by m.salemi (Post 341665)
Hi Amir,
thanks a lot,
i want to modeling effect of nanoparticles in water,can you help me???

Hi,

sure; using Eulerian method seems reasonable for your purpose if it matches with your goal; nevertheless, selecting Lagrangian procedure has few issues specially in nano particles; so the only thing you have to do is to activate a scalar equation, set proper diffusivity and UDS BC; isn't it clear or face a trouble?

Bests,

m.salemi January 28, 2012 16:49

Quote:

Originally Posted by Amir (Post 341667)
Hi,

sure; using Eulerian method seems reasonable for your purpose if it matches with your goal; nevertheless, selecting Lagrangian procedure has few issues specially in nano particles; so the only thing you have to do is to activate a scalar equation, set proper diffusivity and UDS BC; isn't it clear or face a trouble?

Bests,

Thanks a lot dear Amir,
but isn`t clear, i don`t know proper diffusivity and BC for this problem, can you explain this???

Amir January 29, 2012 03:06

Quote:

Originally Posted by m.salemi (Post 341670)
Thanks a lot dear Amir,
but isn`t clear, i don`t know proper diffusivity and BC for this problem, can you explain this???

The diffusivity of a substance in another is obtained from kinetic theory and you have to find it from literature (D). This parameter has a dimension of (m2/s) but as I explained the scalar transport equation is:
\partial(\rho C)/\partial t+\nabla.(\rho UC)=\nabla.(\rho D\nabla C) + sources
and you have to set \rho D for FLUENT which has a dimension of (kg/m.s), but note that the \rho is the base fluid density and D is diffusivity of desired substance in that fluid.
About the BCs, you have 3 options to set value or gradient or write a UDF for that; you have to set appropriate BC according to your model; e.g., if you set zero gradient it means that there isn't any penetration of the UDS and if you set zero value it means that there is a sink of that UDS.

Bests,

m.salemi January 29, 2012 10:31

Quote:

Originally Posted by Amir (Post 341699)
The diffusivity of a substance in another is obtained from kinetic theory and you have to find it from literature (D). This parameter has a dimension of (m2/s) but as I explained the scalar transport equation is:
\partial(\rho C)/\partial t+\nabla.(\rho UC)=\nabla.(\rho D\nabla C) + sources
and you have to set \rho D for FLUENT which has a dimension of (kg/m.s), but note that the \rho is the base fluid density and D is diffusivity of desired substance in that fluid.
About the BCs, you have 3 options to set value or gradient or write a UDF for that; you have to set appropriate BC according to your model; e.g., if you set zero gradient it means that there isn't any penetration of the UDS and if you set zero value it means that there is a sink of that UDS.

Bests,

Hi amir
Thanks a lot for your answering...
i have some question about your answer,
should i solve this equation with continuity,momentum and energy equations and coupled with them???if yes, how can i do this work???
and can i use this equation in common model or i should use DPM or other model???

Amir January 29, 2012 15:10

Hi,
Quote:

Originally Posted by m.salemi (Post 341743)
should i solve this equation with continuity,momentum and energy equations and coupled with them???if yes, how can i do this work???

No, this equation is solved in decoupled manner with both pressure and density based solvers.
Quote:

Originally Posted by m.salemi (Post 341743)
and can i use this equation in common model or i should use DPM or other model???

No, you can use this equation with any solver; it just adds additional equations.

Bests,

sfotovati June 15, 2012 20:51

loop over particles
 
Hi guys,

I need to find electromagnetic force induced by other particles over the tracked particle. Can I loop over particles while I am using DEFINE_DPM_BODY_FORCE ??!

I tried "loop(p,I->p)", but it did not work. I also used "begin_particle_cell_loop" macro, it did not work either.

Please let me know if you can help me.

Thanks

Shahryar.

Amir June 17, 2012 04:50

Quote:

Originally Posted by sfotovati (Post 366739)
Hi guys,

I need to find electromagnetic force induced by other particles over the tracked particle. Can I loop over particles while I am using DEFINE_DPM_BODY_FORCE ??!

I tried "loop(p,I->p)", but it did not work. I also used "begin_particle_cell_loop" macro, it did not work either.

Please let me know if you can help me.

Thanks

Shahryar.

Dear Shahryar,

You cannot make a loop over particles in this macro because the particles are tracked sequentially.

Bests,

sfotovati June 17, 2012 05:51

Thanks for the reply Amir,

What about the macro "begin_particle_cell_loop"?
I tried that one. I was able to compile it but it gives me access_violation error as I run the DPM. Do you have any idea how to use this macro in define DPM body force?

Thanks.

Amir June 17, 2012 07:38

Quote:

Originally Posted by sfotovati (Post 366864)
Thanks for the reply Amir,

What about the macro "begin_particle_cell_loop"?
I tried that one. I was able to compile it but it gives me access_violation error as I run the DPM. Do you have any idea how to use this macro in define DPM body force?

Thanks.

There isn't any conceptual difference. You cannot loop over particles according to their index or location because of sequential algorithm. You need to change your algorithm; maybe select another macro or use temporary memories to store particle effects ......

Bests,


All times are GMT -4. The time now is 00:26.