c语言error_t错误码,UDF程序,形参t重定义等ERROR求教 - 仿真模拟 - 小木虫 - 学术 科研 互动社区...

CODE:

#include "udf.h"

#define cp 800

#define density 2180

DEFINE_PROFILE (unsteady_temp,t,i)

{

real tempn, templ, volume, Q,Q_tot,time,a,b,tempad;

real Heat[5]={278.5,280.7,278.5,280.5,285.2};

Domain *d;

Thread *t,*ct,*t0;

cell_t c,c0;

face_t f;

time = RP_Get_Real("flow-time");

a =time/3600;

b =a/24;

d = Get_Domain(1);

int i=(int)((int)a/24);

if (int(b)==b)   /*如果b是实数,Q_tot归零,否则在以往计算的基础上累加[color=Red]我这样表达正确么?[/color]*/

Q_tot=0;

thread_loop_c(ct,d)  /*Compute Q */ /*Loop over all cells循环DOMAIN上所有THREAD */

{

begin_c_loop(c,ct) /*Loop over all cells循环所有THREAD上所有CELL */

{

volume=C_VOLUME(c,ct); /* get cell volume */

templ=C_T_M1(c,ct); /*Get cell tempertuare of previous step有问题!!!!!!!!*/

tempn=C_T(c,ct);   /*Get cell tempertuare*/

Q=cp*density*volume*(tempn-templ);

Q_tot +=Q;

}

end_c_loop(c,ct)

}

if (Q_tot<= Heat[i])

begin_f_loop(f,t)

{

F_PROFILE(f,t,i)=333;  /*BC:Temp=333K*/

}

end_f_loop(f,t)

else

begin_f_loop(f,t)

{

c0 = F_C0(f,t);

t0 = THREAD_T0(t);

tempad=C_T(c0,t0); /*temperature of adjacent cell  [color=Red]这样取相邻CELL温度正确吗?可不可以直接取相邻FACE的温度值呢?查了MANUAL没有看到F_T(f0,t)的表达啊[/color]*/

F_PROFILE(f,t,i)=tempad;

}

end_f_loop(f,t)

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值