Skip to content

Units Dimensions

Greg Sjaardema edited this page May 24, 2023 · 14 revisions

Base Units

Dimension Units Abbreviation
Mass Kilogram, Gram, Slug, PoundMass M
Length Meter, Centimeter, Millimeter, Foot, Inch L
Time Second, Minute, Hour t
Temperature Kelvin, Celsius, Rankine, Fahrenheit T
Angle [not base] Degree, Radian A
ElectricCurrent Ampere, Abampere, Statampere, Edison, auCurrent C
SubstanceAmount Mole, Entities, StandardCubicFoot, StandardCubicMeter a
LuminousIntensity Candela, Candle, Carcel, Hefner, Violle I

Derived Units

Derived Dimension M L t T A C a I SI Derived Unit
area 0 2 0 0 0 0 0 0 square meter m^2
volume 0 3 0 0 0 0 0 0 cubic meter m^3
speed, velocity 0 1 -1 0 0 0 0 0 meter per second m/s
acceleration 0 1 -2 0 0 0 0 0 meter per second squared m/s^2
wave number 0 -1 0 0 0 0 0 0 reciprocal meter m^-1
mass density 1 -3 0 0 0 0 0 0 kilogram per cubic meter kg/m^3
specific volume -1 3 0 0 0 0 0 0 cubic meter per kilogram m^3/kg
force 1 1 -2 0 0 0 0 0 Newton
power 1 2 -3 0 0 0 0 0 Watt
pressure, stress 1 -1 -2 0 0 0 0 0 Pascal
energy, work, torque 1 2 -2 0 0 0 0 0 Joule
quantity of heat 1 2 -2 0 0 0 0 0 Joule
current density 0 -2 0 0 0 1 0 0 Ampere per square meter A/m^2
magnetic field strength 0 -1 0 0 0 1 0 0 Ampere per meter A/m
amount-of-substance concentration 0 0 -3 0 0 0 1 0 mole per cubic meter mol/m^3
luminance 0 -2 0 0 0 0 0 1 candela per square meter cd/m^2
mass fraction 0 0 0 0 0 0 0 0 kilogram per kilogram, which may be represented by the number 1 kg/kg = 1

Dimensions

mass, length, time, temperature, angle, electric current, substance amount, and luminous intensity

Unit Systems

system mass length time temperature angle
si kilogram meter second degK radian
cgs gram centimeter second degK radian
cgs-ev gram centimeter second eV radian
shock gram centimeter microsecond degK radian
swap 1e-4 gram millimeter microsecond degK radian
ft-lbf-s slug foot second degR radian
ft-lbm-s lbm foot second degR radian
in-lbf-s lbf-sec^2/in inch second degR radian

Representation

An Exodus file will have a single consistent set of units which can either be specified by the eight individual units for each dimension (mass, length, time, temperature, angle, electric current, substance amount, and luminous intensity) or the specification of a predefined units system (si, cgs, cgs-ev, shock, swap, ft-lbf-s, ft-lbm-s, in-lbf-s).

Each variable within the Exodus file will have an optional specification of the dimensionality of the data by defining the exponents associated with each of the fundamental units. The exponents will be 32-bit integers no matter what size integers are used for data in the file.

The units for a particular variable can be derived from the unit system of the file combined with the dimensional exponents of the variable. As an example:

  • File unit system is "SI"
  • Variable "accel" has dimensional exponents are "0, 1, -2, 0, 0, 0, 0, 0"
  • The variable's units would be "meter / second^2"

If a file does not have a specified units system, then it is still permissible for the variables to have dimensional exponents; however, no units will be assumed and the dimensional exponents would simply serve to define the dimension of the variable. For example, the variable is an "acceleration".

If the file has a specified units system, but a variable has no dimensional exponents, then that variable will be assumed to be dimensionless. This can also be represented by a set of dimensional exponents that are all zero.

If a variable has any dimensional exponents attribute defined, then there must be either 5 or 8 exponents defined. It is permissible to ignore the last 3 dimensions and only provide values for the first five (mass, length, time, temperature, angle).

The exodus file and API provide a mechanism for storing, retrieving and defining the units and dimensions, but there is no validity checking or conversion from one system to another.

API

Unit system

Need to query number of units defined (five or eight), could do with ex_inquire_int

  • ex_put_units_system(int exoid, const char *type) Five Base Units
  • ex_put_units_system_extended(int exoid, const char *type) Eight Base Units
  • ex_put_units(int exoid, int count, const char *units[])
  • ex_put_units(int exoid, const char *units[]) Five Base Units
  • ex_put_units_extended(int exoid, const char *units[]) Eight Base Units
  • ex_get_units_system(int exoid, const char **type)
  • ex_get_units(int exoid, int &count, char **units)

Variable dimensional exponents

  • ex_put_dimensional_exponents(int exoid, entity_type, int index, int *exponents)
    • The index is a 1-based index to the defined variables of that type.
    • Need to figure out how to represent this since all block/set variables do not exist for all blocks or sets. Truth table can help, but it is optional and if it doesn't exist, the var is created when data is first output to is which is too late for this... Unless the exponents are stored internally by the library and then when the variable is created, we check whether they are defined for this variable and if so, they are applied to the newly created var
  • ex_put_coord_dimensional_exponents(int exoid, int index, int *exponents)
    • If index is 0 it applies to all ndim coordinates; otherwise it is a value from 1 to ndim specifying a specific coordinate.
    • If the user specifies a units system for the file, but does not define the dimensional exponents for the coordinates, they will default to length.

CDF Representation

The dimensional exponents will be represented as a attribute on the variable named "dimensional_exponents" with length 5 or 8 floating point values:

vars:
   double coordx(num_nodes) ;
      coordx:dimensional_exponents = "0, 1, 0, 0, 0" ;
   double vals_elem_var3eb2(time_step, num_el_in_blk2) ;
      vals_elem_var3eb2:dimensional_exponents = "0, 1, -2, 0, 0" ;

The units system would be specified as a global attribute. There will be only one units system defined as either a predefined system or a set of five or eight "units". The use of a predefined units system is recommended unless the listing of the five or eight individual units is needed for some specific use:

// global attributes:
                :api_version = 7.1f ;
                :version = 7.1f ;
                :floating_point_word_size = 8 ;
                :file_size = 1 ;
                :maximum_name_length = 8 ;
                // One of the following two lines:
     --->       :units_system = "SI" ;
     --->       :units_system = "kilogram", "meter", "second", "kelvin", "radian" ;
                :int64_status = 0 ;
                :title = "This is the Title of the file" ;
                :last_written_time = 0.100000001490116 ;

Extensions:

  • Would be possible to add offset and scale on a per-variable basis. Value would be val = db_val * scale + offset. Would this be done by library, or library client?
  • Is there a need to override the units system on a specific variable. For example, default is in "SI", but a specific variable is in "feet". This is not desirable as it removes consistency from the database.
  • Should the "english" systems have an option to use "Kelvin" as the temperature unit. Is "Rankine" used?
  • Is there a need to provide real dimensional exponents, or is integer the 99% solution.

See Also: