# estimating surface normals and areas in structured mesh

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 9, 2020, 04:31 estimating surface normals and areas in structured mesh #1 New Member   Join Date: Jun 2015 Posts: 12 Rep Power: 7 Hi All, Sorry if the question might be simple but I have my data on a simple regular grid and am interested to estimate surface normal and area of the geometry to use to do surface integrals. My data structure are slightly specific and I have posted the details here https://stackoverflow.com/questions/...tructured-grid I would really appreciate any comments. Thanks Ashkan

 May 9, 2020, 07:08 #2 Senior Member     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 1,323 Blog Entries: 19 Rep Power: 30 It seems like you are after a way to compute surface integral within a level-set like immersed boundary approach. There is surely literature on this but I can'trecall any specific paper at the moment. Have you tried searching with more specific keywords?

May 9, 2020, 07:21
#3
New Member

Join Date: Jun 2015
Posts: 12
Rep Power: 7
Quote:
 Originally Posted by sbaffini It seems like you are after a way to compute surface integral within a level-set like immersed boundary approach. There is surely literature on this but I can'trecall any specific paper at the moment. Have you tried searching with more specific keywords?

That is absolutely correct Paolo that what I am after is very similar to immersed boundary and I indeed searched with keywords of immersed boundary but could not find anything.

 May 9, 2020, 07:36 #4 Senior Member     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 1,323 Blog Entries: 19 Rep Power: 30 I work with a different kind of immersed boundary, where surface integrals are straightforward, so this sort of things it's not in my daily routine and I can't recall any specific paper at the moment. But there are literally dozens where the approach is at least similar. If I had to give you my 2 cents (to be taken with a grain of salt) I would go with: 1) marching cube (square in 2D) algorithm to find the exact intersection for a given, arbitrary, level-set value. Should be quite simple in 2D over a structured grid (https://en.wikipedia.org/wiki/Marching_squares) 2) 1 should give you a set of edges with relative intersected cells, from which you can get the function to be integrated using the correct side. Sum all over the edges (order should be irrelevant) and you should be done

 May 9, 2020, 07:46 #5 Senior Member     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 1,323 Blog Entries: 19 Rep Power: 30 Of course, this might well be an overkill. You could also just loop on all the cells and once you detect a jump in level set you just need to detect the intersection points (maybe you can use VOF or level set literature for this) and compute the length L of the edge between them (then adding L times n times P in the outer cell to your integral).

 May 9, 2020, 09:24 #6 Senior Member   Filippo Maria Denaro Join Date: Jul 2010 Posts: 5,416 Rep Power: 58 is the problem 2D or 3D?

May 9, 2020, 10:19
#7
New Member

Join Date: Jun 2015
Posts: 12
Rep Power: 7
Quote:
 Originally Posted by FMDenaro is the problem 2D or 3D?

It is 2D but will be expanded to 3D later as well.

May 9, 2020, 13:09
#8
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 5,416
Rep Power: 58
Quote:
 Originally Posted by cfdwave It is 2D but will be expanded to 3D later as well.

I was thinking about a simple way: in the 3D space a plane is defined by f(x,y,z)=z-a*x-b*y+c=0, where a,b,c can be determined using three nodes that determine a plane surface. The direction of the normal is obtained by the partial derivatives

df/dx=a
df/dy=b
df/dz=1

you can normalize to get the normal vector unit.

 Tags finite difference, surface area, surface normals