Using Standard Unit Prefixes and Syntax
Standard Unit Prefixes
For SI units you can scale data using the standard prefixes for powers of 10 — kilo, mega, milli, or micro, for example. Either the full prefix or the symbol can be used, but you must use the same form for the prefix and the unit — that is, [milliampere] and [mA] are valid but not [mampere] or [milliA]). In the Settings windows for plotting and numerical results, the Unit list contains the SI unit for the quantity, including the most common prefixes. The lists also contain applicable non-SI units, which in some cases also support these prefixes — for example, for g (gram), G (gauss), and M (molar).
Use Table 3-7 as a guide for the format to enter.
Table 3-7: SI prefixes.
1024
1021
1018
1015
1012
10-1
10-2
10-3
10-6
10-9
10-12
10-15
10-18
10-21
10-24
Standard Unit Syntax
You can use the unit syntax to specify a quantity with any applicable unit. To do so, append the unit to any constant or variable in a model using a syntax where you enclose the unit in brackets, for example, 200[ft] and 3e6[kg/m^3].
Both the name and the symbol can be used for a unit (but only names that form a single word without spaces or hyphens are possible to use). For example, 2.4[ampere] and 2.4[A] are both valid to indicate an electric current in SI units. The SI units can also contain standard prefixes. Appending a unit means that you multiply the constant or variable to the left of the unit declaration with this unit. This multiplication takes precedence over other operators so, for example, 1/2[m] evaluates to 0.5 m1 (0.5[1/m]) whereas both (1/2)[m] and 1/2*1[m] evaluate to 50 cm (0.5[m] or 50[cm]). Also, if L is a variable defined as 2[m], L[1/s] evaluates to 2[m/s].
The following examples show how to apply the unit syntax:
Adding two quantities of the same kind that use different units: 0.5[ft]+33[mm]. The COMSOL Multiphysics software converts the result to the base unit system’s length unit (0.1854 m for SI units, for example). A quantity without a unit is treated as given in the base unit’s systems unit, so, for example, 0.5+33[mm] evaluates to 0.533 m when using SI units.
Using multiplication with a unit to get consistent units for two quantities that you want to add, for example, 14[kg]+ht.rho[m^3], which works if ht.rho represents the density for a heat transfer model. You can also concatenate several units, for example, 3.6[N][m], which is equivalent to typing 3.6[N*m] and evaluates to 3.6 N·m.
For unit names with spaces and hyphens, such as British thermal unit and pound-force, only use the symbols when declaring units.
It is possible to add constants (without units) to any quantity. The COMSOL Multiphysics software then assumes that this value has the same unit as that quantity (as indicated in the Settings window).
All data in the material databases and Material Library product use SI units and this unit syntax.
Declaring Units for Parameters, Variables, and Functions
When using parameters, variables, and functions in expressions:
If user-defined parameters or variables are used in the physics, it is good practice to use the unit syntax to define them. The Settings windows for parameters and variables display the resulting unit, in the models base unit system, of user-defined parameters and variables. It is important to verify that the variables have the expected unit before using them in the physics settings. The unit of parameters and variables is otherwise undefined.
If other units than the base unit system’s units are used or if SI prefixes are included, the conversion to base units also affects the value (quantity) using a scaling factor (and an offset for temperature units). The Value column in a Settings window for Parameter displays the quantity and unit in the base unit system so that you can see the result of the unit conversion. For example, a parameter is defined as 3[ft], the result in the Value column is 0.9144 m if the base unit system is SI.