24小时热门版块排行榜    

查看: 4917  |  回复: 19
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

SJTU_SZ

金虫 (小有名气)

[求助] FLUENT单机多核并行运算导入udf之后,初始化报错,Received signal SIGSEGV 已有1人参与

用FLUENT的圆管内超临界水流动传热,采用SST模型,用udf在material物性设置里面定义超临界水的物性随温度的变化,然后初始化的时候报错,错误信息如下:
==============================================================================

Node 4: Process 19756: Received signal SIGSEGV.

==============================================================================
MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started.
下面是我的udf代码,udf直接在记事本里写的,然后把扩展名改成.c   ,请问是udf的问题,还是我别的什么地方弄错了?PS,我串行运算的时候也报错Error:  received a fatal signal (Segmentation fault).
Error Object: #f,求大神指教!

#include "udf.h"
DEFINE_PROPERTY(viscosity_polynomial,cell,thread)
{
real viscosity;
real temperature;
temperature=C_T(cell,thread);
if(temperature>=540&&temperature<670)
  viscosity=-0.02974+(2.06393E-4)*temperature-(5.32888E-7)*pow(temperature,2)+(6.09625E-10)*pow(temperature,3)-(2.61186E-3)*pow(temperature,4);
else if(temperature>=670&&temperature<720)
  viscosity=1.71089-0.00967*temperature+(2.05003E-5)*pow(temperature,2)-(1.93154E-8)*pow(temperature,3)+(6.82497E-12)*pow(temperature,4);
else
  viscosity=4.60518E-4-(1.89262E-6)*temperature+(3.04391E-9)*pow(temperature,2)-(2.12799E-12)*pow(temperature,3)+(5.55983E-16)*pow(temperature,4);
return viscosity;
}
DEFINE_PROPERTY(density_polynomial,cell,thread)
{
real density;
real temperature;
temperature=C_T(cell,thread);
if(temperature>=540&&temperature<650)
  density=-102064.64697+719.52081*temperature-1.88404*pow(temperature,2)+0.00219*pow(temperature,3)-(9.59734E-7)*pow(temperature,4);
else if(temperature>=650&&temperature<680)
  density=1.05818E8-637783.40085*temperature-1441.25876*pow(temperature,2)-1.44725*pow(temperature,3)+(5.44861E-4)*pow(temperature,4);
else if(temperature>=680&&temperature<720)
  density=1.45053E7-81799.75493*temperature+173.01793*pow(temperature,2)-0.16267*pow(temperature,3)+(5.7363E-5)*pow(temperature,4);
else
  density=9785.72376-39.65886*temperature+0.06117*pow(temperature,2)-(4.2103E-5)*pow(temperature,3)+(1.08805E-8)*pow(temperature,4);
return density;
}
DEFINE_PROPERTY(thermal_conductivity_polynomial,cell,thread)
{
real tc;
real temperature;
temperature=C_T(cell,thread);
if(temperature>=540&&temperature<650)
  tc=-46.31273+0.31446*temperature-(7.86857E-4)*pow(temperature,2)+(8.75221E-7)*pow(temperature,3)-(3.6729E-10)*pow(temperature,4);
else if(temperature>=650&&temperature<680)
  tc=-10013.68647+61.91813*temperature-0.14356*pow(temperature,2)+(1.47931E-4)*pow(temperature,3)-(5.7166E-8)*pow(temperature,4);
else if(temperature>=680&&temperature<750)
  tc=4105.15866-22.5438*temperature+0.04644*pow(temperature,2)-(4.25217E-5)*pow(temperature,3)+(1.46033E-8)*pow(temperature,4);
else
  tc=7.23134-0.02932*temperature+(4.49844E-5)*pow(temperature,2)-(3.0539E-8)*pow(temperature,3)+(7.76698E-12)*pow(temperature,4);
return tc;
}
DEFINE_SPECIFIC_HEAT(specific_heat_polynomial,T,Tref,h,yi)
{
real cp;
if(T>=540&&T<650)
  cp=1.02221E7-70713.70545*T+183.47921*pow(T,2)-0.21157*pow(T,3)+(9.15037E-5)*pow(T,4);
else if(T>=650&&T<675)
  cp=-2.81076E10+(1.69883E8)*T-384994.92162*pow(T,2)+387.72315*pow(T,3)-0.14641*pow(T,4);
else if(T>=675&&T<710)
  cp=-5.27703E9+3.05849E7*T-66448.74541*pow(T,2)+64.13917*pow(T,3)-0.02321*pow(T,4);
else if(T>=710&&T<900)
  cp=6.4899E6-31048.84474*T+55.78053*pow(T,2)-0.04456*pow(T,3)+(1.33526E-5)*pow(T,4);
else
  cp=117954.93316-415.67508*T+0.56772*pow(T,2)-(3.47613E-4)*pow(T,3)+(8.04047E-8)*pow(T,4);
*h=cp*(T-Tref);
return cp;
}
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

