<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.
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,
Code Block | ||
---|---|---|
| ||
<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_magnitude>
</units> |
...
="1 |
...
Code Block | ||
---|---|---|
| ||
<container n="units" pn="Units" icon="units-16" help="Units definition">
<value n="units_mesh" pn="Geometry units" unit_mesh_definition="1" icon="units-16"/>
<value n="units_system" pn="Unit system" units_system_definition="1" icon="units-16" state="hidden">
<dependencies node="//*[@unit_definition or @unit_mesh_definition='1']" att1="change_units_system" v1="{@v}"/>
</value>
<container n="basic_units" pn="General units" icon="units-16" state="normal">
<value n="units_length" pn="Length" unit_definition="L"/>
<value n="units_mass" pn="Mass" unit_definition="M"/>
<value n="units_force" pn="Force" unit_definition="F"/>
<value n="units_pressure" pn="Pressure" unit_definition="P"/>
<value n="units_temperature" pn="Temperature" unit_definition="Temp"/>
<value n="units_time" pn="Time" unit_definition="T"/>
</container>
</container> |
...
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
...
. |
...
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.
...
Code Block | ||
---|---|---|
| ||
<value n="ini_temp" pn="Initial temperature" v="20.0" unit_magnitude="Temp" units="°C"/> |
...
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
...
Code Block | ||
---|---|---|
| ||
<units> <unit_magnitude n="F" pn="Force" default="N" SI_base="N" active="kN"> <unit n="kN" pn="kilonewton" p="1" units_system="SI"/> </unit_magnitude> <unit_magnitude n="P" pn="Pressure" default="Pa" SI_base="Pa" active="MPa"> <unit n="MPa" pn="megapascal" p="1" units_system="SI"/> </unit_magnitude> </units> |
...