²é¿´: 2154  |  »Ø¸´: 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 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[½Ìʦ֮¼Ò] ½¹ÂÇ +8 Ë®±ùÔÂÔÂÒ°Íà 2026-03-13 12/600 2026-03-18 15:27 by ßäÎØß÷ÎØ
[¿¼ÑÐ] »¯Ñ§¹¤³Ì321·ÖÇóµ÷¼Á +15 ´óÃ×·¹£¡ 2026-03-15 18/900 2026-03-18 14:52 by haxia
[¿¼ÑÐ] »¯¹¤Ñ§Ë¶306Çóµ÷¼Á +10 42838695 2026-03-12 10/500 2026-03-18 14:42 by haxia
[¿¼ÑÐ] ²ÄÁÏר˶274Ò»Ö¾Ô¸ÉÂÎ÷ʦ·¶´óѧÇóµ÷¼Á +6 Ñ¦ÔÆÅô 2026-03-13 6/300 2026-03-18 14:14 by ÍÑÓ±¶ø³ö
[¿¼ÑÐ] ÉúÎïѧ071000 329·ÖÇóµ÷¼Á +3 ÎÒ°®ÉúÎïÉúÎﰮΠ2026-03-17 3/150 2026-03-18 10:12 by macy2011
[¿¼ÑÐ] 301Çóµ÷¼Á +4 A_JiXing 2026-03-16 4/200 2026-03-17 17:32 by ruiyingmiao
[¿¼ÑÐ] 302Çóµ÷¼Á +9 ¸ºÐÄÕßµ±Öï 2026-03-11 9/450 2026-03-17 17:13 by ruiyingmiao
[¿¼ÑÐ] 085601Çóµ÷¼Á +4 Du.11 2026-03-16 4/200 2026-03-17 17:08 by ruiyingmiao
[¿¼ÑÐ] 0854¿ØÖƹ¤³Ì 359Çóµ÷¼Á ¿É¿çרҵ +3 626776879 2026-03-14 9/450 2026-03-16 17:42 by 626776879
[¿¼ÑÐ] 318Çóµ÷¼Á +3 Yanyali 2026-03-15 3/150 2026-03-16 16:41 by houyaoxu
[¿¼ÑÐ] 070305Çóµ÷¼Á +3 mlpqaz03 2026-03-14 4/200 2026-03-15 11:04 by peike
[»ù½ðÉêÇë] ÓбØÒª¸ü»»É걨¿ÚÂð 20+3 fannyamoy 2026-03-11 3/150 2026-03-14 00:52 by zhanghaozhu
[¿¼ÑÐ] 304Çóµ÷¼Á +7 7712b 2026-03-13 7/350 2026-03-13 21:42 by peike
[¿¼ÑÐ] 26µ÷¼Á/²ÄÁÏ¿ÆÑ§Ó빤³Ì/×Ü·Ö295/ÇóÊÕÁô +9 2026µ÷¼ÁÏÀ 2026-03-12 9/450 2026-03-13 20:46 by 18595523086
[¿¼ÑÐ] 310Çóµ÷¼Á +3 ¡¾ÉÏÉÏÇ©¡¿ 2026-03-11 3/150 2026-03-13 16:16 by JourneyLucky
[¿¼ÑÐ] 307Çóµ÷¼Á +5 ³¬¼¶ÒÁ°º´óÍõ 2026-03-12 5/250 2026-03-13 15:56 by °ô°ôÇòÊÖ
[¿¼ÑÐ] Ò»Ö¾Ô¸211»¯Ñ§Ñ§Ë¶310·ÖÇóµ÷¼Á +8 ŬÁ¦·Ü¶·112 2026-03-12 9/450 2026-03-13 15:41 by JourneyLucky
[¿¼ÑÐ] 277Çóµ÷¼Á +4 anchor17 2026-03-12 4/200 2026-03-13 11:15 by °×Ò¹ÓÆ³¤
[¿¼ÑÐ] 289Çóµ÷¼Á +3 ÀîÕþÓ¨ 2026-03-12 3/150 2026-03-13 11:02 by Çóµ÷¼Ázz
[¿¼ÑÐ] 333Çóµ÷¼Á +3 152697 2026-03-12 4/200 2026-03-13 07:08 by Iveryant
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û