| 查看: 1799 | 回复: 1 | |||
乙凡良新虫 (小有名气)
|
[求助]
fluent udf中流场初始化要加随机脉动,如何加,求大神? 已有1人参与
|
|
如题,想用fluent中udf在流场初始化时加个随机脉动,编了个udf却未能实现,请教大神? #include "udf.h" #include "time.h" #include "stdlib.h" DEFINE_INIT(my_init2_function, domain) { cell_t c; Thread *t; real xc[ND_ND]; int number; real ans; /* loop over all cell threads in the domain */ thread_loop_c (t,domain) { /* loop over all cells */ begin_c_loop_all (c,t) { C_CENTROID(xc,c,t); srand(time(0)); number=rand()%2001; ans=number*1.0/10000; C_U(c,t)=1.02+ans*1.02; C_V(c,t)=ans; C_W(c,t)=ans; } end_c_loop_all (c,t) } } |
» 猜你喜欢
317一志愿华南理工电气工程求调剂
已经有5人回复
化工专硕348,一志愿985求调剂
已经有6人回复
292求调剂
已经有3人回复
304求调剂
已经有4人回复
290求调剂
已经有6人回复
295求调剂
已经有5人回复
26申博
已经有4人回复
材料学调剂
已经有5人回复
264求调剂
已经有3人回复
311求调剂
已经有8人回复
mycc
专家顾问 (正式写手)
-

专家经验: +181 - 应助: 230 (大学生)
- 金币: 2589.6
- 红花: 35
- 帖子: 531
- 在线: 58.8小时
- 虫号: 881523
- 注册: 2009-10-23
- 性别: GG
- 专业: 流体力学
- 管辖: 仿真模拟

2楼2016-06-17 08:27:35













回复此楼