马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我在编写用PR方程求解超临界co2密度的UDF程序时采用的是盛金公式,但我只考虑了盛金公式中得Δ=B^2-4AC>0时的情况,所以在初始化流场时通不过,求哪位大侠可以帮我分析分析,急求有类似的程序,或也写过此程序的能够帮助我一下,谢谢了。附上我写的程序:
#include "udf.h"
#define TC 305.25
#define PC 7380000
#define W 0.225
#define R 8.314
#define tc 305.25
#define pc 7375000
#define w 0.225
#define r 8.314
#define pc1 73.75
#define dc 468
#define m 44.01
#define v0 150
DEFINE_PROPERTY(cell_density, cell, thread)
{
real dd;
real temp = C_T(cell, thread);
real pres = C_P(cell, thread);
real tr,k,a1,a2,a,b,a3,a4,a5,a6,b1,b2,b3,y1,y2,y3,x;
tr = temp/TC;
k = 0.37464+1.54226*W-0.26992*W*W;
a1 = (1+k*(1-sqrt(tr)))*(1+k*(1-sqrt(tr)));
a2 = 0.45724*R*R*TC*TC/PC;
a = a1*a2;
b=0.0778*R*TC/PC;
a3=pres;
a4=pres*b-R*temp;
a5=a-3*pres*b*b-2*R*temp*b;
a6=pres*b*b*b+R*temp*b*b-a*b;
b1 = a4*a4-3*a3*a5;
b2 = a4*a5-9*a3*a6;
b3 = a5*a5-3*a4*a6;
y1 = b1*a4+3*a3*(-b2+sqrt(b2*b2-4*b1*b3))/2;
y2 = b1*a4+3*a3*(-b2-sqrt(b2*b2-4*b1*b3))/2;
if (y1<0)
{y3=-y1;}
else
{y3=y1;}
x = (-a4-(pow(y3,0.33333)-pow(-y2,0.33333)))/(3*a3);
dd =44/(1000*x);
return dd;
} |