?? main.c
字號:
#include "global.h"
int main()
{int test, /* dummy Variable */
t,
t_max, /* max of timesteps */
postproc_intervall, /* timesteps between two Postprocessing files */
y; /* Initialisation */
f=NULL;
wall=NULL;
printf("/*****************************************/\n");
printf("/* Lattice-BGK TUTORIAL Version 1.0 */\n");
printf("/* Driven Cavity, hard wired */\n");
printf("/* Copyright CAB, TU Braunschweig */\n");
printf("/* http://www.cab.bau.tu-braunschweig.de*/\n");
printf("/* NO guarantee whatsoever */\n");
printf("/* published under GNU License */\n");
printf("/* Questions to: */\n");
printf("/* kraft@cab.bau.tu-bs.de */\n");
printf("/* toelke@cab.bau.tu-bs.de */\n");
printf("/*****************************************/\n\n\n");
/*---------------------------------------------------------------------------*/
/* read parameters */
printf("max_x, max_y, t_max, postproc_intervall, kin. viscosity ?\n");
scanf("%d %d %d %d %lf",&max_x, &max_y, &t_max, &postproc_intervall, &tau);
printf("max_x=%d, max_y=%d t_max=%d, postproc_intervall=%d, nu=%g\n",
max_x,max_y, t_max, postproc_intervall, tau);
/*---------------------------------------------------------------------------*/
if((tau<0.005) || (tau>0.2))
{printf("viscosity should be in the range [0.005,0.2] ...\n");
exit(1);
}
/* compute tau from viscosity */
tau=(6.0 * tau + 1.0) / 2.0;
allocate(); /* initialise mass and momentum (u=v=0, rho_0 from defines.h) */
init(); /* initialise Geometry */
nit_geo();
/*---------------------------------------------------------------------------*/
/* time loop (explicit scheme) */
for(t=1;t<=t_max;t++)
{collision();
propagate();
/* plug in your favourite postprocessing routine here */
if(!(t%postproc_intervall))
{
write_avs_field_file(t);
}
/*---------------------------------------------------------------------------*/
/* that's it */
return(0);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -