Fluent关于UDF实现速度入口随时间变化

Fluent关于UDF实现速度入口随时间变化](这里写自定义目录标题)

fluent编译过程

小编也是第一次实现UDF在fluent中实现控制速度入口条件随时间变化,主要的学习过程还是网上的一些资料,编译之前需要设置fluent(我用的是19.1)与VS2013的环境配置,只有正确的环境配置才能通过编译。

编程语言

编程语言用的C,代码可以自己在TXT文件中写好,喜欢用IDE编写 的话也可去VS中或则其他编译器。

  1. 代码如下
    #include “udf.h”
    DEFINE_PROFILE(inlet_velocity_O2, thread, position)
    {
    real t,v;
    face_t f;
    begin_f_loop(f, thread)
    {
    t=RP_Get_Real(“flow-time”);
    v =1.736
    exp(-((t- 29.69)/3.18)((t- 29.69)/3.18)) +31.14exp(-((t-42.86)/22.89)((t-42.86)/22.89));
    F_PROFILE(f,thread,position)=v;
    }
    end_f_loop(f,thread)
    }
    DEFINE_PROFILE(inlet_velocity_CO, thread, position)
    {
    real t,v;
    face_t f;
    begin_f_loop(f, thread)
    {
    t=RP_Get_Real(“flow-time”);
    v=1.034
    exp(-((t- 29.69)/2.872)((t- 29.69)/2.872)) + 18.59exp(-((t-40.59)/21.4)((t-40.59)/21.4));
    F_PROFILE(f,thread,position)=v;
    }
    end_f_loop(f,thread)
    }
    DEFINE_PROFILE(inlet_velocity_Air, thread, position)
    {
    real t,v;
    face_t f;
    begin_f_loop(f, thread)
    {
    t=RP_Get_Real(“flow-time”);
    v =3.539
    exp(-((t-29.69)/2.842)((t-29.69)/2.842)) + 63.67exp(-((t-40.37)/21.26)((t-40.37)/21.26));
    F_PROFILE(f,thread,position)=v;
    }
    end_f_loop(f,thread)
    }
    DEFINE_PROFILE(inlet_velocity_CO2, thread, position)
    {
    real t,v;
    face_t f;
    begin_f_loop(f, thread)
    {
    t=RP_Get_Real(“flow-time”);
    v=11.45
    exp(-((t-33.63)/ 14)((t-33.63)/ 14)) + 10.83exp(-((t-23.19)/30.45)*((t-23.19)/30.45));
    F_PROFILE(f,thread,position)=v;
    }
    end_f_loop(f,thread)
    }顺利通过编译,可以看到fluent中显示加载了4个入口速度在这里插入图片描述

选择你需要的入口速度条件在这里插入图片描述
这样就okl!!!

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值