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

UDF growth rate, unsteady state

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 8, 2011, 05:04
Default UDF growth rate, unsteady state
  #1
New Member
 
r
Join Date: Mar 2011
Posts: 6
Rep Power: 5
roca is on a distinguished road
Hi!

I have a code for determining the growth rate of a crystal in terms of the supersaturation. However, I have realized that this code works only when I run the iterations in steady state. When I run iterations in unsteady state, I get an error message.

Does anyone have any idea about what I need to change?

Please see below the code

Thanks!
roca is offline   Reply With Quote

Old   March 8, 2011, 05:06
Default growth rate code
  #2
New Member
 
r
Join Date: Mar 2011
Posts: 6
Rep Power: 5
roca is on a distinguished road
/************************************************** **********************UDF that computes the particle growth rate********************************************** ***************************/

#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"

DEFINE_PB_GROWTH_RATE(growth_rate, cell, thread,d_1)
{
/* d_1 can be used if size-dependent growth is needed */
/* When using SMM, only size-independent or linear growth is allowed */

real G, S;
real Kg = 2.8e-8; /* growth constant */
real Ng = 1.; /* growth law power index */
real T,solute_mass_frac,solvent_mass_frac, solute_mol_frac,solubility;
real solute_mol_wt, solvent_mol_wt;

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_mol_wt = 74.55; /* molecular weight of potassium chloride */
solvent_mol_wt = 18.; /* molecular weight of water */
solute_mass_frac = C_YI(cell,tp,0); /* mass fraction of solute in primary phase (solvent) */
solvent_mass_frac = 1.0 - solute_mass_frac; solute_mol_frac = (solute_mass_frac/solute_mol_wt)/ ((solute_mass_frac/solute_mol_wt)+(solvent_mass_frac/solvent_mol_wt));

T = C_T(cell,tp); /* Temperature of primary phase in Kelvin */
solubility = 0.0005*T-0.0794; /* Solubility Law relating equilibrium solute mole fraction to Temperature*/
S = solute_mol_frac/solubility; /* Definition of Supersaturation */

if (S <= 1.)
{
G = 0.;
}
else
{
G = Kg*pow((S-1),Ng); }

return G;
}
roca is offline   Reply With Quote

Old   May 18, 2011, 23:33
Smile UDF cell growth
  #3
New Member
 
Jessie Bitog
Join Date: Mar 2011
Location: Seoul
Posts: 6
Rep Power: 5
aliyah is on a distinguished road
Hi,
Where do you linked your UDF code?
I'm basically doing the same where i wish to determine the growth rate of cells in a reactor. However, im still in the process of learning how to do it.
Anyone who can give some tips or infos related to this would is highly appreciated.
aliyah is offline   Reply With Quote

Reply

Tags
balance, growth rate, population, udf, unsteady state

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
strain rate in UDF Paulina FLUENT 11 November 20, 2014 04:06
UDF molar rate of creation/destruction of species Michal Fluent UDF and Scheme Programming 1 January 18, 2013 08:26
UDF Unsteady velocity profile Rashad FLUENT 0 February 27, 2008 15:57
unsteady UDF Sukanta Bhattacharjee FLUENT 0 August 20, 2007 12:11
UDF DPM Unsteady Lourival FLUENT 5 February 24, 2006 08:36


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