找回密码
 注册
查看: 1369|回复: 3

设置滑移网格,想要监测滑移面上某点的压力随时间变化的曲线

[复制链接]
发表于 2017-10-17 17:18:29 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
UDF程序如下:


#include"udf.h"
#include"mem.h"
DEFINE_EXECUTE_AT_END(pressure_end)
{
    Domain *d;
    cell_t c;
    real x[3];
    real point_x;
    real point_y;
    real point_z;
    FILE *result;
    real pressure;
    d = Get_Domain(1);
    Thread *t = Lookup_Thread(d,19); //ID=19,是我想监测的interface面
    result = fopen("F:\VAWT Simulation\try hard\fluent\Pressure_GET.txt","w");
     thread_loop_c(t,d)
     {
        begin_c_loop(c,t)
        {
             C_CENTROID(x,c,t);
            point_x=x[0];
            point_y=x[1];
            point_z=x[2];
            if(point_x==0.&&point_y==2.5&&point_z==-6)  //interface面上的一点
               {
                  pressure = C_P(c,t);
               }
        }
        end_c_loop(c,t)
      }
     fprintf(result,"%12.8f%12.8f%12.8f\n",  point_x,point_y,point_z);
     fprintf(result,"%12.8f\n", pressure);
     fclose(result);
}

错误显示:


Error: C:/Users/ADMINI~1/AppData/Local/Temp/Pressure_GET.c.14280.2.c: line 14: parse error.
Error: C:/Users/ADMINI~1/AppData/Local/Temp/Pressure_GET.c.14280.2.c: line 16: t: undeclared variable

line 14是:Thread *t = Lookup_Thread(d,19); //ID=19,是我想监测的interface面
line 16是:  thread_loop_c(t,d)

不知道哪里有错诶?并且想问我编写的这个UDF能输出点上的压力随时间变化的曲线吗?谢谢大家了!!
 楼主| 发表于 2017-10-17 17:28:46 | 显示全部楼层
请问,有哪位大神会的吗?

 楼主| 发表于 2017-10-17 17:45:59 | 显示全部楼层

设置滑移网格,想要监测滑移面上某点的压力随时间变化的曲线

UDF程序如下:


#include"udf.h"
#include"mem.h"
DEFINE_EXECUTE_AT_END(pressure_end)
{
    Domain *d;
    cell_t c;
    real x[3];
    real point_x;
    real point_y;
    real point_z;
    FILE *result;
    real pressure;
    d = Get_Domain(1);
    Thread *t = Lookup_Thread(d,19); //ID=19,是我想监测的interface面
    result = fopen("F:\VAWT Simulation\try hard\fluent\Pressure_GET.txt","w");
     thread_loop_c(t,d)
     {
        begin_c_loop(c,t)
        {
             C_CENTROID(x,c,t);
            point_x=x[0];
            point_y=x[1];
            point_z=x[2];
            if(point_x==0.&&point_y==2.5&&point_z==-6)  //interface面上的一点
               {
                  pressure = C_P(c,t);
               }
        }
        end_c_loop(c,t)
      }
     fprintf(result,"%12.8f%12.8f%12.8f\n",  point_x,point_y,point_z);
     fprintf(result,"%12.8f\n", pressure);
     fclose(result);
}

错误显示:


Error: C:/Users/ADMINI~1/AppData/Local/Temp/Pressure_GET.c.14280.2.c: line 14: parse error.
Error: C:/Users/ADMINI~1/AppData/Local/Temp/Pressure_GET.c.14280.2.c: line 16: t: undeclared variable

line 14是:Thread *t = Lookup_Thread(d,19); //ID=19,是我想监测的interface面
line 16是:  thread_loop_c(t,d)

不知道哪里有错诶?并且想问我编写的这个UDF能输出动网格上的点上的压力随时间变化的曲线吗?谢谢大家了!!
 楼主| 发表于 2017-10-17 17:46:48 | 显示全部楼层

设置滑移网格,想要监测滑移面上某点的压力随时间变化的曲线

UDF程序如下:


#include"udf.h"
#include"mem.h"
DEFINE_EXECUTE_AT_END(pressure_end)
{
    Domain *d;
    cell_t c;
    real x[3];
    real point_x;
    real point_y;
    real point_z;
    FILE *result;
    real pressure;
    d = Get_Domain(1);
    Thread *t = Lookup_Thread(d,19); //ID=19,是我想监测的interface面
    result = fopen("F:\VAWT Simulation\try hard\fluent\Pressure_GET.txt","w");
     thread_loop_c(t,d)
     {
        begin_c_loop(c,t)
        {
             C_CENTROID(x,c,t);
            point_x=x[0];
            point_y=x[1];
            point_z=x[2];
            if(point_x==0.&&point_y==2.5&&point_z==-6)  //interface面上的一点
               {
                  pressure = C_P(c,t);
               }
        }
        end_c_loop(c,t)
      }
     fprintf(result,"%12.8f%12.8f%12.8f\n",  point_x,point_y,point_z);
     fprintf(result,"%12.8f\n", pressure);
     fclose(result);
}

错误显示:


Error: C:/Users/ADMINI~1/AppData/Local/Temp/Pressure_GET.c.14280.2.c: line 14: parse error.
Error: C:/Users/ADMINI~1/AppData/Local/Temp/Pressure_GET.c.14280.2.c: line 16: t: undeclared variable

line 14是:Thread *t = Lookup_Thread(d,19); //ID=19,是我想监测的interface面
line 16是:  thread_loop_c(t,d)

不知道哪里有错诶?并且想问我编写的这个UDF能输出动网格上点上的压力随时间变化的曲线吗?谢谢大家了!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表