不知火舞的被虐|伊人天伊人天天综合网|博洛尼亚天气|任你懆这里只有精品4|久久美日韩精品久久|掌中之物漫画免费阅读观看|0丨d老妇

fluent 如何udf控制多入口逐個(gè)進(jìn)氣? 20

瀏覽:2616 回答:3

有2個(gè)進(jìn)氣口,如何控制入口1進(jìn)氣1s然后關(guān)閉,入口2進(jìn)氣1s然后關(guān)閉,然后循環(huán)作用。嘗試學(xué)udf控制,但失敗了(從效果圖看還是兩個(gè)口同時(shí)進(jìn)氣)。請(qǐng)教大神們?nèi)绾尉帉?xiě)udf或有什么招。

我的udf如下:

#include "udf.h"

DEFINE_PROFILE(inlet1_pressure, thread, position)

{

real t;

face_t f;

begin_f_loop(f, thread)

{

t=RP_Get_Real("flow-time");

if (0<t<=1 || 2<t<=3)

{

F_PROFILE(f,thread,position) = 300000;

}

else 

{

F_PROFILE(f,thread,position) = 0;

}

}

end_f_loop(f,thread)

}

DEFINE_PROFILE(inlet2_pressure, thread, position)

{

real t;

face_t f;

begin_f_loop(f, thread)

{

t=RP_Get_Real("flow-time");

if (1<t<=2 || 3<t<=4)

{

F_PROFILE(f,thread,position) = 300000;

}

else 

{

F_PROFILE(f,thread,position) = 0;

}

}

end_f_loop(f,thread)

}


邀請(qǐng)回答 我來(lái)回答

全部回答

(2)
默認(rèn) 最新
eleven666

程序if語(yǔ)句錯(cuò)了,寫(xiě)成如下格式就行

begin_f_loop(f, thread)

{

if (t>0&&t<=0.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>2&&t<=2.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>4&&t<=4.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>6&&t<=6.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>8&&t<=8.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>10&&t<=10.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>12&&t<=12.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>14&&t<=14.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>16&&t<=16.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else if (t>18&&t<=18.5 )

{

F_PROFILE(f,thread,position) = 400000;

}

else 

{

F_PROFILE(f,thread,position) = 0;

}

}

end_f_loop(f,thread)


2020年2月24日
已采納 評(píng)論 點(diǎn)贊
隨波逐流
教你兩個(gè)簡(jiǎn)單的方法:一是利用動(dòng)網(wǎng)格的event方法,可以改變?nèi)肟谶吔鐥l件類型,關(guān)閉就將其改為wall即可;二是用expression表達(dá)式中的時(shí)間判斷語(yǔ)句
2020年2月20日
評(píng)論 1 點(diǎn)贊

沒(méi)解決?試試專家一對(duì)一服務(wù)

換一批
    App下載
    技術(shù)鄰APP
    工程師必備
    • 項(xiàng)目客服
    • 培訓(xùn)客服
    • 平臺(tái)客服

    TOP