24小时热门版块排行榜    

查看: 2149  |  回复: 6

稻草aaa

木虫 (小有名气)

[求助] fluent udf帮助文件里面可压缩液体的计算公式源自哪里? 已有1人参与

fluent UDF Manual里面DEFINE_PROPERTY 的 Example 4 - Density Function for Compressible Liquids,定义可压缩液体的密度,请问这个UDF里面的密度声速公式源自哪里?UDF程序里面的声速公式好像和前面提到的 声速=(压力对密度偏导数的开方)不太一样,为什么?另外,使用这个udf时 初始化选择区域就会提示错误,但是如果按面板里面的值进行初始化,也能计算的,不清楚原因。

附 Example 4 - Density Function for Compressible Liquids的原文如下:
Liquid density is not a constant but is instead a function of the pressure field. In order to stabilize the pressure solution for compressible flows in FLUENT, an extra term related to the speed of sound is needed in the pressure correction equation. Consequently, when you want to define a custom density function for a compressible flow, your model must also include a speed of sound function. Although you can direct FLUENT to calculate a speed of sound function by choosing one of the available methods (e.g., piecewise-linear, polynomial) in the Materials panel, as a general guideline you should define a speed of sound function along with your density UDF using the formulation:

(压力对密度偏导数的开方)(不能输入公式,只好文字表达)

For simplicity, it is recommended that you concatenate the density and speed of sound functions into a single UDF source file.

The following UDF source code example contains two concatenated functions: a density function named superfluid_density that is defined in terms of pressure and a custom speed of sound function named  sound_speed .


/********************************************************************
Density and speed of sound UDFs for compressible liquid flows.
For use with pressure-based solver, for single phase, multiphase mixture
or cavitation models only.
Note that for density function, dp is the difference between a cell
absolute pressure and reference pressure.
*********************************************************************/
#include "udf.h"

#define BMODULUS 2.2e9
#define rho_ref 1000.0
#define p_ref 101325

DEFINE_PROPERTY(superfluid_density, c, t)
{
    real rho;
    real p, dp;
    real p_operating;
   
    p_operating = RP_Get_Real ("operating-pressure";
   
    p = C_P(c,t) + p_operating;
    dp = p-p_ref;
    rho = rho_ref/(1.0-dp/BMODULUS);
    return rho;
}


DEFINE_PROPERTY(sound_speed, c,t)

{
    real a;
    real p, dp,p_operating;

    p_operating = RP_Get_Real ("operating-pressure";

    p = C_P(c,t) + p_operating;
    dp = p-p_ref;
    a = (1.-dp/BMODULUS)*sqrt(BMODULUS/rho_ref);   
    return a;
}

fluent udf帮助文件里面可压缩液体的计算公式源自哪里?
fluent udf帮助文件里面可压缩液体的计算公式源自哪里?-1
udf manual里面的声速公式.gif
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

哇塞骰

铜虫 (小有名气)

帮顶。。。
2楼2014-06-13 22:30:39
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

一月的河

木虫 (小有名气)

3楼2014-06-14 13:32:57
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

titi520

金虫 (小有名气)

很抱歉,帮不到你
4楼2014-06-25 09:44:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zb295218211

银虫 (小有名气)

请问,你的这个UDF文件是直接这么编写的吗?为什么我这么编写的能加载上但是计算的时候读不出来呢?谢谢!~~
5楼2015-01-24 09:16:03
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

haifeng4957

新虫 (初入文坛)

【答案】应助回帖

我遇到的问题和你是一样的,现在也不知道怎么处理
6楼2015-10-27 11:26:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

最美流年碎

新虫 (初入文坛)

引用回帖:
5楼: Originally posted by zb295218211 at 2015-01-24 09:16:03
请问,你的这个UDF文件是直接这么编写的吗?为什么我这么编写的能加载上但是计算的时候读不出来呢?谢谢!~~

我也是,请问您解决了么
7楼2015-11-30 21:04:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 稻草aaa 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 环境工程调剂 +3 大可digkids 2026-03-16 3/150 2026-03-16 09:09 by DDDddddmm
[考研] 085600材料与化工 求调剂 +12 enenenhui 2026-03-13 13/650 2026-03-16 08:30 by Linda Hu
[考研] 288求调剂 +4 奇点0314 2026-03-14 4/200 2026-03-14 23:04 by JourneyLucky
[考研] 290求调剂 +4 @将就将就看 2026-03-10 8/400 2026-03-14 14:23 by 千千运气
[考研] 材料080500调剂求收留 +3 一颗meteor 2026-03-13 3/150 2026-03-14 10:54 by peike
[考研] 0856材料与化工309分求调剂 +6 ZyZy…… 2026-03-10 6/300 2026-03-14 00:38 by JourneyLucky
[考研] 一志愿湖师大化学289求调剂 +6 XMCMM3.14159 2026-03-10 6/300 2026-03-14 00:28 by JourneyLucky
[考研] b区环境工程求调剂 +4 Maps1 2026-03-10 6/300 2026-03-14 00:23 by JourneyLucky
[考研] 279求调剂 +3 Dizzy123@ 2026-03-10 3/150 2026-03-13 23:02 by JourneyLucky
[考研] 求材料调剂 +5 隔壁陈先生 2026-03-12 5/250 2026-03-13 22:03 by 星空星月
[考研] 0856材料与化工301求调剂 +5 奕束光 2026-03-13 5/250 2026-03-13 22:00 by 星空星月
[考研] 材料工程调剂 +4 咪咪空空 2026-03-11 4/200 2026-03-13 19:57 by JourneyLucky
[考研] 工科调剂 +4 Jiang191123! 2026-03-11 4/200 2026-03-13 15:15 by Miko19
[考研] 070303一志愿西北大学学硕310找调剂 +3 d如愿上岸 2026-03-13 3/150 2026-03-13 10:43 by houyaoxu
[考研] 08食品或轻工求调剂,本科发表3篇sci一区top论文,一志愿南师大食品科学与工程 +3 我是一个兵, 2026-03-10 3/150 2026-03-13 10:21 by Yuyi.
[考研] 290求调剂 +3 柯淮然 2026-03-10 8/400 2026-03-11 13:48 by 柯淮然
[考研] 大连大学化学专业研究生调剂 +3 琪久. 2026-03-10 8/400 2026-03-11 10:02 by 琪久.
[考研] 279求调剂 +3 莫xiao 2026-03-10 4/200 2026-03-11 08:06 by 斩魂滴兔子!
[考研] 0856材料与化工353分求调剂 +11 NIFFFfff 2026-03-09 11/550 2026-03-10 18:36 by suyuanhai
[考研] 085602化工求调剂 +7 董boxing 2026-03-10 7/350 2026-03-10 17:07 by BruceLiu320
信息提示
请填处理意见