How to obtain faceID of a patch in Paraview?

Dear all,

Is there a possibility to obtain FaceIDs of a particular patch?

  1. I have done a heat transfer simulation using OpenFoam and visualizing in paraview. When doing so, I can see “cellData” which includes Field (T), PatchID, Cell Type and Cell ID (which is nothing but index).

  2. I need faceIDs for further process. Is there a possibility to obtain faceIDs along with field values?

Any leads will be appreciated.

Regards,

Sunag R A.

Can’t see that this is very easily possible. In your other cross-post (VTK) you mention that you are actually using foamToVTK for conversion though.

In any case, there is a fundamental concept to be tackled. In ParaView/VTK, everything is essentially cell-based - so you can have cell-centred values for the OpenFOAM results. Or you have boundary patches, which get added as additional polyData elements in the block output.

It sounds like you want to also examine the face values - of the entire mesh? This doesn’t really fit with the current mesh descriptions. Eg, you want to attach values to the sides of various cells, but to do so you would actually need the cell faces as a separate mesh description.

One stop-gap that largely works is foamToVTK -surfaceFields. This generates the face values as VERTEX quantities for each face centre, which makes them essentially meshless. Visualize with “Point Gaussian” (can also inspect the values). Could easily add in the OpenFOAM faceIds to foamToVTK at the same time (small amount of coding).

Dear Mark,

Thank you very much for your reply.

  1. I can get faceIDs from Openfoam itself just after the mesh by using a utility topoSet addressing it as “patchToFace”. This utility collects the faces of the particular patch given and gets the faceIDs.

  2. But, there is a problem in this. I have a lot of test cases which are in similar design. When, I run this utility, I obtain faceIDs but they wont be aligned properly for many test cases.

  3. I need faceIDs of a particular patch/boundary because, I need to split those according to those faces and apply multiple BCs on the same patch.

  4. I did try with “foamToVTK -surfaceFields”, this gives the individual patches into vtk but without faceIDs as such.

  5. I have attached two images, where one is original boundary and second one is splitted boundary based on Field value. I need that kind of boundary which is giving me an error in OpenFoam for few cases.

Original Boundary, only faces needs to be extracted

Domain after split based on FaceIDs and Field Value(Need these kind, this is for different test case)

**Problem in some test case since faceIDs obtained are not aligned (Random alignment) **

Hope it was understood. So, I was thinking is there any way possible in VTK/Paraview to split the patch.

Any leads will be appreciated.

Regards,
Sunag R A.

This is now clearly an OpenFOAM question and not ParaView/VTK at all.
Can or should continue on the cfd-online.com forum, but for the moment I will jot down some notes since I think the problem is elsewhere.

This is not really going to work like you want it to. Each boundary patch in OpenFOAM is contiguous range, so if you want to split a patch into multiple patches you will need to reorder the faces so that each sub-patch is also contiguous. Need to reorder/rewrite the cell owner, trigger topology updates, etc. ==> Not much fun!

It seems to me that what you probably really want is the equivalent of the topoSet selection of the faces actually built into the boundary condition (at least on startup or mesh-change). Within the boundary condition you would then apply different zones depending on the information you collected in the first step.

To be clear, you want to have a boundary condition that handles different sub-regions, so this is what you will need to define. Some of it could be possible via a dynamic coded boundary condition, but you may also need to write a real one instead.

It seems to me that what you probably really want is the equivalent of the topoSet selection of the faces actually built into the boundary condition (at least on startup or mesh-change). Within the boundary condition you would then apply different zones depending on the information you collected in the first step.

Yes. I need something similar to topoSet to select the faces and then using those faces, I will split the Boundary condition based on my need.

  1. I have already put up the problem in much more detail via OpenFomic way in cfd-online.com. Since, no reply, I have been thinking of alternatives too.

  2. I now understood that once the mesh is created, since VTK works on cell based, I think it is not possible to obtain the face details of that particular patch.

  3. As you mentioned whether I need to have BC that handles sub-regions. Well, with regards to this, I need to have multiple BC in single patch. This is being divided based on Field Value.
    (Meaning, firstly, field value is applied externally on this patch with Temp = 0 and Temp > 0. Now, I use this patch to split based on T=0 and T>0. Then, I apply flux BC where T=0). Well, at first only I cannot apply flux BC where T=0 since the mesh is obtained from point cloud and it takes only Dirichet BC at first.

  4. Well, Thanks for the inputs.

Regards,

Sunag R A.