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

Population Balance

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 30, 2015, 13:55
Default Population Balance
  #1
Member
 
Martin Nolan
Join Date: Dec 2014
Posts: 33
Rep Power: 12
mnolan93 is on a distinguished road
I am having issues with Population Balance setup. I have three fluids - dissolved paracetemol, IPA, and water. Depending on concentrations in each cell, the nucleation of paracetemol particles will be present. However, how do I get the particles created by the population balance to be pure paracetemol particles? I am using a discrete model with 2 phases (fluids and solid particles). I have written UDFs describing the crystallisation kinetics.

My UDF is also having problems. I am unsure how to fix these. My code is the following:

/************************************************** **********************
UDF for PopBal
************************************************** ***********************/

#include "udf.h"


DEFINE_PB_NUCLEATION_RATE(nuc_rate, cell, thread)
{
real J,C,Cstar,x;
real bo = 6829200; /* constant b0 */
real bi = 149900; /* constant b1 */
real rho = 1260; /* density of paracetemol crystals */
real solute_mass_frac,solvent_mass_frac,antisolvent_mas s_frac;


Thread *tc = THREAD_SUPER_THREAD(thread); /*obtain mixture thread */
Thread **pt = THREAD_SUB_THREADS(tc); /* pointer to sub_threads */
Thread *tp = pt[P_PHASE]; /* primary phase thread */

solute_mass_frac = C_YI(cell,tp,0); /* solute mass fraction */
solvent_mass_frac = C_YI(cell,tp,1); /* solvent mass fraction */
antisolvent_mass_frac = C_YI(cell,tp,2); /* antisolvent mass fraction */


x = antisolvent_mass_frac/(antisolvent_mass_frac+solvent_mass_frac);

Cstar = (0.000001*x*x*x)-(0.0002*x*x)+(0.0097x)+0.1087; /* solubility */

C = solute_mass_frac/solvent_mass_frac; /* concentration */

J = bo*exp(-bi*((log(rho/Cstar))*(log(rho/Cstar)))/(log(C/Cstar)));

return J;

}

DEFINE_PB_GROWTH_RATE(growth_rate, cell, thread)
{
real G,Ko,Ki,C,Cstar,deltaC,x;
real ka = 267; /* constant */
real kb = 89; /* constant */
real kc = -139; /* constant */
real kd = 917500; /* constant */
real ke = 9919300; /* constant */
real solute_mass_frac,solvent_mass_frac,antisolvent_mas s_frac;

Thread *tc = THREAD_SUPER_THREAD(thread); /*obtain mixture thread */
Thread **pt = THREAD_SUB_THREADS(tc); /* pointer to sub_threads */
Thread *tp = pt[P_PHASE]; /* primary phase thread */

solute_mass_frac = C_YI(cell,tp,0); /* solute mass fraction */
solvent_mass_frac = C_YI(cell,tp,1); /* solvent mass fraction */
antisolvent_mass_frac = C_YI(cell,tp,2); /* antisolvent mass fraction */


x = antisolvent_mass_frac/(antisolvent_mass_frac+solvent_mass_frac);

Cstar = (0.000001*x*x*x)-(0.0002*x*x)+(0.0097x)+0.1087; /* solubility */

C = solute_mass_frac/solvent_mass_frac; /* concentration */

Ko = (ka*x*x)+(kb*x)+kc;

Ki = (kd*x)+ke;

deltaC = C-Cstar

if (deltaC <= 0)
{
G = 0;
}
else;
{
G = Ko*pow((deltaC),Ki);
}
return G;
}


H:\\My Documents\\ARP\\UDF\\UDF.c:38: macro `DEFINE_PB_GROWTH_RATE' used with only 3 args
Error: H:\\My Documents\\ARP\\UDF\\UDF.c: line 28: parse error.
Error: H:\\My Documents\\ARP\\UDF\\UDF.c: line 59: parse error.
Error: H:\\My Documents\\ARP\\UDF\\UDF.c: line 69: parse error.
Error: H:\\My Documents\\ARP\\UDF\\UDF.c: line 73: parse error.

Any help is appreciated.

Thanks
mnolan93 is offline   Reply With Quote

Old   December 1, 2015, 08:03
Default
  #2
Member
 
Martin Nolan
Join Date: Dec 2014
Posts: 33
Rep Power: 12
mnolan93 is on a distinguished road
anyone able to help?

cheers
mnolan93 is offline   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
Coupling RPI wall boiling model with population balance model in Fluent softice2006 Fluent Multiphase 1 April 19, 2023 03:09
coupling population balance with reaction mehdi kamyabi FLUENT 7 December 5, 2015 02:14
Population balance for airlift reactor amira FLUENT 2 January 28, 2010 03:04
Population balance for airlift reactor (FLUENT) amira Main CFD Forum 1 October 31, 2009 08:54
Population Balance Theory student Main CFD Forum 2 August 10, 2008 05:12


All times are GMT -4. The time now is 14:39.