²é¿´: 2164  |  »Ø¸´: 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µÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 0856µ÷¼Á£¬ÊÇѧУ¾ÍÈ¥ +6 sllhht 2026-03-19 7/350 2026-03-19 19:50 by ÖÆ¶ÈµÄ
[¿¼ÑÐ] Ò»Ö¾Ô¸ÄϾ©Àí¹¤´óѧ085701×ÊÔ´Óë»·¾³302·ÖÇóµ÷¼Á +3 ¿ûè÷ÎÀ¶Ó 2026-03-18 5/250 2026-03-19 19:35 by ¸øÄãÄã×¢ÒâÐÝÏ¢
[¿¼ÑÐ] 324·Ö 085600²ÄÁÏ»¯¹¤Çóµ÷¼Á +3 llllkkkhh 2026-03-18 3/150 2026-03-19 14:22 by houyaoxu
[¿¼ÑÐ] Ò»Ö¾Ô¸ Î÷±±´óѧ £¬070300»¯Ñ§Ñ§Ë¶£¬×Ü·Ö287£¬Ë«·ÇÒ»±¾£¬Çóµ÷¼Á¡£ +3 ³¿»èÏßÓëÐǺ£ 2026-03-19 3/150 2026-03-19 13:36 by houyaoxu
[¿¼ÑÐ] ²ÄÁÏ¿¼Ñе÷¼Á +3 xwt¡£ 2026-03-19 3/150 2026-03-19 11:22 by wãåÑôw
[¿¼ÑÐ] 346Çóµ÷¼Á[0856] +3 WayneLim327 2026-03-16 6/300 2026-03-19 11:21 by WayneLim327
[¿¼ÑÐ] 328Çóµ÷¼Á£¬Ó¢ÓïÁù¼¶551£¬ÓпÆÑо­Àú +4 ÉúÎ﹤³Ìµ÷¼Á 2026-03-16 12/600 2026-03-19 11:10 by ÉúÎ﹤³Ìµ÷¼Á
[¿¼ÑÐ] ²ÄÁÏ080500µ÷¼ÁÇóÊÕÁô +4 Ò»¿Åmeteor 2026-03-13 4/200 2026-03-19 10:32 by 30660438
[¿¼ÑÐ] 0703»¯Ñ§ 305Çóµ÷¼Á +4 FY_yy 2026-03-14 4/200 2026-03-19 05:54 by anny19840123
[¿¼ÑÐ] 0854£¬¼ÆËã»úÀàÕÐÊÕµ÷¼Á +3 ºúÀ±ÌÀ·ÅÌÇ 2026-03-15 6/300 2026-03-18 12:09 by Éϰ¶Éϰ¶¡­¡­..
[¿¼ÑÐ] 301Çóµ÷¼Á +9 yyÒªÉϰ¶Ñ½ 2026-03-17 9/450 2026-03-18 08:58 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] 278Çóµ÷¼Á +5 ÑÌ»ðÏÈÓÚ´º 2026-03-17 5/250 2026-03-18 08:43 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] 334Çóµ÷¼Á +3 Ö¾´æ¸ßÔ¶ÒâÔÚ»úÐ 2026-03-16 3/150 2026-03-18 08:34 by lm4875102
[˶²©¼ÒÔ°] ºþ±±¹¤Òµ´óѧ ÉúÃü¿ÆÑ§Ó뽡¿µÑ§Ôº-¿ÎÌâ×éÕÐÊÕ2026¼¶Ê³Æ·/ÉúÎï·½Ïò˶ʿ +3 1ϲ´º8 2026-03-17 5/250 2026-03-17 17:18 by ber´¨cool×Ó
[¿¼ÑÐ] 308Çóµ÷¼Á +4 ÊÇLupa°¡ 2026-03-16 4/200 2026-03-17 17:12 by ruiyingmiao
[¿¼ÑÐ] 278Çóµ÷¼Á +3 Yy7400 2026-03-13 3/150 2026-03-17 08:24 by laoshidan
[¿¼ÑÐ] »úеר˶325£¬Ñ°ÕÒµ÷¼ÁԺУ +3 y9999 2026-03-15 5/250 2026-03-16 19:58 by y9999
[¿¼ÑÐ] 0854¿ØÖƹ¤³Ì 359Çóµ÷¼Á ¿É¿çרҵ +3 626776879 2026-03-14 9/450 2026-03-16 17:42 by 626776879
[¿¼ÑÐ] ²ÄÁÏÓ뻯¹¤ 323 Ó¢Ò»+Êý¶þ+Îﻯ£¬Ò»Ö¾Ô¸£º¹þ¹¤´ó ±¾È˱¾¿ÆË«Ò»Á÷ +4 ×ÔÓɵÄ_·ÉÏè 2026-03-13 5/250 2026-03-14 19:39 by hmn_wj
[¿¼ÑÐ] ¸´ÊÔµ÷¼Á +3 ºôºô£¿~+123456 2026-03-14 3/150 2026-03-14 16:53 by WTUChen
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û