关于改变材料性质的udf程序编写?

关于改变材料性质的udf程序编写?,第1张

一下依次为原油粘度、粘度和导热系数的UDF。本来想把函数给你写好的,一看你的公式那么长就取消没这个念头了。希望对你有帮助。

#include "udf.h"

/*1-oil density*/

DEFINE_PROPERTY(cell_density,cell,thread)

{

real density

real temp = C_T(cell,thread)/*temp就是温度*/

density = -1172.12 /*补全你的函数*/

return density

}

/*2-oil viscosity*/

DEFINE_PROPERTY(cell_viscosity,cell,thread)

{

real viscosity

real temp = C_T(cell,thread)

viscosity = 0.001779 /*补全你的函数*/

return viscosity

}

/*3-oil thermal conductivity*/

DEFINE_PROPERTY(cell_heatconductivity,cell,thread)

{

real heatconductivity

real temp = C_T(cell,thread)

heatconductivity = -2.2969+/*补全你的函数*/

return thecon

}

UDF定义进出口,定义材料性质,定义流体初始化等,具体在用户界面里的define-----user-defined------functions导入程序文件就行,程序可以用C语言编写,用txt写字板或者word以及专业的编程软件都行,最后把它们转成.c的文件就行了

你试试看吧。注意格式改写,我在这个里面打的,格式可能有问题。

#include "udf.h"

DEFINE_PROFILE(inlet_velocity, thread, index)

{

real x[ND_ND],y

face_t f

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread)

y = x[1]

F_PROFILE(f, thread, index) =2.4*ln(350*y)+5.5

}

end_f_loop(f, thread)

}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/yw/11346028.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存