to_kJ function
Requirements.Units.Conversions.to_kJ
ยท source
Convert from joule to kilojoule
Extends Modelica.Units.Icons.Conversion
Convert from joule to kilojoule: kJ := J/1000. The input J is the value in joule (type Modelica.Units.SI.Energy), the output kJ the value in kilojoule (type NonSI.Energy_kJ). The inverse is from_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 give a variable of the model in the unit in which the requirement states it; see Conversions. Examples.Elementary.Units.Conversions asserts it through the round trip to_kJ(from_kJ(7)).
Copyright © 2026 Model Based Innovation LLC. All rights reserved.
Inputs
| Name | Type | Description |
|---|---|---|
J input | SI.Energy | Value in joule |
Outputs
| Name | Type | Description |
|---|---|---|
kJ output | NonSI.Energy_kJ | Value in kilojoule |