找回密码
 注册
查看: 1749|回复: 3

分段源,编译问题!!

[复制链接]
发表于 2007-4-11 11:25:57 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
(system "copy C:\Fluent.Inc\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\3d\makefile")已复制         1 个文件。
0
(chdir "libudf")()
(chdir "ntx86\3d")()
3w.c
..\..\src\3w.c(94) : error C2109: subscript requires array or pointer type
..\..\src\3w.c(95) : error C2106: ';='; : left operand must be l-value
..\..\src\3w.c(97) : error C2181: illegal else without matching if
..\..\src\3w.c(100) : error C2109: subscript requires array or pointer type
..\..\src\3w.c(101) : error C2106: ';='; : left operand must be l-value
..\..\src\3w.c(103) : error C2181: illegal else without matching if
..\..\src\3w.c(106) : error C2109: subscript requires array or pointer type
..\..\src\3w.c(107) : error C2106: ';='; : left operand must be l-value
..\..\src\3w.c(109) : error C2181: illegal else without matching if
..\..\src\3w.c(111) : error C2109: subscript requires array or pointer type
..\..\src\3w.c(111) : error C2106: ';='; : left operand must be l-value
 楼主| 发表于 2007-4-11 11:29:58 | 显示全部楼层

分段源,编译问题!!

[这个贴子最后由maplelxfeng在 2007/04/11 11:45am 第 1 次编辑]

相应的程序:
#include "udf.h"
#define B1 0.5         //surface adsorption rate
#define n 0.5          //decay coefficient
#define STM 1/2592000   //second to month
DEFINE_SOURCE(t_source,cell,thread,dS,eqn)                   //heat
{
real source;
real x[ND_ND];
real t = RP_Get_Real("flow-time");
    real yue=t*STM+1;
    if(yue<5)
source=13.508*yue*yue*yue*yue+158.78*yue*yue*yue-629.59*yue*yue+1001.8*yue-591.96;
dS[eqn]=(1-B1)*exp(-n*x[1])*(-9.8774*yue*yue*yue*yue+112.17*yue*yue*yue-428.47*yue*yue+667.36*yue-283.19);
else if(5<=yue<9)
source=7.9213*yue*yue*yue*yue-119.22*yue*yue*yue+592.81*yue*yue-1116.9*yue+717.52;
dS[eqn]=(1-B1)*exp(-n*x[1])*(0.5214*yue*yue*yue*yue
-26.861*yue*yue*yue+205.6*yue*yue-504.99*yue+516.04);
else if(9<=yue<13)
source=-1.1321*yue*yue*yue*yue+17.908*yue*yue*yue
-102.19*yue*yue+215.64*yue-128.86;
dS[eqn]=(1-B1)*exp(-n*x[1])*(-6.9335*yue*yue*yue*yue
+87.048*yue*yue*yue-378.56*yue*yue+664.11*yue-264.24);
else if
source=0.00000000;
dS[eqn]=0.00000000;
return source;
}
望高手指点!先谢过
 楼主| 发表于 2007-4-11 11:46:24 | 显示全部楼层

分段源,编译问题!!

开始source小写的错误,后改为大写后出现:
(system "copy C:\Fluent.Inc\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\3d\makefile")已复制         1 个文件。
0
(chdir "libudf")()
(chdir "ntx86\3d")()
3w.c
..\..\src\3w.c(97) : error C2181: illegal else without matching if
..\..\src\3w.c(103) : error C2181: illegal else without matching if
..\..\src\3w.c(109) : error C2181: illegal else without matching if
..\..\src\3w.c(110) : error C2061: syntax error : identifier ';source';
 楼主| 发表于 2007-4-11 16:10:27 | 显示全部楼层

分段源,编译问题!!

[这个贴子最后由maplelxfeng在 2007/04/11 04:14pm 第 2 次编辑]

上面的问题解决了!现在出现了新的问题:
&#35;include "udf.h"
DEFINE_DELTAT(timedeltat,domain)
{
  real time_step;                                       
  real t = RP_Get_Real("flow-time");
  if(t<2592000)
      time_step=30;           //half minute
  else if(2592000<t<25920000)
      time_step=120;   
  else
      time_step=600;     //ten minutes
  return time_step;
}
               
运行时出现:
(system "copy C:\Fluent.Inc\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\2d\makefile")已复制         1 个文件。
0
(chdir "libudf")()
(chdir "ntx86\2d")()
Done.
"e:/working file/mode"
Opening library "libudf"...
Error: open_udf_library: 系统找不到指定的文件。      
  
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表