|
|

楼主 |
发表于 2010-3-22 11:19:15
|
显示全部楼层
回复 6# uknowho 的帖子
我想定义一个面上关于x方向不同位置处的温度函数,但是make后显示的没有错误,也没有用到什么宏,可应用和貌似没有加载上,不知怎么回事,哪位大侠帮忙看一下……
DEFINE_PROFILE(inlet_x_temperature, thread, index)
{
real position[ND_ND];
real x;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(position,f,thread);
x = position[0];
if (x >= 3.325 && x <5.9) {
F_PROFILE(f, thread, index) = 2040 * x / 103 + 1530; // NO.1
} else if (x >= 5.9 && x < 9) {
F_PROFILE(f, thread, index) = 540 * x / 31 + 47871 / 31; // NO.2
} else if (x >= 9 && x < 12.1) {
F_PROFILE(f, thread, index) = 320 * x / 31 + 49851 / 31; // NO.3
} else if (x >= 12.1 && x < 15.2) {
F_PROFILE(f, thread, index) = 150 * x / 31 + 51908 / 31; // NO.4
} else if (x >= 15.2 && x < 18.3) {
F_PROFILE(f, thread, index) = 57988 / 31 - 250 * x / 31; // NO.5
} else if (x >= 18.3 && x < 21.4) {
F_PROFILE(f, thread, index) = 57805 / 31 - 240 * x / 31; // NO.6
} else if (x >= 21.4 && x < 33) {
F_PROFILE(f, thread, index) = 50127 / 29 - 40 * x / 29; // NO.7
} else if (x >= 33 && x < 36.4) {
F_PROFILE(f, thread, index) = 30261 / 17 - 50 * x / 17; // NO.8
} else if (x >= 36.4 && x < 38.9) {
F_PROFILE(f, thread, index) = 2401 - 20 * x; // NO.9
} else if (x >= 38.9 && x < 41.4) {
F_PROFILE(f, thread, index) = 13561 / 5 - 28 * x; // NO.10
} else if (x >= 41.4 && x < 56.4) {
F_PROFILE(f, thread, index) = 50831 / 25 - 58 * x / 5; // NO.11
} else if (x >= 56.4 && x < 58.4) {
F_PROFILE(f, thread, index) = 22377 / 15 - 2 * x; // NO.12
}
}
end_f_loop(f, thread)
} |
|