資源簡介
計算流體力學(xué)中使用格子Boltzmann方法模擬三維方腔流的代碼
代碼片段和文件信息
//?三維方腔.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include
#include
#include
#include
#include
#include
#include
using?namespace?std;????????????????????????//變量名定義
const?int?Q=15;
const?int?NX=80;//尺度
const?int?NY=40;
const?int?NZ=40;
const?int?Re=400;
const?double?RHO=1.0;
const?double?U=0.1;??????????????????????????????????
double?niu=U*NX/Re;
double?tau=3.0*niu+0.5;
int?e[Q][3]={??{000}{100}{-100}{010}{0-10}{001}{00-1}{111}{-1-1-1}{11-1}{-1-11}{1-11}{-11-1}{1-1-1}{-111}??};
double?w[Q]={2.0/91.0/91.0/91.0/91.0/91.0/91.0/91.0/721.0/721.0/721.0/721.0/721.0/721.0/721.0/72};??????//速度場權(quán)函數(shù)
- 上一篇:漂亮的MFC進(jìn)度條程序
- 下一篇:電話客戶服務(wù)模擬
評論
共有 條評論