| 5 | 1/1 | 返回列表 |
| 查看: 1268 | 回復(fù): 7 | ||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||
白叱咤風(fēng)云新蟲 (小有名氣)
|
[求助]
fluent UDF編寫 已有2人參與
|
|
|
哪位大神能幫忙看下,為什么會有下面的錯誤,應(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 } }; //錯誤就是這行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; } |
新蟲 (小有名氣)
木蟲 (正式寫手)
|
沒有問題啊? 你是不是有多余的空格之類的? 我的可以編譯成功: 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; } |
新蟲 (小有名氣)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 11408軟件工程求調(diào)劑 +3 | Qiu學(xué)ing 2026-03-28 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 一志愿北京化工大學(xué)材料與化工(085600)296求調(diào)劑 +11 | 稻妻小編 2026-03-26 | 11/550 |
|
|
[考研] 一志愿北化085600材料專碩275|有文章專利|求調(diào)劑 +7 | Micky11223 2026-03-25 | 7/350 |
|
|
[考研] 化學(xué)0703 調(diào)劑 306分 一志愿211 +4 | 26要上岸 2026-03-28 | 4/200 |
|
|
[考研] 286求調(diào)劑 +12 | PolarBear11 2026-03-26 | 12/600 |
|
|
[考研] 277跪求調(diào)劑 +5 | 1915668 2026-03-27 | 9/450 |
|
|
[考研] 材料與化工085600,總分304,本科有兩篇sci參與,求調(diào)劑 +10 | 幸運的醬醬 2026-03-22 | 12/600 |
|
|
[考研] 一志愿北京化工大學(xué) 070300 學(xué)碩 336分 求調(diào)劑 +9 | vv迷 2026-03-22 | 9/450 |
|
|
[考研] 材料292調(diào)劑 +12 | 橘頌思美人 2026-03-23 | 12/600 |
|
|
[考研] 085600材料與化工調(diào)劑 +10 | A-哆啦Z夢 2026-03-23 | 16/800 |
|
|
[考研] 化學(xué)308分求調(diào)劑 +8 | 你好明天你好 2026-03-23 | 9/450 |
|
|
[考研] 286求調(diào)劑 +4 | lim0922 2026-03-26 | 4/200 |
|
|
[考研]
材料調(diào)劑
5+4
|
想要一壺桃花水 2026-03-25 | 10/500 |
|
|
[考研] 總分322求生物學(xué)/生化與分子/生物信息學(xué)相關(guān)調(diào)劑 +5 | 星沉uu 2026-03-26 | 6/300 |
|
|
[考研] 07化學(xué)303求調(diào)劑 +5 | 睿08 2026-03-25 | 5/250 |
|
|
[考研] 一志愿中南大學(xué)化學(xué)學(xué)碩0703總分337求調(diào)劑 +7 | niko- 2026-03-22 | 7/350 |
|
|
[考研] 生物技術(shù)與工程 +3 | 1294608413 2026-03-25 | 4/200 |
|
|
[考研] 各位老師您好:本人初試372分 +5 | jj涌77 2026-03-25 | 6/300 |
|
|
[考研] 277分求調(diào)劑,跨調(diào)材料 +3 | 考研調(diào)劑lxh 2026-03-24 | 3/150 |
|
|
[考研] 336化工調(diào)劑 +4 | 王大坦1 2026-03-23 | 5/250 |
|