24小时热门版块排行榜    

查看: 1296  |  回复: 0

pjhust

新虫 (初入文坛)

[求助] fluent中UDF设定边界条件,导入出错

最近在做一个fluent模拟,需要设定非稳态边界条件,写了一个UDF程序如下,导入fluent里面时,出现:
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)
}
回复此楼
前进
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

找到一些相关的精华帖子,希望有用哦~

科研从小木虫开始,人人为我,我为人人
相关版块跳转 我要订阅楼主 pjhust 的主题更新
信息提示
请填处理意见