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

udf for DPM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2020, 03:15
Default udf for DPM
  #1
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11
surya.tdr is on a distinguished road
Hi,
As DPM considers particle as point masses, I need to get the size so that I can give a trap on the wall when it actually hits it and not when its center hits.

My idea is to track the distance between the center of incoming particles and wall, and to write a udf such that when that distance equals the radius of particle, the particle is trapped. So what udf macro I need to write whether it is define_dpm_boundary condition? Kindly help me to get some light in to this problem.
surya.tdr is offline   Reply With Quote

Old   February 5, 2020, 05:18
Default The objective
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Could you describe the objective of doing that? It would be little cumbersome to implement since DEFINE_DPM_BC works on the particles that hit that particular BC. You need to identify the particles within close proximity. Now, if you have 100 mesh faces on the boundary and there are 100 particles, if I'm not wrong, you have to loop through 10000 cycles to do this. But its doable.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 6, 2020, 01:35
Default
  #3
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11
surya.tdr is on a distinguished road
Thanks for your reply.

My objective is for incorporating a mechanism called interception in particle filtration by fibrous filters where particles follows the streamline and gets trapped when its distance from the obstacle (wall) is equal to the radius of the particle. I am doubtful about the macro which is to be used.
surya.tdr is offline   Reply With Quote

Old   February 6, 2020, 03:33
Default Filter topology
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
It can be done using standard macros, however, the difficulty lies with the topology of the filter. If the filter is planar, then it is rather easy. If the normal of the filter is aligned with one of the coordinate axes, you can track the positions of the particles and then either trap them or remove them as soon as those are within the limits prescribed as the distance between filter position and particle position being lesser than or equal to radius.

Now about macros, as far as DEFINE_ macro is concerned, you can use any of those that provide you with Tracked_Particle as the argument, such as, DEFINE_DPM_OUTPUT or DEFINE_DPM_SCALAR_UPDATE. Within these macros, you can check the positions using P_POS. Assuming the position of the filter is a known value, comparison is easy. Well, it is always known, the problem becomes little involved if the position is varying across the space, i.e., filter has some arbitrary shape. Procedure would still be same though. To trap, remove, or reflect a particle, you can use macro MARK_PARTICLE.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 6, 2020, 05:01
Default
  #5
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11
surya.tdr is on a distinguished road
The geometry is like 2-D planar. Its like flow past a large number of cylinders (fibers) and the particles has to be trapped on these cylinders. Thank you for your information. If possible can you share any of such examples of particle tracking as I am new to udf.

Thank you
surya.tdr is offline   Reply With Quote

Old   February 6, 2020, 05:03
Default DPM Macros
  #6
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Look at the following

https://www.afs.enea.it/project/nept...udf/node65.htm
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 6, 2020, 05:36
Default
  #7
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11
surya.tdr is on a distinguished road
Thank you so much.
surya.tdr is offline   Reply With Quote

Old   February 6, 2020, 06:12
Default Forgot UDF
  #8
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
You forgot to attach the file
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 6, 2020, 11:42
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
For DPM to be useful, you have to assume that your particles are small enough compared to the geometry. If your particle is so big that it matters whether the center of the particle hits the wall or the outside of the particle, you should not be using the DPM method, but a different method that explicitly includes the shape of the particle, such as 6DOF.


So there are two possibilities:
1. You don't need this, ignore the small difference between particle center and particle edge. You don't need this UDF.
2. You should not use the DPM method. You don't need this UDF.
pakk is offline   Reply With Quote

Old   February 10, 2020, 06:45
Default Issues in the code
  #10
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
There are multiple issues with the code. Let me start from the bottom. You forgot to end particle_cell_loop. Anything with a begin in Fluent is supposed to have an end.

You cannot return anything in this macro since it is supposed to return void, i.e., nothing. So, remove return part. return PATH_ACTIVE can be used only inside DPM_BC or some other code that expects an integer return value.

REMOVED with remove the particles as if those were never there. If you want that, it is alright. Usually, the material of the particles is added either to the wall as a deposition or to the continuous fluid. Disappearance is not physical. So, do something with the particle before removing it.

C is different from, say python; you have to use braces around test condition after if, i.e., (pc-bc <= P_DIAM(tp)/2)

