# UDF for body force in DPM

 Register Blogs Members List Search Today's Posts Mark Forums Read

August 23, 2011, 09:12
#41
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 15
Quote:
 Originally Posted by elah599 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.:
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 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,
__________________
Amir

January 26, 2012, 16:41
#42
New Member

Join Date: Aug 2010
Posts: 15
Rep Power: 8
Quote:
 Originally Posted by Amir Dear Iman, Generally, you can add number of extra scalar transport to current solver; e.g.: 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 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,

 January 27, 2012, 04:35 #43 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 739 Blog Entries: 1 Rep Power: 15 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, __________________ Amir

January 28, 2012, 15:34
#44
New Member

Join Date: Aug 2010
Posts: 15
Rep Power: 8
Quote:
 Originally Posted by Amir 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???

January 28, 2012, 16:50
#45
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 15
Quote:
 Originally Posted by m.salemi 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,
__________________
Amir

January 28, 2012, 17:49
#46
New Member

Join Date: Aug 2010
Posts: 15
Rep Power: 8
Quote:
 Originally Posted by Amir 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 isnt clear, i dont know proper diffusivity and BC for this problem, can you explain this???

January 29, 2012, 04:06
#47
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 15
Quote:
 Originally Posted by m.salemi Thanks a lot dear Amir, but isnt clear, i dont 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:

and you have to set for FLUENT which has a dimension of (kg/m.s), but note that the 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,
__________________
Amir

January 29, 2012, 11:31
#48
New Member

Join Date: Aug 2010
Posts: 15
Rep Power: 8
Quote:
 Originally Posted by Amir 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: and you have to set for FLUENT which has a dimension of (kg/m.s), but note that the 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
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???

January 29, 2012, 16:10
#49
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 15
Hi,
Quote:
 Originally Posted by m.salemi 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 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,
__________________
Amir

 June 15, 2012, 20:51 loop over particles #50 Member   Shawn Fotovati Join Date: Jul 2009 Location: Cincinnati, OH Posts: 41 Rep Power: 9 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.

June 17, 2012, 04:50
#51
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 15
Quote:
 Originally Posted by sfotovati 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,
__________________
Amir

 June 17, 2012, 05:51 #52 Member   Shawn Fotovati Join Date: Jul 2009 Location: Cincinnati, OH Posts: 41 Rep Power: 9 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.

June 17, 2012, 07:38
#53
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 15
Quote:
 Originally Posted by sfotovati 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,
__________________
Amir

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post teymourj Fluent UDF and Scheme Programming 9 August 18, 2016 15:33 enry Fluent UDF and Scheme Programming 10 March 23, 2011 11:48 dm2747 FLUENT 0 April 17, 2009 01:29 Prashanth FLUENT 3 April 3, 2009 17:45 hedonists FLUENT 0 March 12, 2003 22:10

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