求大神指导物性随两个变量改变的UDF怎么写啊

#include "udf.h"
DEFINE_PROPERTY(cell_viscosity ,cell ,thread)
{
real mu_lam;
real temp = C_T(cell,thread);
real density = 1011.63-0.2205194*temp-1.92249*pow(10,-5)*pow(temp,2)+5.63788*pow(10,-9)*pow(temp,3);
if (temp > 773)
mu_lam = 0.0851*pow(10,-4)*pow(density,1/3)*exp((1.04*density)/temp);
else
mu_lam = 0.1235*pow(10,-4)*pow(density,1/3)*exp((1.04*density)/temp);
return mu_lam;
}
麻烦大神帮忙看下哪里不对?图是物性的公式,密度本身就是温度的函数,粘度又是密度和温度的函数。下面是我写的UDF。
全部回答 (3)
默认 最新
你可以定义个密度udf define property(rho,cell,thread)定义密度,讲你写得多项式写进去就可以了,然后在写粘性udf,上面udf 中密度可以通过宏来获得C_R(c,t).按照你上式操作就可以了。
2016年12月15日
评论 点赞
密度是可以直接读宏的啊,仅定义温度就行,密度是多项式的,那你在材料属性里边用多项式密度,然后用宏取材料密度就可以了
2016年11月29日
评论 点赞
@steve_zheng @龙樱@液风@fluent专家
2016年11月29日
评论 点赞

木子丞 2016年12月15日


















