| 5 | 1/1 | 返回列表 |
| 查看: 1270 | 回復(fù): 7 | ||
| 當(dāng)前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||
白叱咤風(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ā)表 | |
|---|---|---|---|---|
|
[考研] 291求調(diào)劑 +5 | Y-cap 2026-03-29 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 085600 材料與化工 329分求調(diào)劑 +12 | Mr. Z 2026-03-25 | 12/600 |
|
|
[考研] 309求調(diào)劑 +7 | 誰不是少年 2026-03-29 | 7/350 |
|
|
[考研] 070300化學(xué)354求調(diào)劑 +6 | 101次希望 2026-03-28 | 6/300 |
|
|
[考研] 一志愿北京理工大學(xué)本科211材料工程294求調(diào)劑 +8 | mikasa的圍巾 2026-03-28 | 8/400 |
|
|
[考研] 279求調(diào)劑 +4 | 蝶舞輕繞 2026-03-29 | 4/200 |
|
|
[考研] 本科新能源科學(xué)與工程,一志愿華理能動285求調(diào)劑 +7 | AZMK 2026-03-28 | 11/550 |
|
|
[考研] 0703本科鄭州大學(xué)求調(diào)劑 +3 | nhj_ 2026-03-25 | 3/150 |
|
|
[考研] 【求調(diào)劑】085601材料工程專碩 | 總分272 | +6 | 腳滑的守法公民 2026-03-27 | 6/300 |
|
|
[考研] 0856,材料與化工321分求調(diào)劑 +12 | 大饞小子 2026-03-27 | 13/650 |
|
|
[考研] 266分求材料化工冶金礦業(yè)等專業(yè)的調(diào)劑 +4 | 哇呼哼呼哼 2026-03-26 | 4/200 |
|
|
[考研] 292求調(diào)劑 +4 | 求求了收下我吧?/a> 2026-03-26 | 4/200 |
|
|
[考研] 317求調(diào)劑 +7 | 蛋黃咸肉粽 2026-03-26 | 7/350 |
|
|
[考研] 336材料求調(diào)劑 +7 | 陳瀅瑩 2026-03-26 | 9/450 |
|
|
[考研] 0854電子信息求調(diào)劑 +7 | α____ 2026-03-22 | 9/450 |
|
|
[考研] B區(qū)考研調(diào)劑 +4 | yqdszhdap- 2026-03-22 | 5/250 |
|
|
[考研] 上海電力大學(xué)材料防護(hù)與新材料重點實驗室招收調(diào)劑研究生(材料、化學(xué)、電化學(xué),環(huán)境) +4 | 我愛學(xué)電池 2026-03-23 | 4/200 |
|
|
[考研]
|
黃粱一夢千年 2026-03-24 | 3/150 |
|
|
[考研] 292求調(diào)劑 +4 | 鵝鵝鵝額額額額?/a> 2026-03-24 | 4/200 |
|
|
[考研] 269求調(diào)劑 +4 | 我想讀研11 2026-03-23 | 4/200 |
|