| 查看: 488 | 回复: 0 | ||
[求助]
Fluent UDF 求助
|
|
目的:将计算的每一个迭代步的流量导出,并利用欧拉插值得到压力值,并赋回给Fluent作为边界条件,进行下一个迭代步的计算,一直到计算收敛,该时间步结束。 问题:仅仅在第一个时间步的时候发现压力利用欧拉迭代产生了变化,在之后的计算中压力始终等于我赋的初值。求大牛解答这是为什么。 代码如下: DEFINE_PROFILE(DFA_outlet,thread,position) { real NV_VEC(A),NV_VEC(FaceVel); double Q; face_t f; int i; real t=RP_Get_Real("flow-time" ;real tt; // define the time in one cycle real w=0.8; // period of a cycle real p1[100]; // define the pressure after R1 double R1,R2,C; // define electric modulus int TTS; // total time steps int h,TS; // time interval and time step R1=9.717571*pow(10,8),R2=3.849843*pow(10,9),C=3.712461*pow(10,-10); // set the values of electric modulus TTS=100; // total time steps begin_f_loop(f,thread) { NV_D(FaceVel,=,F_U(f,thread),F_V(f,thread),F_W(f,thread)); F_AREA(A,f,thread); Q=NV_DOT(FaceVel,A); //compute the pressure using the explicit Euler method h=w/TTS; tt=t-floor(t/w)*w; TS=floor(tt/h); p1[0]=12102.65-Q*R1; if(TS=0) F_PROFILE(f,thread,position)=p1[0]+Q*R1; else for(i=1;i<=TS;i++) { p1[TS]=p1[TS-1]+h*(Q-(p1[TS-1]-1333.22)/R2)/C; } F_PROFILE(f,thread,position)=p1[TS]+Q*R1; } end_f_loop(f,thread) } @月只蓝 @beefly 发自小木虫Android客户端 |
» 猜你喜欢
【复旦大学】二维材料方向招收2026年博士研究生1名
已经有0人回复
北京纳米能源与系统研究所 王中林院士/曹南颖研究员课题组2026级硕/博/博后招生
已经有10人回复
物理学I论文润色/翻译怎么收费?
已经有87人回复
荷兰Utrecht University超快太赫兹光谱王海教授课题招收2026 CSC博士生
已经有23人回复
反铁磁体中的磁性切换:两种不同的机制已成功可视化
已经有0人回复
求标准粉末衍射卡号 ICDD 01-076-1802
已经有0人回复
新西兰Robinson研究所招收全奖PhD
已经有0人回复
石墨烯转移--二氧化硅衬底石墨烯
已经有0人回复













;
回复此楼