| 8 | 1/1 | 返回列表 |
| 查看: 1265 | 回復(fù): 7 | ||
白叱咤風(fēng)云新蟲 (小有名氣)
|
[求助]
fluent UDF編寫 已有2人參與
|
|
哪位大神能幫忙看下,為什么會(huì)有下面的錯(cuò)誤,應(yīng)該如何解決 Error: G:\\simulate\\UDF\\EvEn\\EvEn.c: line 22: invalid type conversion: int -> array 2 of float. 代碼如下: DEFINE_PROPERTY(argon_density, cell, thread) { real sigma[5][2] = { { 300, 1.6224 }, { 500, 0.9734 }, { 1000, 0.4867 }, { 1500, 0.32448 }, { 2000, 0.24336 } }; //錯(cuò)誤就是這行Error: G:\\simulate\\UDF\\EvEn\\EvEn.c: line 22: invalid type conversion: int -> array 2 of float. real x[2], y[2]; real sigmaval; real temp; int n; temp = C_T(cell, thread); sigmaval = 1.6224; for (n = 0; n < 5; n++) { if ((temp>sigma[n][0]) && (temp <= sigma[n + 1][0])) { x[0] = sigma[n][0]; x[1] = sigma[n][1]; y[0] = sigma[n+1][0]; y[1] = sigma[n+1][1]; sigmaval = (y[1] - x[1]) / (y[0] - x[0])*(temp - x[0]) + x[1]; } } if (temp >2000) sigmaval = 0.24336; return sigmaval; } |
木蟲 (正式寫手)
|
沒(méi)有問(wèn)題。 你是不是有多余的空格之類的? 我的可以編譯成功: DEFINE_PROPERTY(argon_density, cell, thread) {real sigma[5][2]={{300,1.6224},{500,0.9734},{1000,0.4867},{1500,0.32448},{2000,0.24336}}; real x[2], y[2]; real sigmaval; real temp; int n; temp = C_T(cell, thread); sigmaval = 1.6224; for (n = 0; n < 5; n++) { if ((temp>sigma[n][0]) && (temp <= sigma[n + 1][0])) {x[0] = sigma[n][0]; x[1] = sigma[n][1]; y[0] = sigma[n+1][0]; y[1] = sigma[n+1][1]; sigmaval = (y[1] - x[1]) / (y[0] - x[0])*(temp - x[0]) + x[1]; } } if (temp >2000) sigmaval = 0.24336; return sigmaval; } |
新蟲 (小有名氣)
新蟲 (小有名氣)
新蟲 (小有名氣)
| 8 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 339求調(diào)劑 +6 | 烤麥芽 2026-03-27 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 291求調(diào)劑 +6 | HanBeiNingZC 2026-03-24 | 6/300 |
|
|
[考研] 272求調(diào)劑 +7 | 腳滑的守法公民 2026-03-27 | 7/350 |
|
|
[考研] 085600,材料與化工321分調(diào)劑 +4 | 大饞小子 2026-03-27 | 6/300 |
|
|
[考研] 調(diào)劑 +3 | 李嘉圖·S·路 2026-03-27 | 3/150 |
|
|
[考研] 316求調(diào)劑 +5 | 江辭666 2026-03-26 | 5/250 |
|
|
[考研] 324求調(diào)劑 +8 | hanamiko 2026-03-26 | 10/500 |
|
|
[考研] 342求調(diào)劑 +3 | 加油a李zs 2026-03-26 | 3/150 |
|
|
[考研] 349求調(diào)劑 +4 | 李木子啊哈哈 2026-03-25 | 4/200 |
|
|
[考研] 294分080500材料科學(xué)與工程求調(diào)劑 +4 | 柳溪邊 2026-03-26 | 4/200 |
|
|
[考研] 一志愿北京化工大學(xué)材料與化工(085600)296求調(diào)劑 +9 | 稻妻小編 2026-03-26 | 9/450 |
|
|
[考研] 【2026考研調(diào)劑】制藥工程 284分 求相關(guān)專業(yè)調(diào)劑名額 +4 | 袁奐奐 2026-03-25 | 8/400 |
|
|
[考研] 0854人工智能方向招收調(diào)劑 +4 | 章小魚567 2026-03-24 | 4/200 |
|
|
[考研] 311求調(diào)劑 +3 | 冬十三 2026-03-24 | 3/150 |
|
|
[考研] 305分求調(diào)劑(食品工程) +5 | Sxy112 2026-03-21 | 7/350 |
|
|
[考博] 26申博自薦 +3 | whh869393 2026-03-24 | 3/150 |
|
|
[考研] 求調(diào)劑 +7 | 十三加油 2026-03-21 | 7/350 |
|
|
[考研] 361求調(diào)劑 +3 | Glack 2026-03-22 | 3/150 |
|
|
[考研] 328求調(diào)劑 +4 | LHHL66 2026-03-23 | 4/200 |
|
|
[考研] 生物學(xué)調(diào)劑 +5 | Surekei 2026-03-21 | 5/250 |
|