不知火舞的被虐|伊人天伊人天天综合网|博洛尼亚天气|任你懆这里只有精品4|久久美日韩精品久久|掌中之物漫画免费阅读观看|0丨d老妇

求助:Fluent中導入UDF

瀏覽:3040 回答:2

#include "udf.h"

#include "math.h"

FILE *result;

DEFINE_EXECUTE_AT_END(pressure_end)

{

    result=fopen("Pressure_GET.txt","a");

    Domain *d

    d=Get_Domain(1);

    Thread *t;

    cell_t c;

    real pressure;

    real A[ND_ND];

    real point_x;

    real point_y;

    real point_z;

    real Y=2.5;

    real R=6.;

    int curr_ts;

    curr_ts=N_TIME;

    thread_loop_c(t,d)

     {

           if(curr_ts>=720)

           {

               real X=(-1.)*R *sin(2.*curr_ts);

               real Z=(-1.)*R *cos(2.*curr_ts);

           begin_c_loop(c,t)

            {

                C_CENTROID(A,c,t);

                point_x=A[0];

                point_y=A[1];

                point_z=A[2];

            if(fabs(point_x-X)<=0.0001&&fabs(point_y-Y)<=0.0001&&fabs(point_z-Z)<=0.0001)

            {

                pressure=C_P(c,t);

                fprintf(result,"坐標:%12.8f%12.8f%12.8f,時間步數:%f\n", point_x,point_y,point_z,curr_ts);

                fprintf(result,"%12.8f\n", pressure);

            }

            }

            end_c_loop(c,t)

            }

        }

        fclose(result);

}


導入Fluent中時,出現錯誤:

F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c:2: math.h: No such file or directory

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 7: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 9: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 10: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 11: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 12: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 13: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 14: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 15: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 16: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 17: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 18: parse error.

Error: F:\\VAWT Simulation\\try hard\\fluent\\Pressure_GET2.c: line 19: curr_ts: undeclared variable

它提示錯誤的是這幾行:

  #include "math.h"

   Domain *d

    d=Get_Domain(1);

    Thread *t;

    cell_t c;

    real pressure;

    real A[ND_ND];

    real point_x;

    real point_y;

    real point_z;

    real Y=2.5;

    real R=6.;

    int curr_ts;

    curr_ts=N_TIME;

全是定義行出錯,這是因為什么原因啊?一直卡在這兒兩天了,求助大神們!!

邀請回答 我來回答

全部回答

(1)
默認 最新
路修在戈壁灘上
已解決
2017年10月19日
評論 1 點贊

沒解決?試試專家一對一服務

換一批
    App下載
    技術鄰APP
    工程師必備
    • 項目客服
    • 培訓客服
    • 平臺客服

    TOP