| 查看: 1869 | 回復: 12 | |||
[求助]
UDF求助 已有3人參與
|
|||
|
我用下面的UDF代碼模擬吸附過程,為什么編譯能通過,在進行初始化時fluent會報錯:received fatal signal (segmentation fault)!求大神幫忙解答一下!十分感謝! #include "udf.h" enum { p, ads, d_ads, H_ad }; DEFINE_ADJUST(p_absolute,domain) /*calculate the absolute pressure*/ { Thread *t; cell_t c; real p_operating; real p_static; thread_loop_c(t,domain) { if (NULL!=THREAD_STORAGE(t,SV_UDS_I(p))) { begin_c_loop(c,t) { p_static=C_P(c,t); p_operating=RP_Get_Real("operating-pressure" ; C_UDSI(c,t,p)=p_static+p_operating; } end_c_loop(c,t) } } } DEFINE_ADJUST(Heat_Adsorption,domain) /*calculate the released heat during adsorption*/ { Thread *t; cell_t c; real p_operating; real p_static; thread_loop_c(t,domain) { if(NULL!=THREAD_STORAGE(t,SV_UDS_I(H_ad))&&NULL!=T_STORAGE_R_NV(t,SV_UDSI_M1(H_ad))) { begin_c_loop(c,t) { C_UDSI(c,t,H_ad)=3080*sqrt(log(71.6/C_UDSI_M1(c,t,ads))); } end_c_loop(c,t) } } } DEFINE_ADJUST(adsorption,domain) /* calculate the absolute adsorption quantity*/ { Thread *t; cell_t c; real n_o; real E_t; real x_p; real A; real x_b; real n; thread_loop_c(t,domain) { if(NULL!=THREAD_STORAGE(t,SV_UDS_I(ads))&&NULL!=T_STORAGE_R_NV(t,SV_UDSI_M1(ads))) { begin_c_loop(c,t) { real tem=C_T(c,t); n_o=71.6; E_t=3080+18.9*tem; x_p=1.47E9/C_UDSI(c,t,p); A=8.31429*tem*log(x_p); x_b=-A*A/(E_t*E_t); C_UDSI(c,t,ads)=n_o*exp(x_b); } end_c_loop(c,t) } } } DEFINE_ADJUST(d_adsorption,domain) /*calculate the adsorption rate*/ { Thread *t; cell_t c; thread_loop_c(t,domain) { if(NULL != THREAD_STORAGE(t,SV_UDS_I(d_ads))&&NULL!=T_STORAGE_R_NV(t,SV_UDSI_M1(d_ads))) { begin_c_loop(c,t) { real tem=C_T(c,t); real physical_dt=RP_Get_Real("physical-time-step" ;C_UDSI(c,t,d_ads)=-0.532224*C_UDSI(c,t,ads)*(2*pow((8.314*tem/(3080+18.9*tem)), 2)*log(1470*1000000/C_UDSI(c,t,p))/C_UDSI(c,t,p)*(C_UDSI(c,t,p)-C_UDSI_M1(c,t,p))/physical_dt-2*pow(8.314,2)*3080*tem/pow((3080+18.9*tem),3)*pow(log( 1470*1000000/C_UDSI(c,t,p)),2)*(C_T(c,t)-C_T_M1(c,t))/physical_dt); } end_c_loop(c,t) } } } DEFINE_SOURCE(mass_source,c,t,dS,eqn) { real m_source; m_source=C_UDSI_M1(c,t,d_ads); dS[eqn]=0.0; return m_source; } DEFINE_SOURCE(energy_source,c,t,dS,eqn) { real e_source; e_source=-C_UDSI_M1(c,t,d_ads)*0.496056352e3*30803*sqrt(log(71.6/C_UDSI_M1(c,t,ads))); dS[eqn]=0.0; return e_source; } |
專家顧問 (著名寫手)
![]() |
專家經驗: +60 |
專家顧問 (著名寫手)
![]() |
專家經驗: +60 |
專家顧問 (著名寫手)
![]() |
專家經驗: +60 |
專家顧問 (著名寫手)
![]() |
專家經驗: +60 |
專家顧問 (著名寫手)
![]() |
專家經驗: +60 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[碩博家園] 求調劑 有機化學考研356分 +4 | Nadiums 2026-03-25 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 300求調劑,材料科學英一數(shù)二 +10 | leaflight 2026-03-24 | 10/500 |
|
|
[考研] 307求調劑 +9 | 超級伊昂大王 2026-03-24 | 10/500 |
|
|
[考研] 一志愿南航 335分 | 0856 | GPA 4.07 | 有科研經歷 +7 | cccchenso 2026-03-29 | 7/350 |
|
|
[考研] 297求調劑 +11 | 田洪有 2026-03-26 | 11/550 |
|
|
[考研] 086000生物與醫(yī)藥調劑 +5 | Feisty。 2026-03-28 | 9/450 |
|
|
[考研] 本科雙非材料,跨考一志愿華電085801電氣,283求調劑,任何專業(yè)都可以 +6 | 芝士雪baoo 2026-03-28 | 8/400 |
|
|
[考研] 調劑求院校招收 +6 | 鶴鯨鴿 2026-03-28 | 6/300 |
|
|
[考研] 0703化學 +11 | 妮妮ninicgb 2026-03-27 | 11/550 |
|
|
[考研] 321求調劑 +7 | 璞玉~~ 2026-03-25 | 8/400 |
|
|
[考研] 一志愿211 初試270分 求調劑 +8 | 谷雨上岸 2026-03-23 | 9/450 |
|
|
[考研] 0703 化學 求調劑,一志愿山東大學 342 分 +4 | Shern—- 2026-03-28 | 4/200 |
|
|
[考研] 317求調劑 +6 | 十閑wx 2026-03-24 | 6/300 |
|
|
[考研] 086000調劑 +3 | 7901117076 2026-03-26 | 3/150 |
|
|
[考研] 一志愿南師大0703化學 275求調劑 +4 | Ripcord上岸 2026-03-27 | 4/200 |
|
|
[考研] 調劑求收留 +7 | 果然有我 2026-03-26 | 7/350 |
|
|
[考研] 機械學碩310分,數(shù)一英一,一志愿211本科雙非找調劑信息 +3 | @357 2026-03-25 | 3/150 |
|
|
[考研] 一志愿山東大學藥學學碩求調劑 +3 | 開開心心沒煩惱 2026-03-23 | 4/200 |
|
|
[考研] 269求調劑 +4 | 我想讀研11 2026-03-23 | 4/200 |
|
|
[考研] 328求調劑 +4 | LHHL66 2026-03-23 | 4/200 |
|