OpenFOAM의 경계 영역 계산하기
1050 단어 OpenFOAM
// inlet patch ID
label patchID = mesh.boundaryMesh().findPatchID("inlet");
// inlet polyPatch
const polyPatch& cPatch = mesh.boundaryMesh()[patchID];
// magSf,
const surfaceScalarField& magSf = mesh.magSf();
// , 0.0
scalar patchArea = 0.0;
// inlet ,
forAll(cPatch,faceI)
{
patchArea += magSf.boundaryField()[patchID][faceI];
}
// inlet
Info << "Patch Area " << patchArea << endl;
또는
label patchID = mesh.boundaryMesh().findPatchID("inlet");
const polyPatch& cPatch = mesh.boundaryMesh()[patchID];
const surfaceScalarField& magSf = mesh.magSf();
// gSum inlet
scalar AREA = gSum(magSf.boundaryField()[patchID]);
Info << "AREA = " << nl << AREA << endl;
참조 자료:
https://www.cfd-online.com/Forums/openfoam-solving/59251-how-access-faces-patch.html
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
OpenFOAM 9 튜토리얼 케이스의 동작 확인 : 다상 유체, interFoam, 댐 브레이크(RAS)$FOAM_TUTORIALS/multiphase/interFoam/RAS/damBreak/damBreak 이 튜토리얼 케이스에서는, interFoam 를 사용해, 단순화한 댐 브레이크(물기둥의 붕괴)의 2차원 문제를...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.