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 Members List Search Today's Posts Mark Forums Read

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: 6
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: 540
Rep Power: 16
vinerm is on a distinguished road
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

PMs only for private content
vinerm is online now   Reply With Quote

Old   February 6, 2020, 01:35
Default
  #3
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 6
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: 540
Rep Power: 16
vinerm is on a distinguished road
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

PMs only for private content
vinerm is online now   Reply With Quote

Old   February 6, 2020, 05:01
Default
  #5
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 6
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: 540
Rep Power: 16
vinerm is on a distinguished road
Look at the following

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

PMs only for private content
vinerm is online now   Reply With Quote

Old   February 6, 2020, 05:36
Default
  #7
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 6
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: 540
Rep Power: 16
vinerm is on a distinguished road
You forgot to attach the file
__________________
Regards,
Vinerm

PMs only for private content
vinerm is online now   Reply With Quote

Old   February 6, 2020, 11:42
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,451
Rep Power: 20
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: 540
Rep Power: 16
vinerm is on a distinguished road
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

PMs only for private content
vinerm is online now   Reply With Quote

Old   February 11, 2020, 11:10
Default
  #11
New Member
 
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 6
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: 540
Rep Power: 16
vinerm is on a distinguished road
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

PMs only for private content
vinerm is online now   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:10.