| 5 | 1/1 | 返回列表 |
| 查看: 1290 | 回復(fù): 3 | ||
| 當(dāng)前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||
白白的大蘿卜新蟲 (小有名氣)
|
[求助]
UFD調(diào)試問題!! 已有1人參與
|
|
在Fluent 中加入源項的UDF 一初始化就開始報錯 Error: received a fatal signal(Segmentation fault).,UDF是照著別人的文獻(xiàn)寫得,沒有書寫錯誤,現(xiàn)在不知道問題出在哪里,本人對UDF和C也是剛?cè)腴T的新手,在這里 希望好心人能幫忙調(diào)試一下,有償也可以的。!![]() ![]() ![]() ![]() 救救孩子吧 萬分感謝!#include "udf.h" /*Define which user-defined scalars to use.*/ enum { p,ads,d_ads,q_ads }; DEFINE_ADJUST(p_absolute,domain) { Thread*t; cell_t c; real p_operating; real p_static; /*solve the absolute pressure.*/ 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(adsorption,domain) { Thread*t; cell_t c; real n_o; real E_t; real x_p; real A; real x_b; real n; /*solve the adsorption equation.*/ 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(q_adsorption,domain) { Thread*t; cell_t c; /*solve the absolute pressure.*/ thread_loop_c(t,domain) { if(NULL!=THREAD_STORAGE(t,SV_UDS_I(q_ads))&&NULL!=T_STORAGE_R_NV(t,SV_UDSI_M1(q_ads))) { begin_c_loop(c,t) { real physical_dt; physical_dt=RP_Get_Real("physical-time-step" ;C_UDSI(c,t,q_ads)=C_UDSI_M1(c,t,q_ads)+0.001*physical_dt*(C_UDSI_M1(c,t,ads)-C_UDSI_M1(c,t,q_ads)); } end_c_loop(c,t) } } } DEFINE_ADJUST(d_adsorption,domain) { Thread*t; cell_t c; /*solve the energy source.*/ 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) { C_UDSI(c,t,d_ads)=-0.5422633*0.001*(C_UDSI(c,t,ads)-C_UDSI(c,t,q_ads)); } 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(enery_source,c,t,dS,eqn) { real e_source; e_source=-C_UDSI_M1(c,t,d_ads)*4*1.58E6; dS[eqn]=0.0; return e_source; } |
新蟲 (初入文壇)
新蟲 (小有名氣)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
百度網(wǎng)盤 |
360云盤 |
千易網(wǎng)盤 |
華為網(wǎng)盤
在新窗口頁面中打開自己喜歡的網(wǎng)盤網(wǎng)站,將文件上傳后,然后將下載鏈接復(fù)制到帖子內(nèi)容中就可以了。 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿鄭州大學(xué),學(xué)碩,物理化學(xué), 333求調(diào)劑 +7 | 李魔女斗篷 2026-03-04 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 0703求調(diào)劑 +10 | c297914 2026-03-06 | 11/550 |
|
|
[考研] 327分求調(diào)劑086 +3 | 西紅柿?小帥 2026-03-09 | 6/300 |
|
|
[考研]
材料學(xué)學(xué)碩308分/本科東北大學(xué)/一志愿西北工業(yè)大學(xué)/
5+3
|
蘇堯幺幺 2026-03-03 | 9/450 |
|
|
[考研] 298求調(diào)劑 +9 | fjj0912 2026-03-03 | 11/550 |
|
|
[考研] 301求調(diào)劑 +11 | 朝天椒的雙馬尾 2026-03-05 | 11/550 |
|
|
[考研] 材料工程307,求調(diào)劑 +4 | 我要燃燒你的夢 2026-03-08 | 4/200 |
|
|
[考研] 調(diào)劑 +3 | 13853210211 2026-03-08 | 3/150 |
|
|
[考研] 08工科 +4 | li李樂成 2026-03-06 | 4/200 |
|
|
[考研] 誠求調(diào)劑,323分 有專利/科研/實習(xí)經(jīng)歷 +6 | 橙子cyx 2026-03-06 | 8/400 |
|
|
[考研] 267化工調(diào)劑求助 +7 | 聰少OZ 2026-03-04 | 7/350 |
|
|
[考研] 306求調(diào)劑 +7 | Bahati 2026-03-05 | 7/350 |
|
|
[考研] 085701環(huán)境工程295求調(diào)劑,一志愿A區(qū)211 +7 | 等春來, 2026-03-06 | 8/400 |
|
|
[考研] 材料考研339求調(diào)劑 +3 | Karry*^_^* 2026-03-04 | 3/150 |
|
|
[考研] 材料085601一志愿哈工大317 +4 | 壓迫感行 2026-03-04 | 4/200 |
|
|
[考研] 一志愿清華深研院材料專碩294分,專業(yè)課111分,本科中南大學(xué)材料,有六級,有工作經(jīng)驗 +3 | H14528 2026-03-04 | 3/150 |
|
|
[考研] 267調(diào)劑求助 +5 | 聰少OZ 2026-03-04 | 5/250 |
|
|
[考研] 320材料一志愿西工大專碩英二數(shù)二 有兩年光伏工作經(jīng)驗 +5 | 錘某人 2026-03-04 | 8/400 |
|
|
[考研] 307求調(diào)劑 +4 | xuyuan111 2026-03-04 | 5/250 |
|
|
[考研] 0703化學(xué)306調(diào)劑 +4 | 26要上岸 2026-03-03 | 4/200 |
|