| 5 | 1/1 | 返回列表 |
| 查看: 1266 | 回復(fù): 7 | ||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | ||
白叱咤風(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ā)表 | |
|---|---|---|---|---|
|
[考研] 材料與化工(0856)304求B區(qū)調(diào)劑 +8 | 邱gl 2026-03-27 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 0703化學(xué)/290求調(diào)劑/本科經(jīng)歷豐富/工科也可 +9 | 丹青奶蓋 2026-03-26 | 10/500 |
|
|
[考研] 315分求調(diào)劑 +7 | 26考研上岸版26 2026-03-26 | 7/350 |
|
|
[考研] 285求調(diào)劑 +4 | AZMK 2026-03-27 | 7/350 |
|
|
[考研] 求調(diào)劑 +4 | 零八# 2026-03-27 | 4/200 |
|
|
[考研] 287求調(diào)劑 +10 | land xuxu 2026-03-26 | 10/500 |
|
|
[考研] 292求調(diào)劑 +4 | 求求了收下我吧?/a> 2026-03-26 | 4/200 |
|
|
[考研] 求調(diào)劑,一志愿 南京航空航天大學(xué)大學(xué) ,080500材料科學(xué)與工程學(xué)碩 +4 | @taotao 2026-03-26 | 5/250 |
|
|
[考研] 調(diào)劑求收留 +7 | 果然有我 2026-03-26 | 7/350 |
|
|
[考研] 調(diào)劑 +4 | 柚柚yoyo 2026-03-26 | 4/200 |
|
|
[考研] 一志愿天津大學(xué)339材料與化工求調(diào)劑 +3 | 江往賣魚 2026-03-26 | 3/150 |
|
|
[考研] 309求調(diào)劑 +4 | gajsj 2026-03-25 | 5/250 |
|
|
[考研] 一志愿上海交大生物與醫(yī)藥專碩324分,求調(diào)劑 +6 | jiajunX 2026-03-22 | 6/300 |
|
|
[考研] 303求調(diào)劑 +6 | 藍(lán)山月 2026-03-25 | 6/300 |
|
|
[考研] 07化學(xué)303求調(diào)劑 +5 | 睿08 2026-03-25 | 5/250 |
|
|
[考研] 生物學(xué)學(xué)碩求調(diào)劑 +7 | 小羊睡著了? 2026-03-23 | 10/500 |
|
|
[考研] 0703化學(xué)調(diào)劑,求導(dǎo)師收 +7 | 天天好運(yùn)來上岸?/a> 2026-03-24 | 7/350 |
|
|
[考研] 一志愿河北工業(yè)大學(xué)0817化工278分求調(diào)劑 +7 | jhybd 2026-03-23 | 12/600 |
|
|
[考研] 求調(diào)劑院校信息 +6 | CX 330 2026-03-21 | 6/300 |
|
|
[考研] 求調(diào)劑 +5 | Zhangbod 2026-03-21 | 7/350 |
|