|
[Sponsors] |
October 9, 2011, 05:02 |
udf problem
|
#1 |
Member
rose
Join Date: Dec 2010
Posts: 30
Rep Power: 15 |
hi,
please can you help me . i have a big problem , i have a udf function and i want to display it but i cab't . i do'not know how? please help me ? best regards |
|
October 9, 2011, 09:00 |
|
#2 | |
Senior Member
|
Quote:
To display your function, you can store desired function in a UDM and then you can simply display that. But before that, ensure whether you need UDF or not, maybe you can achieve your purpose via custom field function. Bests,
__________________
Amir |
||
October 9, 2011, 10:13 |
udf display
|
#3 |
Member
rose
Join Date: Dec 2010
Posts: 30
Rep Power: 15 |
thank you amir,
i need udf and want to display it best regards |
|
October 9, 2011, 15:21 |
|
#4 |
Senior Member
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16 |
hi,
if you want to write a udf to define a new variable for postprocessing, more than 90 percent you can do it with custom field function as Amir said. but if you can't use this, perhaps UDM is a good idea. can you send the udf you've written? yours, mohammad |
|
October 10, 2011, 04:51 |
my big problem
|
#5 |
Member
rose
Join Date: Dec 2010
Posts: 30
Rep Power: 15 |
hi all,
thank you mohamed also amir for your help . this is my udfs and i want to display it #include <udf.h> DEFINE_PROPERTY (dyn_surf_tension, cell, thread) { real dst; real t=CURRENT_TIME; dst=141121*pow(t,5) - 38978*pow(t,4) + 3817.5*pow(t,3) - 148.84*pow(t,2) + 1.3033*pow(t,1) + 0.071; return dst; } and the second is #include "udf.h" #define GC 8.3145 /*gas constant*/ #define Ta 293 /*Temperature K*/ #define GAMMA 2.45e-10 /*adsorption mol/cm^2*/ #define MW 288.38 /*SDS Molecular weight*/ #define phase_2_ID 2 #define CV 3.4676 /*convert concentration from kg/m^3 to mmol/l*/ #define CST 0.001 /*convert dyn/cm to N/m*/ #define rho 370 /*SDS density kg/m^3*/ #define cmcst -0.25 /*change in surface tension w/ SDS conc. above critical micelle concentration (dyn/cm)*/ DEFINE_PROPERTY(surften,cell,ti) { Domain *d = Get_Domain(phase_2_ID); /*domain pointer*/ Thread *tp; /*thread from phase identified by phase_2_ID*/ real yi; /*mass fraction*/ tp = Lookup_Thread(d,THREAD_ID(ti)); /*rho = C_R(cell,tp);*/ /*concentration is yi*rho (kg/m^3) */ yi = C_YI(cell,tp,0); if (yi <= 0.0055) { C_UDMI(cell,tp,0) = (68.49- log(exp(yi*rho*1000/MW))*(6.516+3.353*log(exp(yi*rho*1000/MW)) ))*CST; C_UDMI(cell,tp,1) = (6.516+6.706*log(exp(yi*rho*1000/MW)))/(GC*MW); return (68.49- log(exp(yi*rho*1000/MW))*(6.516+3.353*log(exp(yi*rho*1000/MW))))*CST; /*Experimental results from Mysels*/ return (6.516+6.706*log(exp(yi*rho*1000/MW)))/(Ta*GC/MW); /*adsorption mol*10^-10cm^2*/ } else { C_UDMI(cell,tp,0) = (cmcst*yi*rho*1000/MW+39)*0.001; C_UDMI(cell,tp,1) = 0.25; /*constant adsorption*/ return (cmcst*yi*rho*1000/MW+39)*0.001; /*return 0;*/ } } in the both i can not display it and my second problem :how i canactivate a conncentartion? thank you |
|
October 10, 2011, 05:09 |
|
#6 | |
Senior Member
|
Quote:
1) You're using a DEFINE_PROPERTY to update a variable each time step; so I'm not sure but you may have this variable in display->contour list! 2) You set 2 UDMs and stored desired data in them; so you can easily display them in contour list. (main prodcedure: first activate UDMs in FLUENT; then it's better to initialize them before use (with patching)) 3) To activate a general concentration equation, you can use UDS template. (refer to manual) Bests,
__________________
Amir |
||
October 10, 2011, 06:03 |
|
#7 |
Member
rose
Join Date: Dec 2010
Posts: 30
Rep Power: 15 |
hi Amir,
yhank you for your réponse i use Define_Property but i have not this variable in display----contour list prehaps i know not interpert udf ? best regards |
|
October 10, 2011, 06:13 |
|
#8 | |
Senior Member
|
Quote:
I think you can find your variables in contour list if you check it carefully but if there isn't, it's not a problem; it's not depend on your method of implementation of UDF; interpret or compile !!! As I said before, use UDM for that. Bests,
__________________
Amir |
||
October 10, 2011, 07:33 |
another probmel
|
#9 |
Member
rose
Join Date: Dec 2010
Posts: 30
Rep Power: 15 |
thank you Amir
i have used a UDM but i have a other problem is: when i rau the iteration i have this message chip-exec: dyn_surf_tension: wrong return type: void udf function expectedchip-exec: dyn_surf_tension: wrong return type: void udf function expectedchip-exec: dyn_surf_tension: wrong return type: void udf function expectedDone best regards |
|
October 10, 2011, 08:59 |
|
#10 | |
Senior Member
|
Quote:
I checked your first UDF and It didn't have any problem during iteration! (I compiled that) I guess this issue may origin from finding binary files after implementation of UDF; in other words; you may change cas file path and libudf file is not in the appropriate folder. Try to compile/interpret it again in your new folder. (if you interpreted it; change UDF file path and do it again) Bests,
__________________
Amir |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 06:05 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 06:56 |
UDF problem | mansha goraya | FLUENT | 0 | October 29, 2007 00:31 |
udf compiling problem | akr | FLUENT | 3 | August 22, 2007 07:14 |
UDF problem | chiseung | FLUENT | 4 | January 10, 2002 09:58 |