|
[Sponsors] |
August 30, 2018, 08:37 |
UDF problem for Population balance model
|
#1 |
New Member
Join Date: Aug 2018
Posts: 16
Rep Power: 7 |
Hi everyone,
I have some difficulties using Fluent UDF and would like to share them with you, hopefully someone can help me out. I picked one of the Fluent UDF examples to define particle growth rate in a solid/liquid system where discrete population balance model is considered. Constant growth rate was already tested without any problem but an error message appears when I try to run a simulation with “Growth rate UDF” which is: ================================================== ============================ Node x: Process xxxx: Received signal SIGSEGV. ================================================== ============================ The fl process could not be started. My understanding is that something could be wrong between a macro in the UDF and some models in fluent. The Eulerian multiphase model with mass transfer and granular solid is applied. The energy equation is on and the memory location is also declared. Is there any need to turn the species transfer on? There could be also a parallelizing problem. I am confused here, and could not figure out how Fluent UDF actually process in parallel. The UDF is: /************************************************** ********************** 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 SS; real G; 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*/ SS = solute_mol_frac/solubility; /* Definition of Supersaturation */ if (SS <= 1.) { G = 0.; } else { G = Kg*pow((SS-1),Ng); } return G; } Any suggestion or comment is welcome and will be greatly appreciated. Amir |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with DPM simulation with particles injection and EXECUTE_AT_THE_END UDF. | Ari | Fluent UDF and Scheme Programming | 4 | May 31, 2016 08:51 |
problem with UDF for (v2-f) turbulence model in fluent | artemiss1984 | Fluent UDF and Scheme Programming | 6 | January 17, 2014 05:50 |
Problem with population balance model | vaibhavraikhare | FLUENT | 0 | January 28, 2012 10:08 |
The problem of UDF in Non premixed combustion model | zhangyuan | Main CFD Forum | 0 | May 25, 2009 09:41 |
UDF problem in multiphase model | Amir Khodabandeh | FLUENT | 1 | March 13, 2009 08:43 |