|
[Sponsors] |
There was an error in the UDF definition inlet speed |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 26, 2019, 21:35 |
There was an error in the UDF definition inlet speed
|
#1 |
New Member
Yeyue
Join Date: Dec 2019
Posts: 3
Rep Power: 6 |
Velocity changes with the temperature of the flow field. I don't know how the UDF calls the fluent temperature field. UDF programming is as follows, import fluent prompts the error as follows, I hope to get your help ~Thank you.
#include"udf.h" DEFINE_PROFILE(in_x_velocity,cell,thread) { real x[ND_ND]; real y; real temp=C_T(cell,thread); real n; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y=x[1]; n=5.7171-0.009*temp; y=4.7*10e-6*exp(6800/temp); real yy; yy=pow(m,1/n); { if(temp>291.15) F_PROFILE(f,cell,thread)=0.02*(n+3)/(n+1)*(1-pow((y/0.010435),(n+1))); else F_PROFILE(f,cell,thread)=0.02*(n+3)/(n+1)*(1/(4*pow(1.52,n)+(n+3)*(5.964-0.02*temp)*100*1.52/yy)*(4*pow(1.52,n)/y*(1-pow((y/0.010435),(n+1)))+2(n+1)*(5.964-0.02*temp)*100*1.52/yy*(1-pow((y/0.010435),2)) } end_f_loop(f,thread) } cpp -I"D:\ansys\ANSYS Inc\v150\fluent\fluent15.0.0/src" -I"D:\ansys\ANSYS Inc\v150\fluent\fluent15.0.0/cortex/src" -I"D:\ansys\ANSYS Inc\v150\fluent\fluent15.0.0/client/src" -I"D:\ansys\ANSYS Inc\v150\fluent\fluent15.0.0/multiport/src" -I. -DUDFCONFIG_H "<C:/Users/ADMINI~1/AppData/Local/Temp/udfconfig-30856-node1.h>" "C:/Users/ADMINI~1/AppData/Local/Temp/Velocity1.c.30856.1.c" Error: C:/Users/ADMINI~1/AppData/Local/Temp/Velocity1.c.30856.1.c: line 6: non-integer subscript expression: pointer to structure. |
|
December 26, 2019, 21:59 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you must compile following
Code:
#include "udf.h" #include "math.h" DEFINE_PROFILE(in_x_velocity,t, i) { real x[ND_ND]; real y; real temp; real n; real y; real yy; face_t f; begin_f_loop(f,t) { temp=F_T(f,t) F_CENTROID(x,f,t); y=x[1]; n=5.7171-0.009*temp; y=4.7*10e-6*exp(6800/temp); yy=pow(m,1/n); { if(temp>291.15) F_PROFILE(f,t,i)=0.02*(n+3)/(n+1)*(1-pow((y/0.010435),(n+1))); else F_PROFILE(f,t,i)=0.02*(n+3)/(n+1)*(1/(4*pow(1.52,n)+(n+3)*(5.964-0.02*temp)*100*1.52/yy)*(4*pow(1.52,n)/y*(1-pow((y/0.010435),(n+1)))+2(n+1)*(5.964-0.02*temp)*100*1.52/yy*(1-pow((y/0.010435),2)) } end_f_loop(f,t) }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
December 26, 2019, 22:51 |
udf
|
#3 |
New Member
Yeyue
Join Date: Dec 2019
Posts: 3
Rep Power: 6 |
Hello, I modified it according to your comments, but the following problems will still occur, and I look forward to your reply.
#include"udf.h" #include"math.h" DEFINE_PROFILE(in_x_velocity,thread,index) { real x[ND_ND]; real y; real n; real yy; real w; real temp; face_t f; Thread *t; begin_f_loop(f,thread) { temp=F_T(f,t); F_CENTROID(x,f,thread); y=x[1]; n=5.7171-0.009*temp; yy=0.0000047*exp(6800/temp); w=pow(yy,1/n); { if(temp>291.15) F_PROFILE(f,thread,index)=0.02*(n+3)/(n+1)*(1-pow((y/0.010435),(n+1))); else if(temp>=288.15&&temp>=291.15) F_PROFILE(f,thread,index)=0.02*(n+3)/(n+1)*(1/(4*pow(1.52,n)+(n+3)*(5.964-0.02*temp)*100*1.52/w)*(4*pow(1.52,n)/yy*(1-pow((y/0.010435),(n+1)))+2(n+1)*(5.964-0.02*temp)*100*1.52/w*(1-pow((y/0.010435),2)) } end_f_loop(f,thread) } cpp -I"D:\ansys\ANSYS Inc\v150\fluent\fluent15.0.0/src" -I"D:\ansys\ANSYS Inc\v150\fluent\fluent15.0.0/cortex/src" -I"D:\ansys\ANSYS Inc\v150\fluent\fluent15.0.0/client/src" -I"D:\ansys\ANSYS Inc\v150\fluent\fluent15.0.0/multiport/src" -I. -DUDFCONFIG_H "<udfconfig.h>" "C:\Users\Administrator\Desktop\UDF\Velocity1. c" Error: udfconfig.h: line 16: parse error. ----------------------------------- best regards |
|
December 27, 2019, 02:06 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
__________________
best regards ****************************** press LIKE if this message was helpful |
|
December 27, 2019, 02:28 |
|
#5 |
New Member
Yeyue
Join Date: Dec 2019
Posts: 3
Rep Power: 6 |
I can't open the website you sent. Can you help me modify this program if you are convenient? Thank you very much.
-------------------------------------- best regards |
|
December 27, 2019, 05:00 |
|
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
make working directory
put there your case file and UDF file open VIsual Studio console and run Fluent from this console compile UDF, load UDF
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
fluent, udf, velocity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Disappearing mass when using udf inlet profile | divergence | Fluent UDF and Scheme Programming | 5 | January 2, 2021 15:56 |
how to put udf inlet velocity and udf outlet pressure in fluent | raminostadi | Fluent UDF and Scheme Programming | 4 | July 3, 2017 07:43 |
UDF profile: Fluent method for coupling inlet and outlet | I-mech | Fluent UDF and Scheme Programming | 0 | May 10, 2014 11:36 |
"Closing" a pressure inlet via UDF? | dave88 | Fluent UDF and Scheme Programming | 0 | August 27, 2013 19:14 |
Urgent! Help on UDF to set inlet velocity | Ray Hong | FLUENT | 4 | December 30, 2005 13:32 |