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 2012年1月17日 GMT-5 02:50

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年12月20日 GMT-5 02:39
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 2011年12月21日 GMT-5 15:44
Thanks! That fixes the problem :)
Thanks! That fixes the problem :)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年1月16日 GMT-5 22:27
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 2012年1月17日 GMT-5 02:50
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.