
大家好,我编的udf在编译的时候没有提示错误,可是初始化的时候却出现这样的错误,请问udf错在哪里呢?谢 5
提示的错误如下:Error:FLUENTreceivedfatalsignal(ACCESS_VIOLATION)1.Noteexacteventsleadingtoer...
提示的错误如下:
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()
我的问题是氯化锂溶液除去湿空气中的水蒸气,两相流用VOF模型,主相是湿空气,次相是溶液,湿空气和氯化锂溶液分别用组分输运模型,湿空气的组分有水蒸气和空气,溶液的组分是LiCl和液态水,我想定义氯化锂溶液的密度,这个密度是跟溶液的温度和质量分数有关系的,关系式有点复杂,程序如下:
#include "udf.h"
DEFINE_PROPERTY(cell_density,cell,thread)
{
int phase_domain_index;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
Domain *mixture_domain;
real rho_licl;
sub_domain_loop(subdomain, mixture_domain, phase_domain_index) /* loop over all subdomains (phases) in the superdomain (mixture) */
{
if (DOMAIN_ID(subdomain) == 2) /* loop if secondary phase */
thread_loop_c (cell_thread,subdomain) /* loop over all cell threads in the secondary phase domain */
{
begin_c_loop_all (cell,cell_thread) /* loop over all cells in secondary phase cell threads */
{
real T=C_T(cell,cell_thread); /*得到次相温度*/
real MF=C_YI(cell,cell_thread,0); /* 得到次相中LiCl的质量分数,在material里在LiCl是在第一个位置,所以是0*/
rho_licl=(322*(1+1.993771843*pow((1-(T+273.15)/647.3),0.3333333333333333333333333)
+1.0985211604*pow((1-(T+273.15)/647.3),0.6666666666666666666667)
-0.5094492996*pow((1-(T+273.15)/647.3),1.6666666666666666666667)
-1.761912427*pow((1-(T+273.15)/647.3),5.333333333333333333)
-44.9005480267*pow((1-(T+273.15)/647.3),14.333333333333333)
-723692.2618632*pow((1-(T+273.15)/647.3),36.66666666666666667)))
*(1+0.540966*(MF/(1-MF))-0.303792*pow((MF/(1-MF)),2)
+0.100791*pow((MF/(1-MF)),3)); /*密度和温度质量分数的关系式*/
return rho_licl;
}
end_c_loop_all (cell,cell_thread)
}
}
} 展开
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()
我的问题是氯化锂溶液除去湿空气中的水蒸气,两相流用VOF模型,主相是湿空气,次相是溶液,湿空气和氯化锂溶液分别用组分输运模型,湿空气的组分有水蒸气和空气,溶液的组分是LiCl和液态水,我想定义氯化锂溶液的密度,这个密度是跟溶液的温度和质量分数有关系的,关系式有点复杂,程序如下:
#include "udf.h"
DEFINE_PROPERTY(cell_density,cell,thread)
{
int phase_domain_index;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
Domain *mixture_domain;
real rho_licl;
sub_domain_loop(subdomain, mixture_domain, phase_domain_index) /* loop over all subdomains (phases) in the superdomain (mixture) */
{
if (DOMAIN_ID(subdomain) == 2) /* loop if secondary phase */
thread_loop_c (cell_thread,subdomain) /* loop over all cell threads in the secondary phase domain */
{
begin_c_loop_all (cell,cell_thread) /* loop over all cells in secondary phase cell threads */
{
real T=C_T(cell,cell_thread); /*得到次相温度*/
real MF=C_YI(cell,cell_thread,0); /* 得到次相中LiCl的质量分数,在material里在LiCl是在第一个位置,所以是0*/
rho_licl=(322*(1+1.993771843*pow((1-(T+273.15)/647.3),0.3333333333333333333333333)
+1.0985211604*pow((1-(T+273.15)/647.3),0.6666666666666666666667)
-0.5094492996*pow((1-(T+273.15)/647.3),1.6666666666666666666667)
-1.761912427*pow((1-(T+273.15)/647.3),5.333333333333333333)
-44.9005480267*pow((1-(T+273.15)/647.3),14.333333333333333)
-723692.2618632*pow((1-(T+273.15)/647.3),36.66666666666666667)))
*(1+0.540966*(MF/(1-MF))-0.303792*pow((MF/(1-MF)),2)
+0.100791*pow((MF/(1-MF)),3)); /*密度和温度质量分数的关系式*/
return rho_licl;
}
end_c_loop_all (cell,cell_thread)
}
}
} 展开
展开全部
之前遇到这个问题都是把边界条件好好的看一下,然后你可以尝试对一些位置初始化,就是path一下。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询