Types to represent physical values
This package contains quantities (Real
types)
that are instantiated
to represent physical values (Real
variables). The
unit
attribute of each quantity is used to denote the
physical dimensionality in terms of fundamental dimensions:
angle (A), length (L), mass (M), amount of subtance (N), and time (T).1
The fundamental dimensions
are combined according to the rules established for unit strings
[Modelica2010, p. 210].
The abbreviations (A, L, M, N, T) are applied in alphabetical order in each numerator and denominator.
Temperature and charge are considered derived dimensions as if the
Faraday constant
(kF or 96485.3399 C/mol) and the
gas constant
(R or 8.314472 J/(mol K)) are nondimensionalized.
The quantity
attribute of each quantity is not used since it is redundant in this context.
The displayUnit
attribute is
only used for quantities that imply a certain display unit. For example,
Temperature is an alias for
Potential with a default
display unit of K. Some quantities have minimum values
(e.g., min=0
for PressureAbsolute).
This package (Quantities) is abbreviated as Q
throughout
the rest of QCalc.
Most quantities are named with adjectives following the noun so that related
quantities are grouped when alphabetized.
Methods for unit checking
have been established [Mattsson2008,
Broman2008,
Aronsson2009] and can, in theory, be applied to
dimension checking instead. However, this does not work in Dymola as of 2014, so unit checking must be turned
off (Advanced.CheckUnits = false
).
For more information, please see the documentation of the Units package.
1. This misnomer (unit
attribute for dimension) is necessary because Real
variables do not have a dimension
attribute in Modelica. Beware that:
unit="L"
indicates a length quantity (not a volume in litres).unit="T"
indicates a time quantity (not a magnetic flux in teslas).unit="A"
indicates an angle (not a current in amperes).unit="N"
indicates an amount of substance (not a force in newtons).
Extends from Icons.TypesPackage (Icon for packages containing type definitions (from MSL 3.2.1)).
type Acceleration = Quantity (final unit=" L/T2");
type Amount = Quantity (final unit=" N", min=0);
type AmountReciprocal = Quantity (final unit=" 1/N", min=0) "Reciprocal of amount";
type Angle = Quantity (final unit=" A");
type Angle2 = Quantity (final unit=" A2") "Solid angle";
type Area = Quantity (final unit=" L2", min=0);
type Capacitance = Quantity (final unit=" N2.T2/(L2.M)", min=0);
type Concentration = Quantity (final unit=" N/L3", min=0);
type Conductance = Quantity (final unit=" N2.T/(L2.M)", min=0);
type Current = Quantity (final unit=" N/T");
type Diffusivity = Quantity (final unit=" L2/T", min=0);
type Energy = Quantity (final unit=" L2.M/T2");
type Force = Quantity (final unit=" L.M/T2");
type Frequency = Quantity (final unit=" A/T");
type Illuminance = Quantity (final unit=" J.A2");
type Inductance = Quantity (final unit=" L2.M/N2", min=0);
type Length = Quantity (final unit=" L", min=0);
type LengthSpecific = Quantity (final unit=" L/N", min=0) "Specific length";
type LengthSpecificMassSpecific = Quantity (final unit=" L.M/N2", min=0) "Specific length times specific mass";
type Luminance = Quantity (final unit=" J/L2");
type LuminousEmittance = Quantity (final unit=" J.A2/L2") "Luminous emittance";
type LuminousIntensity = Quantity (final unit=" J") "Luminous intensity";
type MagneticDipoleMoment = Quantity (final unit=" A.L2.N/T") "Magnetic dipole moment";
type MagneticFieldAux = Quantity (final unit=" A.N/(L.T)") "Auxiliary magnetic field";
type MagneticFlux = Quantity (final unit=" L2.M/(A.N.T)") "Magnetic flux";
type MagneticFluxAreic = Quantity (final unit=" M/(A.N.T)") "Areic magnetic flux";
type MagneticFluxReciprocal = Quantity (final unit=" A.N.T/(L2.M)") "Reciprocal of magnetic flux";
type MagneticFluxSpecific = Quantity (final unit=" L2.M/(A.N2.T)") "Specific magnetic flux";
type MagnetomotiveForce = Quantity (final unit=" A.N/T") "Magnetomotive force";
type Mass = Quantity (final unit=" M", min=0);
type MassSpecific = Quantity (final unit=" M/N", min=0) "Specific mass";
type MomentumRotational = Quantity (final unit=" L2.M/(A.T)") "Rotational momentum";
type Number = Quantity (final unit=" 1");
type Permeability = Quantity (final unit=" L.M/(A2.N2)", min=0);
type Permittivity = Quantity (final unit=" N2.T2/(L3.M)", min=0);
type PermittivityReciprocal = Quantity (final unit=" L3.M/(N2.T2)", min=0) "Reciprocal of permittivity";
type Potential = Quantity (final unit=" L2.M/(N.T2)");
type PotentialAbsolute = Quantity (final unit=" L2.M/(N.T2)", min=0) "Absolute potential";
type PotentialPerWavenumber = Quantity (final unit=" L3.M/(A.N.T2)") "Potential per wavenumber";
type Power = Quantity (final unit=" L2.M/T3");
type PowerArea = Quantity (final unit=" L4.M/T3") "Power times area";
type PowerAreic = Quantity (final unit=" M/T3") "Areic power";
type PowerAreicPerPotential4 = Quantity (final unit=" N4.T5/(L8.M3)") "Areic power per 4th power of potential";
type Pressure = Quantity (final unit=" M/(L.T2)");
type PressureLineic = Quantity (final unit=" M/(L2.T2)") "Lineic pressure";
type Resistance = Quantity (final unit=" L2.M/(N2.T)", min=0);
type Time = Quantity (final unit=" T");
type TimeReciprocal = Quantity (final unit=" 1/T") "Reciprocal of time";
type Velocity = Quantity (final unit=" L/T");
type Velocity2 = Quantity (final unit=" L2/T2") "Squared velocity";
type Viscosity = Quantity (final unit=" M/(L.T)", min=0);
type Volume = Quantity (final unit=" L3", min=0);
type Wavelength = Quantity (final unit=" L/A");
type WavelengthVelocity = Quantity (final unit=" L2/(A.T)") "Wavelength times velocity";
type Wavenumber = Quantity (final unit=" A/L");
type Temperature = Potential (displayUnit="K");
type TemperatureAbsolute = PotentialAbsolute (displayUnit="degC") "Absolute temperature";