永发信息网

求一个超简单的Fluent的UDF程序编制,大神救命!!

答案:1  悬赏:30  手机版
解决时间 2021-03-03 15:53
  • 提问者网友:我们很暧昧
  • 2021-03-02 16:36
求一个超简单的Fluent的UDF程序编制,大神救命!!
最佳答案
  • 五星知识达人网友:duile
  • 2021-03-02 16:56
你试试看吧。注意格式改写,我在这个里面打的,格式可能有问题。
#include "udf.h"
DEFINE_PROFILE(inlet_velocity, thread, index)
{
real x[ND_ND],y;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f, thread, index) =2.4*ln(350*y)+5.5;
}
end_f_loop(f, thread)
}追问c语言中的对数函数是ln还是log?追答函数名: log10
功 能: 对数函数log,以10为底
用 法: double log10(double x);
程序例:#include
#include int main(void)
{
double result;
double x = 800.6872; result = log10(x);
printf("The common log of %lf is %lf\n", x, result); return 0;
} 函数名: log
功 能: 对数函数log,以e(2.71828)为底
用 法: double log(double x);
程序例:#include
#include int main(void)
{
double result;
double x = 800.6872; result = log(x);
printf("The common log of %lf is %lf\n", x, result); return 0;
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