from_kJ function

Requirements.Units.Conversions.from_kJ  ยท source

Icon of from_kJ

Convert from kilojoule to joule

Extends Modelica.Units.Icons.Conversion

Convert from kilojoule to joule: J := kJ*1000. The input kJ is the value in kilojoule (type NonSI.Energy_kJ), the output J the value in joule (type Modelica.Units.SI.Energy). The inverse is to_kJ.

The conversion is a multiplication by a constant factor, without offset, so it converts differences and rates alike; it is exact up to floating-point rounding and has no limits on the input. The function is inlined. A check model uses it to write a value of a requirement in the unit in which the requirement states it, from_kJ(<value as written>), so that the model reads like the statement; see Conversions. Examples.Elementary.Units.Conversions asserts its factor and the round trip to_kJ(from_kJ(7)).

Copyright © 2026 Model Based Innovation LLC. All rights reserved.

Inputs

NameTypeDescription
kJ inputNonSI.Energy_kJValue in kilojoule

Outputs

NameTypeDescription
J outputSI.EnergyValue in joule