五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

OpenFOAM手動網(wǎng)格分塊

2021-05-08 10:21 作者:線代制霸  | 我要投稿

1.?通過OpenFOAM的格式自編程來對各個cell命名,確定他們所屬的processor

/*---------------------------------------------------------------------------*\

??========= ????????????????|

??\\ ?????/ ?F ield ????????| OpenFOAM: The Open Source CFD Toolbox

???\\ ???/ ??O peration ????|

????\\ ?/ ???A nd ??????????| Copyright (C) 2011-2013 OpenFOAM Foundation

?????\\/ ????M anipulation ?|

-------------------------------------------------------------------------------

License

????This file is part of OpenFOAM.

?

????OpenFOAM is free software: you can redistribute it and/or modify it

????under the terms of the GNU General Public License as published by

????the Free Software Foundation, either version 3 of the License, or

????(at your option) any later version.

?

????OpenFOAM is distributed in the hope that it will be useful, but WITHOUT

????ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or

????FITNESS FOR A PARTICULAR PURPOSE. ?See the GNU General Public License

????for more details.

?

????You should have received a copy of the GNU General Public License

????along with OpenFOAM. ?If not, see <http://www.gnu.org/licenses/>.

?

Application

????scalar2Label

????codeBy CloudBird, HIT,cloudbird7@foxmail.com

?

\*---------------------------------------------------------------------------*/

?

#include?"fvCFD.H"

?

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

?

?

int?main(int?argc, char?*argv[])

{

????#include?"setRootCase.H"

????#include?"createTime.H"

????#include?"createMesh.H"

?

????const?volVectorField& center = mesh.C();

?

????labelIOList finalDecomp

????(

????????IOobject

????????(

????????????"manualDecomposition",

????????????mesh.facesInstance(),

????????????mesh,

????????????IOobject::NO_READ,

????????????IOobject::AUTO_WRITE,

????????????false

????????),

????????labelList (center.size())

????);

?

????Info<< "Making manualDecomposition file\n"?<< endl;

????scalar x_=0,y_=0;

label num0 = 0, num1 = 0, num2 = 0, num3 = 0;

//這里是將網(wǎng)格分為四塊,分塊的依據(jù)是下邊if的判斷語句,也就是先挖一個小方框出來,然后對剩下的部分分成三塊,并輸出分塊之后每一塊的cell的數(shù)量。

forAll(center, cellID)

????{

x_ = center[cellID].x();

y_ = center[cellID].y();

if?(x_ > -0.75 && x_ < 0.75 &&y_>-0.75&&y_ < 0.75)

{

finalDecomp[cellID] = 0;

num0++;

}

else

{

if?(x_ < 0)

{

finalDecomp[cellID] = 1;

num1++;

}

else?if?(x_ < 3)

{

finalDecomp[cellID] = 2;

num2++;

}

?

else

{

finalDecomp[cellID] = 3;

num3++;

}

}

?

????}

Info << "num0 = "?<< num0 << nl << "num1 = "?<< num1 << nl << "num2 = "?<< num2 << nl << "num3 = "?<< num3 << nl;

????finalDecomp.write();

?

????Info<< "Done\n"?<< endl;

?

????return?0;

}

?

?

// ************************************************************************* //

這樣會在constant文件夾下邊生成一個名為manualDecomposition的文件,這個文件本質(zhì)上是一個標(biāo)量文件,用于標(biāo)記各個cell所屬的processor。

?

2.?在system文件夾下的decomposeParDict中修改分割方式

numberOfSubdomains 4;

?

method ??????????manual;

?

manualCoeffs

{

????dataFile ???????"manualDecomposition";

}

其中dataFile的名字要改成我們生成的文件的名字,也就是maualDecomposition,還需要注意的一點是numberOfSubdomains的數(shù)量要和你在maulDecomposition中定義的數(shù)量一致。

?

3.之后直接decomposePar就是按照手動分割網(wǎng)格的方式對你定義的網(wǎng)格進(jìn)行分割。

processor0
processor1
processor2
processor3

文件的編譯按照一般OpenFOAM文件編譯的方式進(jìn)行,參考http://dyfluid.com/docs/book/_book/


參考文章:

https://blog.csdn.net/CloudBird07/article/details/105349031

https://www.dazhuanlan.com/2019/08/16/5d55fc7975c16/

OpenFOAM手動網(wǎng)格分塊的評論 (共 條)

分享到微博請遵守國家法律
固始县| 揭西县| 金华市| 筠连县| 潮安县| 巢湖市| 古丈县| 阿坝| 霸州市| 沂南县| 八宿县| 永年县| 庆云县| 金坛市| 凌海市| 沂源县| 贵港市| 平昌县| 灵武市| 前郭尔| 杭锦旗| 龙井市| 远安县| 石屏县| 葵青区| 镇宁| 开原市| 吉安县| 汾西县| 沁水县| 阜城县| 黎城县| 海伦市| 永昌县| 荔波县| 凭祥市| 孟津县| 芜湖县| 布拖县| 清丰县| 盐山县|