24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 2188  |  回复: 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的回帖

zb295218211

兑换贵宾

优秀!!有木有!!!优秀!!有木有!!!优秀!!有木有!!!优秀!!有木有!!!

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

titi520

主管区长

优秀!!有木有!!!优秀!!有木有!!!优秀!!有木有!!!优秀!!有木有!!!

很抱歉,帮不到你
4楼2014-06-25 09:44:46
已阅   回复此楼   关注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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 求调剂:一志愿:南京大学 专业:0705 总分320 ,本科985,四六级已过 +3 lfy760306 2026-03-31 3/150 2026-04-01 01:57 by Creta
[考研] 308求调剂 +12 墨墨漠 2026-03-25 12/600 2026-04-01 01:42 by 1018329917
[考研] 339求调剂 +3 zjjkt 2026-03-31 3/150 2026-03-31 20:34 by 83503孙老师
[考研] 311求调剂一志愿合肥工业大学 +11 秋二十二 2026-03-30 11/550 2026-03-31 18:09 by 253863592
[考研] 生物学296求调剂 +8 汤圆包 2026-03-29 12/600 2026-03-31 17:05 by 18828373951
[考研] 083000学硕274求调剂 +12 Li李鱼 2026-03-26 12/600 2026-03-31 10:01 by cal0306
[考研] 22408 359分调剂 +4 Qshers 2026-03-27 8/400 2026-03-31 08:53 by Qshers
[考研] 一志愿郑大材料工程290求调剂 +12 Youth_ 2026-03-30 12/600 2026-03-31 03:34 by 蒙奇奇521
[考研] 英一数一408,总分284,二战真诚求调剂 +3 12.27 2026-03-30 5/250 2026-03-31 00:47 by 不吃芒果17
[考研] 279求调剂 +12 j的立方 2026-03-29 12/600 2026-03-30 20:30 by dick_runner
[考研] 359求调剂 +5 王了个楠 2026-03-25 5/250 2026-03-30 19:36 by 源_2020
[考研] 289求调剂 +16 新时代材料 2026-03-27 16/800 2026-03-30 19:04 by Wang200018
[考研] 317分 一志愿南理工材料工程 本科湖工大 求调剂 +12 芋泥小铃铛 2026-03-28 12/600 2026-03-30 17:06 by wangjy2002
[考研] 329求调剂 +8 星野? 2026-03-26 8/400 2026-03-30 13:41 by chemdavid
[考研] 一志愿中南大学化学0703总分337求调剂 +6 niko- 2026-03-27 6/300 2026-03-30 10:25 by herarysara
[考研] 298求调剂 +3 种圣赐 2026-03-29 3/150 2026-03-29 12:06 by longlotian
[考研] 压国家一区线,求导师收留,有恩必谢! +7 迷人的哈哈 2026-03-28 7/350 2026-03-28 16:47 by 催化大白
[考研] 本科新能源科学与工程,一志愿华理能动285求调剂 +3 AZMK 2026-03-27 5/250 2026-03-28 16:19 by xxxsssccc
[考研] 一志愿郑大085600,310分求调剂 +5 李潇可 2026-03-26 5/250 2026-03-27 11:14 by 不吃魚的貓
[考研] 一志愿吉大071010,316分求调剂 +3 xgbiknn 2026-03-27 3/150 2026-03-27 10:36 by guoweigw
信息提示
请填处理意见