|
[Sponsors] |
February 5, 2020, 03:15 |
udf for DPM
|
#1 |
New Member
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11 |
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. |
|
February 5, 2020, 05:18 |
The objective
|
#2 |
Senior Member
|
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. |
|
February 6, 2020, 01:35 |
|
#3 |
New Member
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11 |
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. |
|
February 6, 2020, 03:33 |
Filter topology
|
#4 |
Senior Member
|
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. |
|
February 6, 2020, 05:01 |
|
#5 |
New Member
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11 |
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 |
|
February 6, 2020, 05:03 |
DPM Macros
|
#6 |
Senior Member
|
__________________
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. |
|
February 6, 2020, 05:36 |
|
#7 |
New Member
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11 |
Thank you so much.
|
|
February 6, 2020, 06:12 |
Forgot UDF
|
#8 |
Senior Member
|
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. |
|
February 6, 2020, 11:42 |
|
#9 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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. |
|
February 10, 2020, 06:45 |
Issues in the code
|
#10 |
Senior Member
|
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. |
|
February 11, 2020, 11:10 |
|
#11 |
New Member
surya
Join Date: Jul 2015
Posts: 24
Rep Power: 11 |
I will look in to it. Thanks a lot. I will correct and share the udf once more.
|
|
February 17, 2020, 04:59 |
Macro dependendt
|
#12 |
Senior Member
|
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. |
|
October 19, 2020, 01:03 |
|
#13 | |
Member
L.A.Isanka
Join Date: Jul 2020
Posts: 55
Rep Power: 6 |
Quote:
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! |
||
November 26, 2021, 10:48 |
Please share your UDF
|
#14 |
New Member
ali
Join Date: Nov 2013
Posts: 1
Rep Power: 0 |
Hi
I am working to somehow the same problem. It would be great if you can share your final UDF. Thanks in advance. |
|
November 10, 2023, 11:44 |
How transfer DPM particle into continuous phase using UDF
|
#15 | |
New Member
Wangcong
Join Date: Nov 2023
Posts: 1
Rep Power: 0 |
Quote:
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. |
||
|
|
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 |