科研!科研!
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

gafeide

铜虫 (初入文坛)

引用回帖:
6楼: Originally posted by SJTU_SZ at 2015-06-26 08:36:36
比热的函数里面就有这个变量,不用声明的,就跟T和Tref一样。...

但是你在函数声明的括弧里面的是h,却没带星号,这是那个意思啊,其实我对udf不熟,仅仅对c的了解一些

[ 发自小木虫客户端 ]
8楼2015-06-26 12:31:07
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 20 个回答

SJTU_SZ

金虫 (小有名气)

真心求高人相助,弄了好几天了,没进展!
科研!科研!
2楼2015-06-23 08:43:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

gafeide

铜虫 (初入文坛)

倒数第三行,*h是什么意思啊

[ 发自小木虫客户端 ]
3楼2015-06-23 13:00:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

SJTU_SZ

金虫 (小有名气)

引用回帖:
3楼: Originally posted by gafeide at 2015-06-23 13:00:38
倒数第三行,*h是什么意思啊

显焓的值,我看fluent帮助里面这么写的,要求定义这么一个形式。
科研!科研!
4楼2015-06-23 14:20:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 一志愿华中农业071010,总分320求调剂 +5 困困困困坤坤 2026-03-20 6/300 2026-03-22 17:41 by hxsm
[考研] 284求调剂 +5 Zhao anqi 2026-03-22 5/250 2026-03-22 17:38 by barlinike
[考研] 070300化学求调剂 +3 苑豆豆 2026-03-20 3/150 2026-03-22 14:48 by ColorlessPI
[考研] 求调剂 +7 Auroracx 2026-03-22 7/350 2026-03-22 12:38 by 素颜倾城1988
[考研] 生物学一志愿985,分数349求调剂 +4 zxts12 2026-03-21 7/350 2026-03-22 09:57 by zxts12
[考研] 286求调剂 +10 Faune 2026-03-21 10/500 2026-03-21 23:34 by 314126402
[考研] 299求调剂 +4 某某某某位 2026-03-21 4/200 2026-03-21 16:30 by barlinike
[考研] 材料工程(专)一志愿985 初试335求调剂 +3 hiloiy 2026-03-17 4/200 2026-03-21 03:04 by JourneyLucky
[考研] 308求调剂 +3 阿姐阿姐家啊 2026-03-18 3/150 2026-03-20 23:24 by JourneyLucky
[考研] 一志愿武汉理工材料工程专硕调剂 +9 Doleres 2026-03-19 9/450 2026-03-20 22:36 by JourneyLucky
[考研] 求调剂一志愿南京航空航天大学289分 +3 @taotao 2026-03-19 3/150 2026-03-20 21:34 by JourneyLucky
[考研] 材料学求调剂 +4 Stella_Yao 2026-03-20 4/200 2026-03-20 20:28 by ms629
[考研] 一志愿 南京航空航天大学大学 ,080500材料科学与工程学硕 +5 @taotao 2026-03-20 5/250 2026-03-20 20:16 by JourneyLucky
[考研] 261求B区调剂,科研经历丰富 +3 牛奶很忙 2026-03-20 4/200 2026-03-20 19:34 by JourneyLucky
[考研] 求调剂 +3 暗涌afhb 2026-03-16 3/150 2026-03-20 00:28 by 河南大学校友
[考研] 0703化学调剂 +5 pupcoco 2026-03-17 8/400 2026-03-19 13:58 by houyaoxu
[考研] 材料考研调剂 +3 xwt。 2026-03-19 3/150 2026-03-19 11:22 by w沐阳w
[考研] 085601专硕,总分342求调剂,地区不限 +5 share_joy 2026-03-16 5/250 2026-03-18 14:48 by haxia
[考研] 0854可跨调剂,一作一项核心论文五项专利,省、国级证书40+数一英一287 +8 小李0854 2026-03-16 8/400 2026-03-18 14:35 by 搏击518
[考博] 26申博 +4 八6八68 2026-03-16 4/200 2026-03-17 13:00 by 轻松不少随
信息提示
请填处理意见