让流体运行一会 发表于 2022-9-21 11:27:28

运行网上一个流体程序,但为啥对话框说它11行有没被定义的量,有没有大神帮忙看看....

这是一个自定义材料的粘度程序如下,也许对你有帮助。

在记事本中编辑的,另存为"visosity1.c"
#include "udf.h"

DEFINE_PROPERTY(cell_viscosity,cell, thread)

{

real mu_lam;

real trial;

rate=CELL_STRAIN_RATE_MAG(cell, thread);

real temp=C_T(cell, thread);

mu_lam=1.e12;

{

if(rate>1.0e-4 && rate<1.e5)

trial=12830000./rate*log(pow((rate*exp(17440.46/temp)/1.535146e8),0.2817)+pow((1.+pow((rate*exp(17440.46/temp)/1.535146e8),0.5634)),0.5));

else if (rate>=1.e5)

trial=128.3*log(pow((exp(17440.46/temp)/1.535146e8),0.2817)+pow((1.+pow((exp(17440.46/temp)/1.535146e8),0.5634)),0.5));

else

trial=1.283e11*log(pow((exp(17440.46/temp)/1.535146e12),0.2817)+pow((1.+pow((exp(17440.46/temp)/1.535146e12),0.5634)),0.5));

}

else if(temp>=855.&&temp<905.)

{

if(rate>1.0e-4 && rate<1.e5)



trial=12830000./rate*log(pow((rate*4.7063),0.2817)+pow((1.+pow((rate*4.7063),0.5634)),0.5))*pow(10.,-0.06*(temp-855.));

else if (rate>=1.e5)

trial=243.654*pow(10.,-0.06*(temp-855.));

else

trial=1.47897e10*pow(10.,-0.06*(temp-855.));

}

else if(temp>=905.)

{

if(rate>1.0e-4 && rate<1.e5)

trial=12830./rate*log(pow((rate*4.7063),0.2817)+pow((1.+pow((rate*4.7063),0.5634)),0.5));

else if (rate>=1.e5)

trial=0.24365;

else

trial=1.47897e7;

}

if(trial<1.e12&&trial>100.)

mu_lam=trial;

else if(trial<=1.)

mu_lam=1.;

else

mu_lam=1.e12;

return mu_lam;

}

让流体运行一会 发表于 2022-9-21 11:28:19

上面的应该都是英文不知道咋回事全变中文了

让流体运行一会 发表于 2022-9-21 11:28:57

https://www.cnblogs.com/liusuanyatong/p/11259846.html具体可看这个链接
页: [1]
查看完整版本: 运行网上一个流体程序,但为啥对话框说它11行有没被定义的量,有没有大神帮忙看看....