⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 Lattice Boltzmann用于模拟方腔流的程序。 生成的plt文件需用tecplot软件打开。
💻 CPP
字号:
#include "global.h"
#include "define.h"
#include "init.cpp"
#include "init_geo.cpp"
#include "collision.cpp"
#include "propagate.cpp"
#include "check_convergence.cpp"
#include "write_tecplot_field_file.cpp"

double 	 f[9][max_y][max_x],         
		 pressure[max_y][max_x],			
         tau;				
char 	 wall[max_y][max_x];


int main()
{
	int  t;					
	  
	
/*---------------------------------------------------------------------------*/
    /* 读参数*/
	printf("max_x=%d, max_y=%d, t_max=%d, nu=%g\n", max_x,max_y, t_max, nu);
/*---------------------------------------------------------------------------*/

	

	/* 通过运动粘度计算弛豫时间*/
	tau=(6.0 * nu + 1.0) / 2.0;
	
	/* 速度、密度的初始化*/
	init();

	init_geo();


/*---------------------------------------------------------------------------*/
	/* 时间演化 */
	for(t=1;t<=t_max;t++)
	{ 
		
		propagate();
		collision();

		
		if(!(t%CHECK_CONVERGENCE_INTERVALL))  //隔一段时间判断是否收敛
		if(check_convergence(t)==TRUE)
		{	
			write_tecplot_field_file(t);
			break;
		}
	
	}

/*---------------------------------------------------------------------------*/
	/* 程序运行结束*/
	return(0);               
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -