Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Units in COMSOL - Problems

Please login with a confirmed email address before reporting spam

Today I found what seems to be a flaw in COMSOL 4.0. I declared a parameter "h" (planck's constant) and put the following expression (I copy/pasted it here:)

6.62*10^-34 [m^2*kg/s]

Then, I declared parameter "test" as

h

So, I would expect both "test" and "h" to have the same units, but instead, "test" has units "m" (meters). Why does this happen? I am not quite trusting COMSOL on units anymore, unless I made a terrible mistake. Could someone help me?

4 Replies Last Post Jan 17, 2012, 2:50 a.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 20, 2011, 2:39 a.m. EST
You should generally avoid variable or parameter names that are predefined by Comsol, such as h (for the mesh element size) and test (for the test operator). Once you rename "h" to something else, it should work as expected. Note that Comsol also predefines some physical constant, and you can refer to Planck's constant as "h_const".
You should generally avoid variable or parameter names that are predefined by Comsol, such as h (for the mesh element size) and test (for the test operator). Once you rename "h" to something else, it should work as expected. Note that Comsol also predefines some physical constant, and you can refer to Planck's constant as "h_const".

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 21, 2011, 3:44 p.m. EST
Thanks! That fixes the problem :)
Thanks! That fixes the problem :)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 16, 2012, 10:27 p.m. EST
Where can I find a complete list of physical quantities predefined in COMSOL? I mean, like h_const for Planck's constant.
Where can I find a complete list of physical quantities predefined in COMSOL? I mean, like h_const for Planck's constant.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 17, 2012, 2:50 a.m. EST
You'll find a list in the Comsol User's Guide: table 3.5, page 123 in version 4.2a.
You'll find a list in the Comsol User's Guide: table 3.5, page 123 in version 4.2a.

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.