@Hope 楼主有没有ESDU的document呀,风剖速度和湍流强度以及风谱,没订阅,也搜索不到
C
Chase
@Chase
帖子
-
边界条件tableFile读取错误问题 -
UDF 想用CDRFG生成LES的入口边界湍流,但是UDF一直编译报错,Profile也只能空间时间二选一,请大佬们指教一下UDF编写#include "udf.h"
#include "unsteady.h"
#include "profile.h"
#include <stdio.h>
#include <stdlib.h>#define MAX_POINTS 4000
#define MAX_TIMESTEPS 997
#define FILENAME "velocity_data.csv"typedef struct {
double x, y, z;
double u[MAX_TIMESTEPS];
} PointData;void read_data(PointData* points) {
FILE* file = fopen(FILENAME, "r");
if (file == NULL) {
printf("Error: Could not open file.\n");
exit(1);
}for (int i = 0; i < MAX_POINTS; i++) { fscanf(file, "%lf,%lf,%lf", &points[i].x, &points[i].y, &points[i].z); for (int j = 0; j < MAX_TIMESTEPS; j++) { fscanf(file, ",%lf", &points[i].u[j]); } } fclose(file);
}
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
real x[ND_ND];
real t = CURRENT_TIME;
int time_step = N_TIME;
PointData points[MAX_POINTS];
face_t f;read_data(points); begin_f_loop(f, thread) { F_CENTROID(x, f, thread); for (int i = 0; i < MAX_POINTS; i++) { if (x[0] == points[i].x && x[1] == points[i].y && x[2] == points[i].z) { F_PROFILE(f, thread, position) = points[i].u[time_step]; break; } } } end_f_loop(f, thread)
}
-
UDF 想用CDRFG生成LES的入口边界湍流,但是UDF一直编译报错,Profile也只能空间时间二选一,请大佬们指教一下UDF编写参照论文Consistent inflow turbulence generator for LES evaluation of wind-induced responses for tall buildings,已经得到目标风剖面的入口边界上的坐标(x,y,z)和对应每个时间步的风速。
-
LES定义入口速度的问题(DSRFG方法)@xzdbjx 大佬,可以提供一下编译进Fluent里面的udf吗? CFD小白,自己写的总是报错