Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to get the average normal vector of a surface

Please login with a confirmed email address before reporting spam

Hi, I am new to COMSOL. I want to compute the volume velocity on a surface. I know I can use integration under the derived values to compute the the veloctiy over a surace. However, that is based on global coordinate system. In order to project the velocity from global coordinate system to the local coordinate system, I need the get the normal vector on the surface. How can I do it? I found some thread decade ago discussing the related topic. But not much detail was given. Any help will be appreciated.


5 Replies Last Post 31.01.2022, 16:41 GMT-5
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 31.01.2022, 13:58 GMT-5

Hello Junfeng,

This old thread may be helpful to you.

Best regards,

Jeff

-------------------
Jeff Hiller
Hello Junfeng, [This old thread](https://www.comsol.com/forum/thread/146372/which-variable-s-denote-fluid-shear-on-a-surface-in-3d?last=2017-06-21T18:44:34Z) may be helpful to you. Best regards, Jeff

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 31.01.2022, 15:25 GMT-5

Jeff

Thank you so much! I have just used COMSOL for less than 2 month. My another question is, is there any way to find the list of build-in variables? For example the normal vector nx, ny, and nz in your previous thread. How am I supposed to know these names unless I read through the thousand-page manual?

Jeff Thank you so much! I have just used COMSOL for less than 2 month. My another question is, is there any way to find the list of build-in variables? For example the normal vector nx, ny, and nz in your previous thread. How am I supposed to know these names unless I read through the thousand-page manual?

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 31.01.2022, 16:11 GMT-5
Updated: 2 years ago 31.01.2022, 16:13 GMT-5

Hello Junfeng,

Fair question. Quite a few years ago now, I used to give a "tips and tricks" presentation, and on one of the slides I told the attendees the answers to all their questions are found in the Reference Guide, as opposed to the other manuals that are included with the software. It's of course a bit of an exageration. With that said, when you are new to COMSOL it is a good idea to at least have browsed the Reference Guide once to know what's in its various chapters; almost all questions from new users refer to features documented in the Reference Guide. This thread proves that point. Once you've perused the Reference Manual -even just once briefly- you know that it contains the sort of definitions you were asking about in Chapter 5, and a quick search (Ctrl+F) for "normal vector" will take you to page 323 (in that manual for version 6.0). That manual also describes the syntax, the available pre-implemented functions, etc.

Nowadays, another very effective way of finding the name of predefined quantities is to, in the GUI itself, look at the postprocessing quantities available for plotting. See my attached screenshot: by pretending I want to generate an arrow plot on a geometry's surfaces, I can quickly determine that the normal vector is (nx, ny, nz).

Yet another approach is to do Ctrl+F in the GUI and search for "normal vector": if that string appears in the description of any quantity in any of the Settings windows of your model, this will find it!

Best,

Jeff

-------------------
Jeff Hiller
Hello Junfeng, Fair question. Quite a few years ago now, I used to give a "tips and tricks" presentation, and on one of the slides I told the attendees the answers to all their questions are found in the Reference Guide, as opposed to the other manuals that are included with the software. It's of course a bit of an exageration. With that said, when you are new to COMSOL it is a good idea to at least have browsed the Reference Guide once to know what's in its various chapters; almost all questions from new users refer to features documented in the Reference Guide. This thread proves that point. Once you've perused the Reference Manual -even just once briefly- you know that it contains the sort of definitions you were asking about in Chapter 5, and a quick search (Ctrl+F) for "normal vector" will take you to page 323 (in that manual for version 6.0). That manual also describes the syntax, the available pre-implemented functions, etc. Nowadays, another very effective way of finding the name of predefined quantities is to, in the GUI itself, look at the postprocessing quantities available for plotting. See my attached screenshot: by pretending I want to generate an arrow plot on a geometry's surfaces, I can quickly determine that the normal vector is (nx, ny, nz). Yet another approach is to do Ctrl+F in the GUI and search for "normal vector": if that string appears in the description of any quantity in any of the Settings windows of your model, this will find it! Best, Jeff


Please login with a confirmed email address before reporting spam

Posted: 2 years ago 31.01.2022, 16:26 GMT-5

Jeff

Thank you. I did try to find them under the expression drop-down windows. However I was looking at the wrong catogory.

I used "surface" node under "dataset" node to define a surface and then used " surface integration" under the "derived values" node to compute the volume velocity (Hopefully, this is a correct way.)

When I click the replace expression icon, there is a "geometry" catagory that is at the same level with "component1". There is no "nx, ny, nz" under this catagory. So here comes another question: what is the difference between "geometry" and "component1"=>"geometry"?

Jeff Thank you. I did try to find them under the expression drop-down windows. However I was looking at the wrong catogory. I used "surface" node under "dataset" node to define a surface and then used " surface integration" under the "derived values" node to compute the volume velocity (Hopefully, this is a correct way.) When I click the replace expression icon, there is a "geometry" catagory that is at the same level with "component1". There is no "nx, ny, nz" under this catagory. So here comes another question: what is the difference between "geometry" and "component1"=>"geometry"?

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 31.01.2022, 16:41 GMT-5
Updated: 2 years ago 01.02.2022, 08:59 GMT-5

Actually, I don't know off hand.

Edit: I inquired with some colleagues, and we agreed that there is no fundamental reason for the existence of this Geometry category located outside of the Component category. It would be more logical for all the geometric quantities relevant to component 1 it to be found under Component. You can consider it a minor bug. I have reported it for correction. Thanks for pointing this out!

Jeff

-------------------
Jeff Hiller
Actually, I don't know off hand. Edit: I inquired with some colleagues, and we agreed that there is no fundamental reason for the existence of this Geometry category located outside of the Component category. It would be more logical for all the geometric quantities relevant to component 1 it to be found under Component. You can consider it a minor bug. I have reported it for correction. Thanks for pointing this out! Jeff

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.