²é¿´: 2942  |  »Ø¸´: 12
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

zzh19920530

гæ (СÓÐÃûÆø)

[ÇóÖú] ¸øfluent»»±³¾°ÑÕÉ«£¬Î¶ÈÌݶÈֵΪʲô²»ÏÔʾÁË ÒÑÓÐ3È˲ÎÓë

¸øfluent»»±³¾°ÑÕÉ«£¬Î¶ÈÌݶÈֵΪʲô²»ÏÔʾÁË£¬Ö®Ç°fluentµÄ±³¾°ÑÕÉ«ÊÇdzÀ¶É«µÄ£¬µ«ÊǺóÀ´ÎҰѱ³¾°ÑÕÉ«»»³ÉÁ˰×É«µÄ£¬È»ºóÎÒζÈÔÆÍ¼ÀïµÄζÈÌݶÈÖµ¾ÍûÁË£¬ÈçÏÂͼËùʾ¡£»¹ÄܰÑζÈÌݶÈÖµµ÷»ØÀ´Âð£¿

¸øfluent»»±³¾°ÑÕÉ«£¬Î¶ÈÌݶÈֵΪʲô²»ÏÔʾÁË
bai.png


¸øfluent»»±³¾°ÑÕÉ«£¬Î¶ÈÌݶÈֵΪʲô²»ÏÔʾÁË-1
lan.png
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

1049484471

гæ (³õÈëÎÄ̳)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

ÇóÖú£º
ÔõÑù½«UDFÎļþµ¼Èëµ½fluentÖÐÔËÐе÷Ó𡣿
4Â¥2015-03-28 20:05:40
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 13 ¸ö»Ø´ð

1049484471

гæ (³õÈëÎÄ̳)

fluentÀï±ßÔõô±ä»»±³¾°°¡£¿
2Â¥2015-03-28 19:58:21
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

1049484471

гæ (³õÈëÎÄ̳)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
ÇóÖú£¬ÏÂÃæµÄ³ÌÐòÊÇʲôÒâ˼£¿ÖмäµÄÊý¾ÝÎÒÊ¡ÂÔÁË£¬Ð»¹ý£¡



/**************************************************************************************
   UDF: for specifying a time-dependent velocity profile boundary condition:
   u(t) - interpolated via cubic spine from measurements by Traykovski
                                            written by Houshuo Jiang on August 17, 2006
***************************************************************************************/

#include "udf.h"

DEFINE_PROFILE(unsteady_flow, thread, position)
{

  /* ttt[]: sampled times */
  /* u[]: sampled streamwise flow velocity */
  /* d2_u_dt2[]: calculated 2nd time derivative of u */
  /* start time =      0.12499359 , end time =    602.12499000 */

  static real ttt[4817]=
  {
0.00000000E+00, 0.12499430E+00, 0.24999865E+00, 0.37499294E+00, 0.49999729E+00,
0.62500164E+00, 0.74999593E+00, 0.87500029E+00, 0.99999461E+00, 0.11249989E+01,
0.12500033E+01, 0.13749976E+01, 0.14999919E+01, 0.16249962E+01, 0.17500006E+01,
0.18749949E+01, 0.19999992E+01, 0.21249935E+01, 0.22499978E+01,
};
static real u[4817]=
  {
0.29486706E+00, 0.25832370E+00, 0.22072441E+00, 0.18439429E+00, 0.14780788E+00,
0.11332307E+00, 0.80134080E-01, 0.49663854E-01, 0.21209121E-01,-0.60646123E-02,
-0.28923945E-01,-0.49841599E-01,-0.66707764E-01,-0.79936611E-01,-0.88913036E-01,
0.26710739E+00, 0.27723406E+00, 0.28560768E+00, 0.29210729E+00, 0.29621414E+00,
0.29912153E+00, 0.30260917E+00
  };

  static real d2_u_dt2[4817]=
  {
0.85972525E-01,-0.17194505E+00, 0.19746624E+00,-0.13169408E+00, 0.23201899E+00,
0.10576336E-01, 0.22222984E+00, 0.14550020E+00,-0.31192043E-01, 0.43361966E+00,
-0.82670364E-02, 0.34437811E+00, 0.18666827E+00, 0.30615838E+00, 0.22151801E+00,
0.29484003E+00, 0.38174390E+00, 0.11195380E+00, 0.17885390E+00, 0.26852023E+00,
0.21346864E+00, 0.30599166E-01, 0.10479063E+00, 0.10472997E+00,-0.22994860E-01,
0.16925363E-01,-0.11893041E+00,-0.12963144E+00,-0.57996749E-01,-0.38344444E-01,
-0.23898451E+00,-0.79638780E-01,-0.11563157E+00,-0.17745479E+00,-0.93369114E-01,
0.90338604E-01,-0.45169302E-01
  };

  int n=4817;

  /* variables for the cubic spline algorithm */
  int klo,khi,k;
  real h,a,b;

  /* variables for printing out messages */

  /* variables for the FLUENT UDF settings */
  face_t ft;
  real t, xvelocity;
  t = CURRENT_TIME;

  /* By means of bisection to locate the right place for t in the table */
  klo=1;
  khi=n;
  while (khi-klo > 1)
  {
     k=(khi+klo) >> 1;
     if (ttt[k-1] > t) khi=k;
     else klo=k;
  }
  /* klo and khi now bracket the input value of t. */

  /* Transfer from unit-offset to zero-offset. */
  klo=klo-1;
  khi=khi-1;
  
  h=ttt[khi]-ttt[klo];
  a=(ttt[khi]-t)/h;
  b=(t-ttt[klo])/h;

  /* Cubic spline polynomial is now evaluated to obtain the velocity at time t. */
  xvelocity = a*u[klo]+b*u[khi]+((a*a*a-a)*d2_u_dt2[klo]+(b*b*b-b)*d2_u_dt2[khi])*(h*h)/6.0;
  
  Message("current time = %15.8e s, u = %15.8e m/s\n", t, xvelocity);  /* \n denotes a new line */

  begin_f_loop(ft, thread)
  {
    F_PROFILE(ft, thread, position) = xvelocity;
  }
  end_f_loop(ft, thread)
}


