| 查看: 2026 | 回复: 9 | ||
[求助]
Fluent编译问题 已有1人参与
|
|
下面这段程序编译的时候老是出错,哪位大神能帮忙提点一下? #include"udf.h" int ID_out=18; real avg_temp=289.15; real NV_VEC(A); real sum_T_A=0.0; real sum_A=0.0; Thead *thread_out; face_t f; Domain *domain; DEFINE_ADJUST(adjust,d) { domain=Get_Domain(1); thread_out=Lookup_Thread(domain,ID_out); begin_f_loop(f,thread_out) { F_AREA(A,f,thread_out); sum_A+=NV_MAG(A); sum_T_A+=NV_MAG(A)*F_T(f,thread_out); } end_f_loop(f,thread_out) avg_temp=sum_T_A/sum_A; } DEFINE_PROFILE(inlet_T,t,i) { begin_f_loop(f,t) { F_PROFILE(f,t,i) = avg_temp; } end_f_loop(f,t) } Fluent报错: ..\..\src\temperature.c(7) : error C2143: 语法错误 : 缺少“{”(在“*”的前面) ..\..\src\temperature.c(13) : warning C4133: “=”: 从“Thread *”到“int *”的类型不兼容 ..\..\src\temperature.c(14) : error C2223: “->nelements”的左侧必须指向结构/联合 ..\..\src\temperature.c(16) : error C2223: “->storage”的左侧必须指向结构/联合 ..\..\src\temperature.c(16) : error C2223: “->storage”的左侧必须指向结构/联合 ..\..\src\temperature.c(16) : error C2223: “->storage”的左侧必须指向结构/联合 ..\..\src\temperature.c(18) : error C2223: “->storage”的左侧必须指向结构/联合 |
» 猜你喜欢
参与限项
已经有3人回复
假如你的研究生提出不合理要求
已经有7人回复
实验室接单子
已经有4人回复
全日制(定向)博士
已经有4人回复
对氯苯硼酸纯化
已经有3人回复
求助:我三月中下旬出站,青基依托单位怎么办?
已经有12人回复
不自信的我
已经有12人回复
所感
已经有4人回复
要不要辞职读博?
已经有7人回复
北核录用
已经有3人回复
MoonLee777
新虫 (正式写手)
- 应助: 3 (幼儿园)
- 金币: 2274.6
- 红花: 17
- 帖子: 839
- 在线: 78小时
- 虫号: 5947368
- 注册: 2017-03-12
- 性别: GG
- 专业: 流体力学
2楼2018-07-28 18:29:38
MoonLee777
新虫 (正式写手)
- 应助: 3 (幼儿园)
- 金币: 2274.6
- 红花: 17
- 帖子: 839
- 在线: 78小时
- 虫号: 5947368
- 注册: 2017-03-12
- 性别: GG
- 专业: 流体力学
3楼2018-07-28 18:30:04
tang985
新虫 (著名写手)
- 应助: 0 (幼儿园)
- 金币: 3010.1
- 散金: 1910
- 红花: 5
- 帖子: 2799
- 在线: 78.5小时
- 虫号: 3674717
- 注册: 2015-02-02
- 性别: GG
- 专业: 工程热物理相关交叉领域
4楼2018-08-02 00:28:32
tang985
新虫 (著名写手)
- 应助: 0 (幼儿园)
- 金币: 3010.1
- 散金: 1910
- 红花: 5
- 帖子: 2799
- 在线: 78.5小时
- 虫号: 3674717
- 注册: 2015-02-02
- 性别: GG
- 专业: 工程热物理相关交叉领域
5楼2018-08-02 00:30:23
MoonLee777
新虫 (正式写手)
- 应助: 3 (幼儿园)
- 金币: 2274.6
- 红花: 17
- 帖子: 839
- 在线: 78小时
- 虫号: 5947368
- 注册: 2017-03-12
- 性别: GG
- 专业: 流体力学
6楼2018-08-02 12:30:21
【答案】应助回帖
★ ★ ★ ★ ★ ★
15800971578: 金币+5, ★★★很有帮助 2018-08-08 16:54:27
小红豆: 金币+1, 违规存档, 违规留联系方式 2018-12-12 09:18:37
15800971578: 金币+5, ★★★很有帮助 2018-08-08 16:54:27
小红豆: 金币+1, 违规存档, 违规留联系方式 2018-12-12 09:18:37
|
#include"udf.h" #define id_out 18 real avg_temp = 289.15; real avg_temp_all = 289.15; define_adjust(adjust, d) { #if !rp_host thread *thread_out; //定义thread指针 face_t f=0; real nv_vec(a); real sum_t_a = 0.0; real sum_a = 0.0; thread_out = lookup_thread(d, id_out); #endif #if !parallel /*注意18.0以后需要在t0模式下测试*/ begin_f_loop(f, thread_out) { f_area(a, f, thread_out); sum_a += nv_mag(a); sum_t_a += nv_mag(a)*f_t(f, thread_out); } end_f_loop(f, thread_out) avg_temp = sum_t_a / sum_a; message("the avg temp is %g,", avg_temp); #endif #if rp_node real sum_a_all=0.; real sum_t_a_all=0.; real avg_temp_all=0.; begin_c_loop_int(c, t) { f_area(a, f, thread_out); sum_a += nv_mag(a); sum_t_a += nv_mag(a)*f_t(f, thread_out); } end_c_loop_int(c, t) avg_temp = sum_t_a / sum_a; message("the avg temp is %g in cpu %d. \n", avg_temp, myid); sum_a_all = prf_grsum1(sum_a) sum_t_a_all = prf_grsum1(sum_t_a); avg_temp_all = sum_t_a_all / sum_a_all; message0("the avg temp in all thread is %g,", avg_temp_all); #endif // rp_node } define_profile(inlet_t, t, i) { face_t f = 0; begin_f_loop(f, t) { #if parallel f_profile(f, t, i) = avg_temp; #else f_profile(f, t, i) = avg_temp_all; #endif } end_f_loop(f, t) } 针对你的意思 写了一个比较完全的包括简单并行的版本 未用到tui交换确定寻找域 未严格调试 |

7楼2018-08-04 16:08:29
8楼2018-08-08 16:51:12
9楼2018-08-08 16:52:48

10楼2018-08-08 18:11:50












回复此楼