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

UDF for UNSTEADY DDPM simulation, bin_particles_in_cells for begin_particle_cell_loop

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2016, 09:37
Smile UDF for UNSTEADY DDPM simulation, bin_particles_in_cells for begin_particle_cell_loop
  #1
New Member
 
Join Date: Apr 2016
Posts: 11
Rep Power: 10
Narita is on a distinguished road
Hello everyone. Thanks for your attention to this thread.

I'm now working on UNSTEADY DDPM simulation on Ansys. (DDPM is very similar to DPM, but it's under Eulerian-Eulerian model)

In my UDF, I need to count for the number of particles residing in each cell, and then do something to them (cell by cell) at the end of each fluid time step (in DEFINE_EXECUTE_AT_END).

So I wrote:

{
/* I learnt the under two sentenses from a phd thesis
to active begin_particle_in_cell_loop*/
Alloc_Storage_Vars(domain, SV_DPM_PARTICLE_BIN, SV_NULL); bin_particles_in_cells(domain,TRUE);

thread_loop_c(tc,d)
{
begin_c_loop(c,tc)
{
begin_particle_cell_loop(pi,c,tc)
{
.../*count the number of particles,
and do something I planed to*/
}
end_particle_cell_loop(pi,c,tc)
}
}

Free_Storage_Vars(d, SV_DPM_PARTICLE_BIN, SV_NULL);
}

My problem is:

when I include this UDF, at any time FLUENT will only trap the newly injected particles (say, the tracked number=180,180,170,180,170,..).

However, when I exclude this UDF, or I comment the sentence 'bin_particles_in_cells(domain,TRUE);', the tracked number will be:= 180,360,530,710,880,...
But if I comment the sentence, the begin_particle_cell_loop turns out to show me 'no particles in each cell'.

Anyway, I can use an injection loop and a particle_in_injection loop to acheive what I want, but I can not stop wondering why the above things happened in my unsteady simulation.

Thanks everyone for paying attention to such a long text. Looking forward to your replys.
Narita is offline   Reply With Quote

Old   May 31, 2016, 08:43
Smile
  #2
New Member
 
Join Date: Apr 2016
Posts: 11
Rep Power: 10
Narita is on a distinguished road
Indeed I have exactly the same problem with Ari who submit this thread:
http://www.cfd-online.com/Forums/flu...e_end-udf.html

Ari solved this problem by replacing the particle_cell_loop by all_particle_in_domain loop.

Nevertheless, I'm still very concerned about how to directly solve this problem caused by the sentence 'bin_particles_in_cells(domain,TRUE);'.
If you have some idea, come on, let's discuss on it!
Narita is offline   Reply With Quote

Old   May 31, 2016, 10:45
Default
  #3
Member
 
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10
bhargavbharathan is on a distinguished road
Hi Narita,

I'm running a similar simulation. I don't use a udf like the one above and after the simulation runs for a while the number tracked reaches more than 100,000 and this slows down everything.

Do you have any suggestions on how to handle this.


-BB
bhargavbharathan is offline   Reply With Quote

Old   May 31, 2016, 21:48
Default
  #4
New Member
 
Join Date: Apr 2016
Posts: 11
Rep Power: 10
Narita is on a distinguished road
Quote:
Originally Posted by bhargavbharathan View Post
Hi Narita,

I'm running a similar simulation. I don't use a udf like the one above and after the simulation runs for a while the number tracked reaches more than 100,000 and this slows down everything.

Do you have any suggestions on how to handle this.


-BB
Hi bhargavbharathan, nice to meet you here.
If your simulation is transient and you run it on Ansys Fluent:
You can go to MODEL-DPM-INJECTION-PARCEL to set a larger constant number/diameter/volume. A larger number means one tracked parcel (or some people call it computational parcel) represents more (i.e., a larger number of) real particles.
I don't quite remember but it seems that FLUENT user guide has a recommendation on this handling. Nevertheless, be careful: it may reduce the simulation accuracy.
Good luck!
Narita is offline   Reply With Quote

Old   May 31, 2016, 21:57
Smile
  #5
New Member
 
Join Date: Apr 2016
Posts: 11
Rep Power: 10
Narita is on a distinguished road
Quote:
Originally Posted by Narita View Post
Indeed I have exactly the same problem with Ari who submit this thread:
http://www.cfd-online.com/Forums/flu...e_end-udf.html

Ari solved this problem by replacing the particle_cell_loop by all_particle_in_domain loop.

Nevertheless, I'm still very concerned about how to directly solve this problem caused by the sentence 'bin_particles_in_cells(domain,TRUE);'.
If you have some idea, come on, let's discuss on it!
And the same problem from:
http://www.cfd-online.com/Forums/flu...icle-data.html

Determined to solve it!
Narita 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 saving data of a transient simulation at particular locations sreerajvarma Fluent UDF and Scheme Programming 3 July 16, 2014 07:00
UDF for particle injection in ANSYS FLUENT DDPM and DEM models Musa Fluent UDF and Scheme Programming 1 October 6, 2013 13:01
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
Simulation with UDF for species mass fraction and velocity profile virgy Fluent UDF and Scheme Programming 8 February 7, 2012 04:30
UDF to change Rotation Speed in a MRF simulation Mike FLUENT 3 September 27, 2011 06:46


All times are GMT -4. The time now is 02:51.