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 code for DPM (https://www.cfd-online.com/Forums/fluent-udf/167019-udf-code-dpm.html)

Iman Afrooz February 22, 2016 03:31

UDF code for DPM
 
1 Attachment(s)
Hello everyone,

I am new in Fluent and I am trying to simulate a 3D Fluidized Bed having cylindrical geometry.The geometry is a cylinder Bed with diameter of 7.62 cm and the height of 500 cm, an Airbox with the same diameter but with length of the 17 cm And a distributor plate having 21 holes in between. The diameter of holes are 1 mm with the length of 5 mm (Photo is attached). The velocity inlet is applied at the bottom surface of the Airbox. The pressure outlet is applied at the top surface of the Bed. The sand particles are injected to the system using file injection. I used DPM technique but I faced with the following errors after 3 iterations:

---------------------------------------------------------------------------------------
Updating solution at time level N... done.
Injecting 41595 particle parcels with mass 0.540735 at t = 0

Advancing DPM injections ....
number tracked = 41595, escaped = 0, aborted = 0, trapped = 0, evaporated = 0, incomplete = 0
number tracked = 41595, escaped = 0, aborted = 0, trapped = 0, evaporated = 0, incomplete = 0
number tracked = 41595, escaped = 0, aborted = 0, trapped = 0, evaporated = 0, incomplete = 0
number tracked = 41595, escaped = 0, aborted = 0, trapped = 0, evaporated = 0, incomplete = 0
number tracked = 41595, escaped = 0, aborted = 0, trapped = 0, evaporated = 0, incomplete = 0
iter continuity u-air v-air w-air time/iter
1 1.0000e+00 3.9691e-02 9.0649e-01 5.7379e-01 0:00:49 49
2 1.0000e+00 3.2715e-01 4.2793e-01 2.9460e-01 0:00:38 48
3 1.0000e+00 1.8774e-01 3.0985e-01 1.4735e-01 0:00:30 47
# Divergence detected in AMG solver: mp-x-momentum -> Decreasing coarsening group size!
# Divergence detected in AMG solver: mp-x-momentum -> Increasing relaxation sweeps!
# Divergence detected in AMG solver: pressure correction -> Turning off correction scaling!
# Divergence detected in AMG solver: pressure correction -> Increasing relaxation sweeps!

Error: Divergence detected in AMG solver: pressure correction

Error: Divergence detected in AMG solver: pressure correction
Error Object: #f
---------------------------------------------------------------------------------------

I think the problem is due to the coarse meshing that is expanded from small holes of distributor plate to the big cylinder of the bed. So if I can write UDF codes then this problem might be solved. But I don't know how to write CFD codes. Can someone please give me help on this problem by writing UDF for me?

Thank you in advance.

pakk February 22, 2016 04:02

If the problem is that you have a bad mesh, you should improve the mesh.

I don't see how a UDF can help here (but I may be wrong). What do you want the UDF to do?

Iman Afrooz February 22, 2016 04:26

Quote:

Originally Posted by pakk (Post 586230)
If the problem is that you have a bad mesh, you should improve the mesh.

I don't see how a UDF can help here (but I may be wrong). What do you want the UDF to do?

Dear Pakk,

Thank you for your reply. I tried different mesh but didn't work. When I use only a simple cylinder (without holes), it works and simulation is converged. But when I add holes to the geometry, I face with the same problem.
Actually, I was thinking if I can use CFD codes then no need to draw a geometry and mesh. Please correct me if I am wrong.

pakk February 22, 2016 04:33

Quote:

Actually, I was thinking if I can use CFD codes then no need to draw a geometry and mesh.
How should that work? What should the UDF code do?

UDFs are not Harry Potter magic, they don't get results out of nothing. A UDF is only a method to tell the computer what to do. What do you want the computer do? Maybe you have a really smart idea on how a UDF can help you in your problem, but if you don't tell what your idea is, I can not say if it is a good idea.

Iman Afrooz February 22, 2016 04:43

Quote:

Originally Posted by pakk (Post 586242)
How should that work? What should the UDF code do?

UDFs are not Harry Potter magic, they don't get results out of nothing. A UDF is only a method to tell the computer what to do. What do you want the computer do? Maybe you have a really smart idea on how a UDF can help you in your problem, but if you don't tell what your idea is, I can not say if it is a good idea.

Dear Pakk,

Harry Potter magic hahaha :D
I really don't have any idea. I was told by someone that instead of drawing the geometry, we can use CFD codes. So my question is: Is it possible to define a geometry and boundary conditions only using CFD codes?
Or Could you please suggest the other options to me?
Thank you.

pakk February 22, 2016 10:02

It might be possible to make code that makes your geometry and your mesh. But what would that help? You already have a geometry and a mesh. So it would be a lot of work to get at the same point that you are now...

Your simulation diverged. Unfortunately, that happens many times. And, in my experience, in most cases this can and should be solved by improving the mesh.
In your case, the problem is with the mesh. You even showed that yourself: you changed your geometry to make meshing easier, and all problems were gone. Your challenge now is to get a mesh with a good quality for the more complicated geometry.

Iman Afrooz February 22, 2016 10:13

Quote:

Originally Posted by pakk (Post 586286)
It might be possible to make code that makes your geometry and your mesh. But what would that help? You already have a geometry and a mesh. So it would be a lot of work to get at the same point that you are now...

Your simulation diverged. Unfortunately, that happens many times. And, in my experience, in most cases this can and should be solved by improving the mesh.
In your case, the problem is with the mesh. You even showed that yourself: you changed your geometry to make meshing easier, and all problems were gone. Your challenge now is to get a mesh with a good quality for the more complicated geometry.

Do you know any literature that I can use to improve my meshing technique? Any notes, books or even YouTube videos?
Thanks

pakk February 23, 2016 03:35

Not really... I think a good way to learn it is just to fool around with settings, and see what works and what not.

sewgolam May 16, 2017 05:31

Dear pakk,

I'm facing a other problem.i want to simulated a solar reactor with particle injection.Till know i did the simulation by adding small particle usinf DPM in fluent.My next step is to writea UDF to takes the effect of radiation and heat en masstransfer because there will be reaction include in later stage. At this stage i want to used Define_DPM_law macro to get the diameter temperature enad other from my simulation.But when i complie the UDF code and tried to rum the simulation it give me a error received a fatal signal(segmentation fault).My particle are inert so donot understand what to do.please help.

With kind regard,

Ronnie Sewgolam


All times are GMT -4. The time now is 11:53.