There is no macro called P_CENTROID. Use P_POS. Y has to be declared before use. No declaration within the function, such as, cell_t c. No need to define diameter if you are using P_DIAM as it is in equations downstream. And DO NOT use common variables as diameter. Those might conflict with Fluent defined variables.

No need to fetch Thread *t, because it is already provided by Fluent as f in your code. But note that f is not the thread of just any boundary; rather it refers to the boundary selected in Sampling Window.

For the whole code, do note that the names of the variables do not matter; what they mean is important. Since you use f as second last argument does not mean you can use it as face_t in F_CENTROID. Go through the manual to understand the meaning of each argument that DEFINE_DPM_OUTPUT has.

Do not define variables outside DEFINE_, until you need global variables. Since you have only one DEFINE_, you do not need any global variables.

No need to include dpm.h. It is already included in udf.h
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 11, 2020, 11:10
Default
  #11
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11
surya.tdr is on a distinguished road
I will look in to it. Thanks a lot. I will correct and share the udf once more.
surya.tdr is offline   Reply With Quote

Old   February 17, 2020, 04:59
Default Macro dependendt
  #12
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
If you are using DEFINE_DPM_BC, then you should use path abort for ensuring that the particle gets trapped. Path active is meant for the particles that are still in the domain and need to be tracked further. All the particles are shown within the particle tracking. However, the trapped ones are shown as trapped in the text window. Those are not visible in the graphics since their paths get aborted. If you want to see how many particles got trapped on a particular boundary, you can do sampling on that particular boundary.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   October 19, 2020, 01:03
Default
  #13
Member
 
L.A.Isanka
Join Date: Jul 2020
Posts: 55
Rep Power: 6
Achini is on a distinguished road
Quote:
Originally Posted by vinerm View Post
It can be done using standard macros, however, the difficulty lies with the topology of the filter. If the filter is planar, then it is rather easy. If the normal of the filter is aligned with one of the coordinate axes, you can track the positions of the particles and then either trap them or remove them as soon as those are within the limits prescribed as the distance between filter position and particle position being lesser than or equal to radius.

Now about macros, as far as DEFINE_ macro is concerned, you can use any of those that provide you with Tracked_Particle as the argument, such as, DEFINE_DPM_OUTPUT or DEFINE_DPM_SCALAR_UPDATE. Within these macros, you can check the positions using P_POS. Assuming the position of the filter is a known value, comparison is easy. Well, it is always known, the problem becomes little involved if the position is varying across the space, i.e., filter has some arbitrary shape. Procedure would still be same though. To trap, remove, or reflect a particle, you can use macro MARK_PARTICLE.
Hi vinerm,

I find your replies to this post quite useful.
Can you tell me how to find the distance from particle position to the wall boundary?
Is there a specific macro I an use for that?

Thank you!
Achini is offline   Reply With Quote

Old   November 26, 2021, 10:48
Default Please share your UDF
  #14
New Member
 
ali
Join Date: Nov 2013
Posts: 1
Rep Power: 0
alisaidi is on a distinguished road
Hi
I am working to somehow the same problem.
It would be great if you can share your final UDF.
Thanks in advance.
alisaidi is offline   Reply With Quote

Old   November 10, 2023, 11:44
Default How transfer DPM particle into continuous phase using UDF
  #15
New Member
 
Wangcong
Join Date: Nov 2023
Posts: 1
Rep Power: 0
Wang Cong NEU is on a distinguished road
Quote:
Originally Posted by surya.tdr View Post
I will look in to it. Thanks a lot. I will correct and share the udf once more.
Hi!
The examples you shared are very useful to me. Thank you.Recently, I am conducting research on the interaction between bubbles (represented by DPM particles), liquid, and gas, and I have encountered two challenging issues.
1. When particles move to the liquid air-contact interface, how to stop tracking particles ,by determining that the gas volume fraction here is greater than or equal to 0.5 (it is considered that particles enter the air).I don't know what Macros will be available.

2. How to add the material and other properties of the particles that have stopped tracking to the continuous phase,I am still new in UDF and do not know what macro to use to implement this function.

I have been troubled for a long time, Could you please share your UDF with my email(wangcong98520@163.com)? Thank you a lot,Kindly.
Wang Cong NEU 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
udf for one dimensional linear motion based on force maccheese Fluent UDF and Scheme Programming 2 September 1, 2019 03:18
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 13:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 15:21.