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

[Population balance] C_PB_DISCI

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2016, 15:33
Default [Population balance] C_PB_DISCI
  #1
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Hi all,

I'm working on an UDF for a population balance model, and need to include the number of bubbles in binsize i.

This can of course be calculated using the bin volume fraction, C_PB_DISCI(c,t,i). Now my question is, how do I get i.

As far as I know, the solver passes d_1 and d_2, which are the diameter of bins i and j. Also, thread and thread_2 are passed, but for a discrete or qmom simulation, these are the same. So, how can I get the correct i (and j), that match the given diameters?

Any ideas would be awesome!

Best regards,
Cees
CeesH is offline   Reply With Quote

Old   January 22, 2016, 06:57
Default
  #2
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Unfortunately I have not yet solved the issue; any advice is highly welcome!

Best regards,
Cees
CeesH is offline   Reply With Quote

Old   March 15, 2016, 10:02
Default
  #3
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Still open for suggestions here
CeesH is offline   Reply With Quote

Old   March 15, 2016, 18:21
Default
  #4
Senior Member
 
Join Date: Mar 2014
Posts: 375
Rep Power: 13
hwet is on a distinguished road
what do you mean they are the same?

Will they all not be in the same mixture level thread anyways?

Have you tried using hard integers? '0' for bin-0, '1' for bin-1 etc?
hwet is offline   Reply With Quote

Old   March 16, 2016, 03:43
Default
  #5
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Hi hwet,

Indeed they are in the same mixture thread, which is why I can't use the thread values to distinguish between the size class.

As far as I understand the population balance approach works, the solver passes 2 bubble classes to the UDF, which calculates the coalescence rate between those classes, and feeds that back to the solver. Then the process repeats for the next 2 bubble classes, until all combinations were explored.
This mechanism is confirmed by printing d_1 and d_2 to the console for 1 gridcell, I get all possible combinations for d_1 and d_2 in series.

So the thing is, I want to know for that given d_1 and d_2 how many bubbles there are in that particular class. So hardcoding 0,1,.. directly doesn't work; I can of course set some if loop that contains (in pseudocode)
Code:
if d_1 == size, i = associated class
But this seems like a tedious exercise to me (not so much in programming, but having to burn through that if-loop every time seems time consuming)
So I was hoping there was a more direct way to get the bubble class associated with the passed diameters.
CeesH is offline   Reply With Quote

Old   April 24, 2018, 00:43
Default
  #6
New Member
 
nilesh
Join Date: Jan 2017
Posts: 22
Rep Power: 9
nhendre is on a distinguished road
Quote:
Originally Posted by CeesH View Post
Hi hwet,

Indeed they are in the same mixture thread, which is why I can't use the thread values to distinguish between the size class.

As far as I understand the population balance approach works, the solver passes 2 bubble classes to the UDF, which calculates the coalescence rate between those classes, and feeds that back to the solver. Then the process repeats for the next 2 bubble classes, until all combinations were explored.
This mechanism is confirmed by printing d_1 and d_2 to the console for 1 gridcell, I get all possible combinations for d_1 and d_2 in series.

So the thing is, I want to know for that given d_1 and d_2 how many bubbles there are in that particular class. So hardcoding 0,1,.. directly doesn't work; I can of course set some if loop that contains (in pseudocode)
Code:
if d_1 == size, i = associated class
But this seems like a tedious exercise to me (not so much in programming, but having to burn through that if-loop every time seems time consuming)
So I was hoping there was a more direct way to get the bubble class associated with the passed diameters.
Dear Cees,
I tried with 'if loop' but it is showing some parse error. Did you solve your case with this udf? I am also trying to correct my udf (i have attached .c file).
Thanks.
Attached Files
File Type: c Luo-udf.c (2.3 KB, 7 views)
nhendre 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



All times are GMT -4. The time now is 09:55.