| 1 | 1/1 | 返回列表 |
| 查看: 1323 | 回復: 0 | ||
[求助]
fluent中UDF設定邊界條件,導入出錯
|
|
最近在做一個fluent模擬,需要設定非穩(wěn)態(tài)邊界條件,寫了一個UDF程序如下,導入fluent里面時,出現(xiàn): Error: C:\Users\\305\313\346\257\Desktop\pexit2.c.c: line 18: parse error. Error: C:\Users\\305\313\346\257\Desktop\pexit2.c.c: line 19: invalid lvalue in assignment. 的錯誤,但是鄙人實在找不出錯誤之處,所以請教各位大神(由于是新蟲,總共只有5個金幣,對不起各位了!) UDF程序: #include"udf.h" #define r_1 20 #define r_2 15.4 #define a 0.77 #define w 418.879 #define H 18 #define t 3.2 #define m 1.2 #define p_s 587050 #define p_d 1980000 #define V_r pi*(pow(r_1,2)-pow(r_2,2))*H DEFINE_PROFILE(unsteady_pressure,thread,position) { face_t f; begin_f_loop(f,thread) { real t=RP_Get_Real("flow-time" ;t=t-0.015*floor(t/0.015); if(t<0.002083 && t>0) F_PROFILE(f,thread,position)=587050; else if(t<=0.00845256 && t>=0.002083) real f_beta,h_beta,V_cbeta; f_beta=(1-pow(a,2))*418.879*t-0.5*pow((1-a),2)*sin(2.0*418.879*t)-pow(a,2)*asin((1.0/a-1)*sin(418.879*t))-a*(1-a)*sin(418.879*t)*pow((1-pow((1.0/a-1),2)*pow(sin(418.879*t),2)),0.5); h_beta=r_1*(1-(1-a)*cos(418.879*t)-sqrt(pow((1-a),2)*pow(cos(418.879*t),2)+2*a-1)); V_cbeta=V_r-0.5*H*(pow(r_1,2)*f_beta+h_beta*t); F_PROFILE(f,thread,position)=587050*pow((8932/V_cbeta),1.2); else if(t<=0.01375 && t>0.00854256) F_PROFILE(f,thread,position)=2144045.39-45844.5044*418.879*t; else if(t<=0.0141667 && t>0.01375) F_PROFILE(f,thread,position)=44548090.82-3103131857*t; else if(t<=0.015 && t>0.0146667) F_PROFILE(f,thread,position)=587050; } end_f_loop(f,thread) } DEFINE_PROFILE(unsteady_temperature,thread,position) { face_t f; begin_f_loop(f,thread) { real t=RP_Get_Real("flow-time" ;t=t-0.015*floor(t/0.015); if(t<0.002083 && t>0) F_PROFILE(f,thread,position)=308.15; else if(t<=0.00854256 && t>=0.002083) F_PROFILE(f,thread,position)=308.15*pow(587050*pow((8932/V_cbeta),1.2)/587050,0.16667); else if(t<=0.01375 && t>0.00854256) F_PROFILE(f,thread,position)=308.15*pow((2144045.39-45844.5044*418.879*t)/587050,0.16667); else if(t<=0.0141667 && t>0.01375) F_PROFILE(f,thread,position)=308.15*pow((44548090.82-3103131857*t)/587050,0.16667); else if(t<=0.015 && t>0.0141667) F_PROFILE(f,thread,position)=308.15; } end_f_loop(f,thread) } |

找到一些相關的精華帖子,希望有用哦~
| 1 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 298-一志愿中國農業(yè)大學-求調劑 +9 | 手機用戶 2026-03-17 | 9/450 |
|
|---|---|---|---|---|
|
[考研] 一志愿武漢理工材料工程專碩調劑 +7 | Doleres 2026-03-19 | 7/350 |
|
|
[考研] 材料學碩318求調劑 +5 | February_Feb 2026-03-19 | 5/250 |
|
|
[考研]
|
不想起名字112 2026-03-19 | 3/150 |
|
|
[考研] 307求調劑 +9 | 冷笙123 2026-03-17 | 9/450 |
|
|
[考研] 324分 085600材料化工求調劑 +3 | llllkkkhh 2026-03-18 | 3/150 |
|
|
[考研] 一志愿985,本科211,0817化學工程與技術319求調劑 +10 | Liwangman 2026-03-15 | 10/500 |
|
|
[考研] 材料工程專碩調劑 +5 | 204818@lcx 2026-03-17 | 6/300 |
|
|
[考研] 一志愿華中科技大學,080502,354分求調劑 +4 | 守候夕陽CF 2026-03-18 | 4/200 |
|
|
[考研] 08工科 320總分 求調劑 +5 | 梨花珞晚風 2026-03-17 | 5/250 |
|
|
[考研] 302求調劑 +10 | 呼呼呼。。。。 2026-03-17 | 10/500 |
|
|
[考博] 26博士申請 +3 | 1042136743 2026-03-17 | 3/150 |
|
|
[考研] 有沒有道鐵/土木的想調劑南林,給自己招師弟中~ +3 | TqlXswl 2026-03-16 | 7/350 |
|
|
[考研] 一志愿蘇州大學材料工程(085601)專碩有科研經(jīng)歷三項國獎兩個實用型專利一項省級立項 +6 | 大火山小火山 2026-03-16 | 8/400 |
|
|
[論文投稿] 有沒有大佬發(fā)小論文能帶我個二作 +3 | 增銳漏人 2026-03-17 | 4/200 |
|
|
[考研] 333求調劑 +3 | 文思客 2026-03-16 | 7/350 |
|
|
[考研] 326求調劑 +4 | 諾貝爾化學獎覬?/a> 2026-03-15 | 7/350 |
|
|
[考研] 一志愿211 0703方向310分求調劑 +3 | 努力奮斗112 2026-03-15 | 3/150 |
|
|
[考研] 277材料科學與工程080500求調劑 +3 | 自由煎餅果子 2026-03-16 | 3/150 |
|
|
[考研] 080500,材料學碩302分求調劑學校 +4 | 初識可樂 2026-03-14 | 5/250 |
|