/*****************************************************************
UDF for volume-integrating k and epsilon, for calculating the total
volume, and for writing them into a file.

Exporting U,W at a cell about 50cm above the ripple crest to a
file.
                      written by Houshuo Jiang on August 25, 2006.
******************************************************************/

DEFINE_ON_DEMAND(tke_epsilon_pointuw)
{
   real sum_tke=0.0, sum_epsilon=0.0, sum_volume=0.0;
   real flowtime, xx[ND_ND];
   real x0_ripple=-0.39102757, x1_ripple=0.37087719;  /* define the two sides of the ripple interested */
   real cellx0=0.0450395, cellx1=0.05541;             /* define the streamwise bound of the cell */
   real cellz0=-0.2933, cellz1=-0.2639;               /* define the vertical bound of the cell */
   real cellu=0.0,cellw=0.0,cellcentroidx=0.0,cellcentroidz=0.0;
   
   Domain *d;  /* declare domain pointer since it is not passed as an argument to the DEFINE macro */
   Thread *t;
   cell_t c;

   FILE *fp1, *fp2;

   d = Get_Domain(1);  /* returns fluid domain pointer */

   flowtime = CURRENT_TIME;

   /* Integrate TKE, epsilon, and export the cell variables */
   thread_loop_c(t,d)
   {
     begin_c_loop(c,t)
        C_CENTROID(xx,c,t)
        if ((xx[0]>x0_ripple) && (xx[0]<x1_ripple))
        {
           sum_tke += C_K(c,t)*C_VOLUME(c,t);
           sum_epsilon += C_MU_EFF(c,t)/C_R(c,t)*C_STRAIN_RATE_MAG(c,t)*C_STRAIN_RATE_MAG(c,t)*C_VOLUME(c,t);
           sum_volume += C_VOLUME(c,t);
        }

        if ( ( (xx[0]>cellx0) && (xx[0]<cellx1) ) && ( (xx[1]>cellz0) && (xx[1]<cellz1) ) )  
        {
           cellu = C_U(c,t);
           cellw = C_V(c,t);
           cellcentroidx = xx[0];
           cellcentroidz = xx[1];
        }
     end_c_loop(c,t)
   }

   fp1 = fopen("TKE_epsilon_vs_t.dat","a";   /* open a file named TKE_epsilon_vs_t.dat in append mode and assign it to fp1 */
   fprintf(fp1,"%15.8e %15.8e %15.8e %15.8e\n", flowtime,sum_volume,sum_tke,sum_epsilon);
   fclose(fp1);

   fp2 = fopen("pointUW_vs_t.dat","a";   /* open a file named pointUW_vs_t.dat in append mode and assign it to fp2 */
   fprintf(fp2,"%15.8e %15.8e %15.8e %15.8e %15.8e\n", flowtime,cellu,cellw,cellcentroidx,cellcentroidz);
   fclose(fp2);

   Message(" Success!";
}
3Â¥2015-03-28 20:04:18
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

luogangv

ľ³æ (СÓÐÃûÆø)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
ÄãÊDz»ÊǰÑζÈÖµÒ²ÉèÖóɰ×É«ÁË£¿
5Â¥2015-03-29 09:36:22
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] һ־Ըɽ¶«´óѧҩѧѧ˶Çóµ÷¼Á +3 ¿ª¿ªÐÄÐÄû·³ÄÕ 2026-03-23 4/200 2026-03-24 00:06 by ¿ª¿ªÐÄÐÄû·³ÄÕ
[¿¼ÑÐ] 335Çóµ÷¼Á +4 yuyuÓî 2026-03-23 5/250 2026-03-23 23:49 by Txy@872106
[¿¼ÑÐ] ²ÄÁÏ292µ÷¼Á +4 éÙËÌ˼ÃÀÈË 2026-03-23 4/200 2026-03-23 23:16 by peike
[¿¼ÑÐ] ²ÄÁÏרҵÇóµ÷¼Á +11 hanamiko 2026-03-18 11/550 2026-03-23 23:12 by peike
[¿¼ÑÐ] Ò»Ö¾Ô¸ÎäÀí²ÄÁϹ¤³Ì348Çóµ÷¼Á +6 £þ^£þ©bº¹ 2026-03-19 9/450 2026-03-23 19:53 by pswait
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÖÐũҵ071010£¬×Ü·Ö320Çóµ÷¼Á +5 À§À§À§À§À¤À¤ 2026-03-20 6/300 2026-03-22 17:41 by hxsm
[¿¼ÑÐ] 287Çóµ÷¼Á +8 ³¿»èÏßÓëÐǺ£ 2026-03-19 9/450 2026-03-22 17:01 by i_cooler
[¿¼ÑÐ] ÉúÎïѧ071000 329·ÖÇóµ÷¼Á +5 ÎÒ°®ÉúÎïÉúÎﰮΠ2026-03-17 5/250 2026-03-22 16:42 by tcx007
[¿¼ÑÐ] ×ÊÔ´Óë»·¾³ µ÷¼ÁÉêÇë(333·Ö) +5 holy J 2026-03-21 5/250 2026-03-21 22:42 by Catalysis25
[¿¼ÑÐ] 297Çóµ÷¼Á +11 Ï·¾«µ¤µ¤µ¤ 2026-03-17 12/600 2026-03-21 17:47 by ColorlessPI
[¿¼ÑÐ] 299Çóµ÷¼Á +5 shxchem 2026-03-20 7/350 2026-03-21 17:09 by ColorlessPI
[¿¼ÑÐ] 0805²ÄÁÏ320Çóµ÷¼Á +3 ÉÎïÓï 2026-03-20 3/150 2026-03-21 15:46 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] ²ÄÁϹ¤³Ì£¨×¨£©Ò»Ö¾Ô¸985 ³õÊÔ335Çóµ÷¼Á +3 hiloiy 2026-03-17 4/200 2026-03-21 03:04 by JourneyLucky
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÄÏʦ´ó 070300£¨»¯Ñ§£©304·ÖÇóµ÷¼Á +3 0703ÎäÜ·»ÛÑ©304 2026-03-18 3/150 2026-03-21 00:48 by JourneyLucky
[¿¼ÑÐ] 294Çóµ÷¼Á²ÄÁÏÓ뻯¹¤×¨Ë¶ +15 ݤÎÉ­ÁÖ 2026-03-18 15/750 2026-03-20 23:28 by JourneyLucky
[¿¼ÑÐ] Ò»Ö¾Ô¸ËÕÖÝ´óѧ²ÄÁÏÇóµ÷¼Á£¬×Ü·Ö315£¨Ó¢Ò»£© +5 sbdksD 2026-03-19 5/250 2026-03-20 22:10 by luoyongfeng
[¿¼ÑÐ] Çóµ÷¼Á +3 @taotao 2026-03-20 3/150 2026-03-20 19:35 by JourneyLucky
[¿¼ÑÐ] Ò»Ö¾Ô¸Öйúº£Ñó´óѧ£¬ÉúÎïѧ£¬301·Ö£¬Çóµ÷¼Á +5 1ËïÎò¿Õ 2026-03-17 6/300 2026-03-19 23:46 by zcl123
[¿¼ÑÐ] ²ÄÁϹ¤³Ìר˶µ÷¼Á +5 204818@lcx 2026-03-17 6/300 2026-03-18 22:55 by 204818@lcx
[¿¼²©] 26²©Ê¿ÉêÇë +3 1042136743 2026-03-17 3/150 2026-03-17 23:30 by ÇáËɲ»ÉÙËæ
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û