|
[Sponsors] |
May 9, 2017, 03:40 |
Who can fix the error on this UDF code???
|
#1 |
New Member
Join Date: Apr 2017
Posts: 7
Rep Power: 9 |
Hi everyone, I have to implement a UDF in fluent as a Wall Heat Generation Rate Profile on this geometric model
modello - Copia.PNG The wall heat generation must be in the wall of the inner cylinder and it's defined by these 2 equations T = (((mu_0)*3,14*(chi_2)*(frequency)*(magnetic_field_ quadrato))/(((mass_NPs)*(cp_NPs))+(cp_water)*(mass_water)))*t ; real source = ((mass_NPs)*(cp_NPs))+(cp_water)*(mass_water))* T; I got T then i got real source,the others are parameters with numeric values. I wrote this code for the UDF #include "udf.h" #define mu_0 1,256637*10^(-6) // permeabilitą elettrica vuoto (H/m)// #define chi_2 1,25 //suscettivitą magnetica #define frequency 344000 //frequenza campo #define magnetic_field_quadrato 21000 //campo magnetico #define mass_NPs 1.5 //massa nanoparticelle #define cp_NPs 0.67 //calore specifico nanoparticelle #define mass_water 498.5 //massa acqua #define cp_water 4.18 //calore specifico acqua DEFINE_PROFILE(wallheatgenerate,thread,i) { real t = CURRENT_TIME delta_T = (((mu_0)*3,14*(chi_2)*(frequency)*(magnetic_field_ quadrato))/(((mass_NPs)*(cp_NPs))+(cp_water)*(mass_water)))*t ; real source = ((mass_NPs)*(cp_NPs))+(cp_water)*(mass_water))* T;; face_t f; begin_f_loop(f,thread) F_PROFILE(f,thread,i) = source; end_f_loop(f,thread) } Then i got this error "f:undeclared variable" and "parse error" on these lines 15 delta_T = (((mu_0)*3,14*(chi_2)*(frequency)*(magnetic_field_ quadrato))/(((mass_NPs)*(cp_NPs))+(cp_water)*(mass_water)))*t ; 16 real source = ((mass_NPs)*(cp_NPs))+(cp_water)*(mass_water))* T;; 17 face_t f; Anyone can help me to fix it? Thanks a lot |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling the customized UDF code for PEMFC | dmfo | Fluent UDF and Scheme Programming | 2 | October 1, 2017 18:30 |
UDF code help solve reaction rate equation palm oil | zirkov | Fluent UDF and Scheme Programming | 0 | February 13, 2017 10:34 |
write code UDF Fluent solve kinetic reaction rate equation palm oil | zirkov | FLUENT | 0 | February 13, 2017 10:16 |
Difficulty with UDF code for HEAT FLUX | etudiant_IITB | Fluent UDF and Scheme Programming | 1 | December 7, 2015 08:07 |