|
[Sponsors] |
Patch Extraction through code is giving a problem |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 12, 2021, 11:46 |
Patch Extraction through code is giving a problem
|
#1 |
Member
Sunag R A
Join Date: Jul 2019
Location: Bangalore, India
Posts: 82
Rep Power: 7 |
Dear all,
I want to extract a patch from the domain, so I wrote the code as shown below. Basically, the domain consists of 2 patches. I want to extract a particular patch for which the code is correct. But, I get the patch with incomplete faces although it shows the exact no of faces present in the patch. 1. I saved the faceLabels in a ".txt" file. Used this facelabel in topoSet as "LabelToFace" and converted to VTK using "foamToVTK" for visualization. 2. What is wrong in the code, so that it shows incomplete patch although it shows correct amount of faces and also I believe that the faceLabel alignment is not proper. 3. Code Code:
code #{ const fvPatch& mesh = this->patch(); const fvBoundaryMesh& boundaryMesh = mesh.boundaryMesh(); for (int patch = 0; patch < 1; patch++) { const word& patchName = mesh.boundaryMesh()[patch].name(); Info << patchName << endl; const fvPatch& cPatch = mesh.boundaryMesh()[patch]; std::ofstream file; file.open("faceID.txt"); forAll (cPatch, faceI) { label faceId = cPatch.start() + faceI; //Info << faceId << endl; file<< faceId << endl; file<< nl << endl; } file.close(); } #}; a. Patch I needed: Below is the patch that I needed. https://drive.google.com/file/d/1KUq...ew?usp=sharing b. Patch I am obtaining: Below is the patch based on code. We can see it is an incomplete patch. https://drive.google.com/file/d/1Rdi...ew?usp=sharing Any leads will be appreciated. Thanks and Regards, Sunag R A. |
|
Tags |
development, mesh manipulation, openfoam, patch, toposet |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
steadyUniversalMRFFoam Tutorial fails in MixingPlane | HenrikJohansson | OpenFOAM Bugs | 0 | February 14, 2019 05:48 |
Near wall treatment in k-omega SST | Arnoldinho | OpenFOAM Running, Solving & CFD | 38 | March 8, 2017 14:48 |
[Commercial meshers] Using starToFoam | clo | OpenFOAM Meshing & Mesh Conversion | 33 | September 26, 2012 05:04 |
CheckMeshbs errors | ivanyao | OpenFOAM Running, Solving & CFD | 2 | March 11, 2009 03:34 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |