Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

<unit>

A unit of measurement is a definite magnitude of a physical quantity, defined and adopted by convention or by law, that is used as a standard for measurement of the same physical quantity. Any other value of the physical quantity can be expressed as a simple multiple of the unit of measurement. For example, length is a physical quantity, and metre meter is a unit of length that represents a definite predetermined length.


The node <units> in the *.spd file can be used to change some defaults or to add specialized units, which in principle are not supported. The structure and contents of this subtree <units> requires to have the format as further detailed in this document. The following attributes are available:

n - name

pn - printed name (decorated and translated)

p - Priority of the unit, it is regarded as more important than others units. The possible values for 'p' are 1, 2 and 3, as follows,

1 - It gives maximum priority, and therefore a unit with p="1" is the default unit in the GUI.
2 - A unit with p="2" is always shown in the combobox of below to facilitate the selection of the most used units.
3 - It gives lowest priority, and therefore a unit with p="3" could only be chosen when clicking on 'More units...' option in the combobox of below, which enables the user to choose the unit from a table.
Example of combobox itemsImage Modified
Example of combobox items

Table to select the unit to insertImage Modified
Table to select the unit to insert

factor - The conversion factor used to multiply a quantity when converting from one system of units to another. It is the mathematical tool for converting between units of measurement [1 unit=factor*unit(SI)]. Example: 1mm=10e-3 m.

help - To make easier to the user to identify the unit.


Example of <units> field: Species concentration and reference variable are not supported and therefore, both magnitudes are defined in the *.spd file, as follows, <units>

Code Block
languagexml
<units>
<unit_magnitude n="Reference_variable_unit" pn="Reference variable unit" default="U" SI_base="U" active="1">

...


      <unit n="U" pn="ReferenceUnit" p="2" factor="1.0"/>

...


      <unit n="ppm" pn="parts-per-million" p="2" factor="1.0e-6" help="parts-per-million"/>

...


      <unit n="ppb" pn="parts-per-billion" p="2" factor="1.0e-9" help="parts-per-billion"/>

...


      <unit n="%" pn="per-one-hundred" p="2" factor="0.01" help="per-one-hundred"/>

...


      <unit n="%0" pn="per-one-thousand" p="2" factor="0.001" help="per-one-thousand"/>

...


      <unit n="Np" pn="Nepper" p="2" factor="1.0" help="Nepper"/>

...


   </unit_magnitude>

...


<unit_magnitude n="Species_concentration" pn="Species concentration" default="C" SI_base="C" active="1">

...


      <unit n="C" pn="ReferenceUnit" p="2" factor="1"/>

...


      <unit n="ppm" pn="parts-per-million" p="2" factor="1.0e-6" help="parts-per-million"/>

...


      <unit n="ppb" pn="parts-per-billion" p="2" factor="1.0e-9" help="parts-per-billion"/>

...


      <unit n="%" pn="per-one-hundred" p="2" factor="0.01" help="per-one-hundred"/>

...


      <unit n="%0" pn="per-one-thousand" p="2" factor="0.001" help="per-one-thousand"/>

...


      <unit n="mol" pn="mole" p="2" factor="1.0"/>

...

Unit system

n

Int. system (SI)

SI

Imperial system

imperial

...

  • units_system - There are two systems used to define units, the possible values are:

SI - International system
imperial - Imperial system
Defining magnitudes and units
The attributes involved in any field of the .spd file are 'unit_magnitude' and 'units'.

  • unit_magnitude: Its value relates to the name 'n' used to reference the unit field. Please see the table below for a complete list of all the names available.
  • units: Its value is the default unit shown in the GUI, which could be changed, if desired.

Some functions are useful for writing data with units defined into the calculation file. For more information about this issue, see the section called Writing the input file for calculation.
Example:
<value n="ini_temp" pn="Initial temperature" v="20.0" unit_magnitude="Temp" units="°C"/>
Note: For instance, it is convenient to change magnitudes like unit_magnitude="F/L^2" by unit_magnitude="P".
The table below gives a summary of the names used for all units available.

pn

n

Unit by default

Length

L

m

Mass

M

kg

Time

T

s

Temperature

Temp

K

Frequency

Frequency

Hz

Force

F

N

Pressure

P

Pa

Energy

Energy

J

Power

Power

W

Angle

Angle

rad

Solid_angle

Solid_angle

sr

Velocity

Velocity

m/s

Acceleration

Acceleration

m/s^2

Area

Area

m^2

Volume

Volume

m^3

Density

Density

kg/m^3

Electric current

Electric_current

A

Amount of substance

Amount_of_substance

mol

Luminous intensity

Luminous_intensity

cd

Electric charge

Electric_charge

C

Electric potential

Electric_potential

V

Capacitance

Capacitance

F

Electric resistance

Electric_resistance

?

Electric conductance

Electric_conductance

S

Magnetic flux

Magnetic_flux

Wb

Magnetic flux density

Magnetic_flux_density

T

Inductance

Inductance

H

Delta phi

DeltaPhi

Δφ

Delta temperature

DeltaTemp

ΔK

Luminous flux

Luminous_flux

lm

Illuminance

Illuminance

lx

KinematicViscosity

KinematicViscosity

m^2/s

Viscosity

Viscosity

Pa*s

Permeability

Permeability

m^2

...


    </unit_magnitude>
</units>