| 查看: 2312 | 回复: 7 | |||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | |||
[求助]
fluent中求解两相边界曲率的udf 已有1人参与
|
|||
|
望提供求解两相边界曲率的udf代码, 或者提供求解散度的方法, 亦或提出一些合理化建议。 非常感谢 |
» 猜你喜欢
数学教学论硕士可以读数学物理博士吗?
已经有0人回复
德国亥姆霍兹Hereon中心汉堡分部招镁合金腐蚀裂变SCC课题方向2026公派博士生
已经有4人回复
物理学I论文润色/翻译怎么收费?
已经有151人回复
澳门大学 应用物理及材料工程研究院 潘晖教授课题组诚招博士后
已经有11人回复
求助NH4V4O10晶体的CIF文件
已经有0人回复
英国全奖博士招聘-深度学习与量子物理
已经有0人回复
间接带隙半导体有效质量求助
已经有1人回复
投稿chemical physical letters不送审?
已经有2人回复
南开大学物理学院张书辉副教授招收凝聚态物理理论方向博士生、硕士生
已经有22人回复
杂志要求提供official language-editing certificate
已经有4人回复
深圳大学2026年秋博士招生-物理学-活性胶体方向-高永祥课题组
已经有16人回复
【答案】应助回帖
感谢参与,应助指数 +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
xingfuww
专家顾问 (正式写手)
-

专家经验: +78 - 应助: 46 (小学生)
- 金币: 6629.4
- 散金: 52
- 红花: 29
- 帖子: 542
- 在线: 283.8小时
- 虫号: 1776059
- 注册: 2012-04-24
- 性别: GG
- 专业: 化学工程及工业化学
- 管辖: 仿真模拟
2楼2016-08-30 16:33:52
【答案】应助回帖
|
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













回复此楼