24小时热门版块排行榜    

查看: 2167  |  回复: 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的回帖

最美流年碎

新虫 (初入文坛)

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

我也是,请问您解决了么
7楼2015-11-30 21:04:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 7 个回答

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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 0703化学调剂 ,六级已过,有科研经历 +14 曦熙兮 2026-03-15 14/700 2026-03-21 19:12 by ColorlessPI
[考研] 求调剂 +5 十三加油 2026-03-21 5/250 2026-03-21 18:48 by 学员8dgXkO
[考研] 材料工程专硕 348分求调剂 +3 冬辞. 2026-03-17 5/250 2026-03-21 18:47 by 学员8dgXkO
[考研] 一志愿深大,0703化学,总分302,求调剂 +4 七月-七七 2026-03-21 4/200 2026-03-21 18:20 by 学员8dgXkO
[考研] 302求调剂 +12 呼呼呼。。。。 2026-03-17 12/600 2026-03-21 17:29 by ColorlessPI
[考研] 310求调剂 +3 baibai1314 2026-03-16 3/150 2026-03-21 03:56 by JourneyLucky
[考研] 083200学硕321分一志愿暨南大学求调剂 +3 innocenceF 2026-03-17 3/150 2026-03-21 02:35 by JourneyLucky
[考研] 一志愿中国石油大学(华东) 本科齐鲁工业大学 +3 石能伟 2026-03-17 3/150 2026-03-21 02:22 by JourneyLucky
[考研] 271材料工程求调剂 +8 .6lL 2026-03-18 8/400 2026-03-21 00:58 by JourneyLucky
[考研] 296求调剂 +6 www_q 2026-03-18 10/500 2026-03-20 23:56 by JourneyLucky
[考研] 22408 344分 求调剂 一志愿 华电计算机技术 +4 solanXXX 2026-03-20 4/200 2026-03-20 23:49 by alg094825
[考研] A区线材料学调剂 +5 周周无极 2026-03-20 5/250 2026-03-20 21:33 by laoshidan
[考研] 295复试调剂 +8 简木ChuFront 2026-03-19 8/400 2026-03-20 20:44 by zhukairuo
[考研] 材料学求调剂 +4 Stella_Yao 2026-03-20 4/200 2026-03-20 20:28 by ms629
[考研] 工科材料085601 279求调剂 +7 困于星晨 2026-03-17 9/450 2026-03-20 17:38 by 无懈可击111
[考研] 085601材料工程专硕求调剂 +10 慕寒mio 2026-03-16 10/500 2026-03-19 15:26 by 丁丁*
[考研] 【同济软件】软件(085405)考研求调剂 +3 2026eternal 2026-03-18 3/150 2026-03-18 19:09 by 搏击518
[考研] 312求调剂 +8 陌宸希 2026-03-16 9/450 2026-03-18 12:39 by Linda Hu
[考研] 333求调剂 +3 文思客 2026-03-16 7/350 2026-03-16 18:21 by 文思客
[考研] 0856求调剂 +3 刘梦微 2026-03-15 3/150 2026-03-16 10:00 by houyaoxu
信息提示
请填处理意见