CFD quality of mesh at boundaries

My user is trying to find three values that represent quality of mesh values for CFD datasets at boundaries. This needs to be done for unstructured and structured grids. These values are:

  1. For all surface cells of a mesh, there is a face that is on this outside surface. We want to find out the distance from the centroid of this 2d face on the surface to the center of the cell. Goal - if this is much larger or smaller than expected, we have a bad mesh.
  2. For all surface cells of a mesh, we want to find out the angle from a normal between the two points listed in item 1). Goal - If the angle significantly differs from normal we have a bad mesh.
  3. For all surface cells of a mesh, we want the distance from the normal on the face of the cell to the center of the cell. Goal - again, if this is much larger or smaller than expected we have a bad mesh.

Can this be done using a filter? Programmable filter? Should we create a new filter?

Alan

@cory.quammen @mwestphal @dcthomp

Improving MeshQuality filter to evaluate such metrics would be nice imo.

This is a very different set of operations than Mesh Quality, which computes measures for every cell in a mesh. This is associated with only cells on the boundary of the mesh. Sure, you could add a mode to Mesh Quality, but modes should be avoided IMO.

You can almost do this with existing filters in VTK. vtkGeometryFilter can extract the boundary cells and keep a record of which volumetric cell the face came from. vtkCellCenters can compute the centroids of surface cells and volumetric cells. If you extract the volumetric cells from which the surface cells came and order them in the same way, the you can do a lot with calculators to compute the desired quantities. I’m not sure what you could use to do this ordering, though - might need some custom code. Packaging all this up in a filter would be nice.

1 Like

I would be more than happy to implement that in the most optimal way.

From my user:

Almost. #3 and #1 should be combined. I don’t care much about the distance from the face centroid to the cell centroid, but I DO care about the NORMAL distance from the face centroid to the cell centroid. “Distance from the normal on the face” doesn’t really make sense. The normal is a vector and isn’t tied to anything: it’s a direction only. What I need is the “normal distance,” i.e., the normal component of the vector from the face centroid to the cell centroid. Slight confusion of terminology.

Can I edit this? What I want it to say is similar to what you have:

For surface cells on selected boundaries, I want the normal distance of the surface cell centroid (face) to its cell centroid. I want to do this to evaluate mesh spacing for a boundary layer mesh for fluids analysis. Call this quantity wall distance or normal distance to wall.

Similarly, for all surface cells on selected boundaries, I want to know the angle between the face normal on the boundary and the vector from the face centroid to the cell centroid. This is a measure of mesh orthogonality at the wall, which is important for turbulence modeling in fluids. Call this quantity wall orthogonality.

I’d rather they not evaluate this for all boundaries. These quantities are meaningless except at the wall and I don’t want values at, say, the inlet or farfield boundary polluting the range I see on the colorbar.

(Alan note - I have asked my user how to tell what boundary cells are against a wall.)

From my user regarding the wall boundary. His reply:

I don’t know how to do that. In Pointwise, I select the boundaries I want to use to calculate this, then go to the Examine menu to choose the quantity. In Ensight, I would select parts and then compute whatever I want on just those parts. I can also (in Ensight) compute a quantity globally and then adjust the scale to the min/max on certain parts. That would work, too.

Regarding the wording for #3, you could succinctly say the distance from the cell center to the plane containing the face. The distance between a point and plane is generally understood to be the shortest distance between point and plane, and this is always in the direction normal to the face.