| 查看: 2293 | 回复: 7 | |||
[求助]
fluent中求解两相边界曲率的udf 已有1人参与
|
|
望提供求解两相边界曲率的udf代码, 或者提供求解散度的方法, 亦或提出一些合理化建议。 非常感谢 |
» 猜你喜欢
求标准粉末衍射卡号 ICDD 01-076-1802
已经有0人回复
新西兰Robinson研究所招收全奖PhD
已经有0人回复
物理学I论文润色/翻译怎么收费?
已经有222人回复
石墨烯转移--二氧化硅衬底石墨烯
已经有0人回复
笼目材料中量子自旋液体基态的证据
已经有0人回复
数学教学论硕士可以读数学物理博士吗?
已经有0人回复
德国亥姆霍兹Hereon中心汉堡分部招镁合金腐蚀裂变SCC课题方向2026公派博士生
已经有4人回复
澳门大学 应用物理及材料工程研究院 潘晖教授课题组诚招博士后
已经有11人回复
求助NH4V4O10晶体的CIF文件
已经有0人回复
xingfuww
专家顾问 (正式写手)
-

专家经验: +78 - 应助: 46 (小学生)
- 金币: 6628.4
- 散金: 52
- 红花: 29
- 帖子: 542
- 在线: 283.8小时
- 虫号: 1776059
- 注册: 2012-04-24
- 性别: GG
- 专业: 化学工程及工业化学
- 管辖: 仿真模拟
2楼2016-08-30 16:33:52
【答案】应助回帖
感谢参与,应助指数 +1
|
3 读取VOF梯度方法1 #include "udf.h" #include "sg.h" #include "sg_mphase.h" #include "flow.h" #include "mem.h" #include "metric.h" DEFINE_ADJUST(store_VOF_gradient, domain) { Thread *t; Thread *ppt; Thread **pt; cell_t c; int phase_domain_index=1; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index); Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG, Vof_Deriv_Accumulate); mp_thread_loop_c (t,domain,pt) { if (FLUID_THREAD_P(t)) { ppt = pt[phase_domain_index]; begin_c_loop (c,t) { C_UDMI(c,t,0) = C_VOF_G(c,ppt)[0]; C_UDMI(c,t,1) = C_VOF_G(c,ppt)[1]; C_UDMI(c,t,2) = C_VOF_G(c,ppt)[2]; } end_c_loop (c,t) } } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); } 上例利用了一些帮助上无法查到的FLUENT函数手动设置VOF梯度计算,Alloc_Storage_Vars, Scalar_Reconstruction,Scalar_Derivatives这些函数的大概功能可以猜到,但是没有详细说明。 4 读取VOF梯度方法2 将VOF赋值给UDS变量,然后通过C_UDSI_G间接求得梯度。 下例是FLUENT帮助文档中给出的一个例子: 将VOF赋值给UDS;进行一次迭代计算,但不计算UDS方程;尽管未计算UDS方程,仍可以得到梯度值,并将其赋值给UDM用于显示。 # include "udf.h" # define domain_ID 2 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); /* Fill UDS with the variable. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_VOF(c,t); } end_c_loop (c,t) } thread_loop_f (t,domain) { if (THREAD_STORAGE(t,SV_UDS_I(0))!=NULL) begin_f_loop (f,t) { F_UDSI(f,t,0) = F_VOF(f,t); } end_f_loop (f,t) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(1); /* Fill the UDM with magnitude of gradient. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop (c,t) } } |
3楼2016-08-31 09:38:58
【答案】应助回帖
|
3 读取VOF梯度方法1 #include "udf.h" #include "sg.h" #include "sg_mphase.h" #include "flow.h" #include "mem.h" #include "metric.h" DEFINE_ADJUST(store_VOF_gradient, domain) { Thread *t; Thread *ppt; Thread **pt; cell_t c; int phase_domain_index=1; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index); Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG, Vof_Deriv_Accumulate); mp_thread_loop_c (t,domain,pt) { if (FLUID_THREAD_P(t)) { ppt = pt[phase_domain_index]; begin_c_loop (c,t) { C_UDMI(c,t,0) = C_VOF_G(c,ppt)[0]; C_UDMI(c,t,1) = C_VOF_G(c,ppt)[1]; C_UDMI(c,t,2) = C_VOF_G(c,ppt)[2]; } end_c_loop (c,t) } } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); } 上例利用了一些帮助上无法查到的FLUENT函数手动设置VOF梯度计算,Alloc_Storage_Vars, Scalar_Reconstruction,Scalar_Derivatives这些函数的大概功能可以猜到,但是没有详细说明。 4 读取VOF梯度方法2 将VOF赋值给UDS变量,然后通过C_UDSI_G间接求得梯度。 下例是FLUENT帮助文档中给出的一个例子: 将VOF赋值给UDS;进行一次迭代计算,但不计算UDS方程;尽管未计算UDS方程,仍可以得到梯度值,并将其赋值给UDM用于显示。 # include "udf.h" # define domain_ID 2 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); /* Fill UDS with the variable. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_VOF(c,t); } end_c_loop (c,t) } thread_loop_f (t,domain) { if (THREAD_STORAGE(t,SV_UDS_I(0))!=NULL) begin_f_loop (f,t) { F_UDSI(f,t,0) = F_VOF(f,t); } end_f_loop (f,t) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(1); /* Fill the UDM with magnitude of gradient. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop (c,t) } } |
4楼2016-08-31 09:40:03
【答案】应助回帖
|
读取VOF梯度方法1 #include "udf.h" #include "sg.h" #include "sg_mphase.h" #include "flow.h" #include "mem.h" #include "metric.h" DEFINE_ADJUST(store_VOF_gradient, domain) { Thread *t; Thread *ppt; Thread **pt; cell_t c; int phase_domain_index=1; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index); Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG, Vof_Deriv_Accumulate); mp_thread_loop_c (t,domain,pt) { if (FLUID_THREAD_P(t)) { ppt = pt[phase_domain_index]; begin_c_loop (c,t) { C_UDMI(c,t,0) = C_VOF_G(c,ppt)[0]; C_UDMI(c,t,1) = C_VOF_G(c,ppt)[1]; C_UDMI(c,t,2) = C_VOF_G(c,ppt)[2]; } end_c_loop (c,t) } } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); } 上例利用了一些帮助上无法查到的FLUENT函数手动设置VOF梯度计算,Alloc_Storage_Vars, Scalar_Reconstruction,Scalar_Derivatives这些函数的大概功能可以猜到,但是没有详细说明。 2读取VOF梯度方法2 将VOF赋值给UDS变量,然后通过C_UDSI_G间接求得梯度。 下例是FLUENT帮助文档中给出的一个例子: 将VOF赋值给UDS;进行一次迭代计算,但不计算UDS方程;尽管未计算UDS方程,仍可以得到梯度值,并将其赋值给UDM用于显示。 # include "udf.h" # define domain_ID 2 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); /* Fill UDS with the variable. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_VOF(c,t); } end_c_loop (c,t) } thread_loop_f (t,domain) { if (THREAD_STORAGE(t,SV_UDS_I(0))!=NULL) begin_f_loop (f,t) { F_UDSI(f,t,0) = F_VOF(f,t); } end_f_loop (f,t) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(1); /* Fill the UDM with magnitude of gradient. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop (c,t) } } |
5楼2016-08-31 09:41:02
|
本帖内容被屏蔽 |
6楼2017-10-19 20:57:06
|
3 读取VOF梯度方法1 #include "udf.h" #include "sg.h" #include "sg_mphase.h" #include "flow.h" #include "mem.h" #include "metric.h" DEFINE_ADJUST(store_VOF_gradient, domain) { Thread *t; Thread *ppt; Thread **pt; cell_t c; int phase_domain_index=1; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index); Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG, Vof_Deriv_Accumulate); mp_thread_loop_c (t,domain,pt) { if (FLUID_THREAD_P(t)) { ppt = pt[phase_domain_index]; begin_c_loop (c,t) { C_UDMI(c,t,0) = C_VOF_G(c,ppt)[0]; C_UDMI(c,t,1) = C_VOF_G(c,ppt)[1]; C_UDMI(c,t,2) = C_VOF_G(c,ppt)[2]; } end_c_loop (c,t) } } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL); } 上例利用了一些帮助上无法查到的FLUENT函数手动设置VOF梯度计算,Alloc_Storage_Vars, Scalar_Reconstruction,Scalar_Derivatives这些函数的大概功能可以猜到,但是没有详细说明。 4 读取VOF梯度方法2 将VOF赋值给UDS变量,然后通过C_UDSI_G间接求得梯度。 下例是FLUENT帮助文档中给出的一个例子: 将VOF赋值给UDS;进行一次迭代计算,但不计算UDS方程;尽管未计算UDS方程,仍可以得到梯度值,并将其赋值给UDM用于显示。 # include "udf.h" # define domain_ID 2 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); /* Fill UDS with the variable. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_VOF(c,t); } end_c_loop (c,t) } thread_loop_f (t,domain) { if (THREAD_STORAGE(t,SV_UDS_I(0))!=NULL) begin_f_loop (f,t) { F_UDSI(f,t,0) = F_VOF(f,t); } end_f_loop (f,t) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(1); /* Fill the UDM with magnitude of gradient. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop (c,t) } } 发自小木虫IOS客户端 |
7楼2017-10-24 23:47:32
|
本帖内容被屏蔽 |
8楼2017-10-25 14:03:24












回复此楼