Functions, types, and macros

Types

ThermofluidQuantities.Acceleration โ€” Method
Acceleration(x::Unitful.Quantity)

Create an instance of a Acceleration type dimensional physical quantity, with unit-ed value equal to x. Converts to units m s^-2.

source
ThermofluidQuantities.AngularVelocity โ€” Method
AngularVelocity(x::Unitful.Quantity)

Create an instance of a AngularVelocity type dimensional physical quantity, with unit-ed value equal to x. Converts to units rad s^-1.

source
ThermofluidQuantities.Area โ€” Method
Area(x::Real)

Create an instance of a Area type dimensional physical quantity, with value equal to x and units m^2.

source
ThermofluidQuantities.Area โ€” Method
Area(x::Unitful.Quantity)

Create an instance of a Area type dimensional physical quantity, with unit-ed value equal to x. Converts to units m^2.

source
ThermofluidQuantities.AreaRatio โ€” Method
AreaRatio(x::Unitful.Quantity)

Create an instance of a AreaRatio type non-dimensional physical quantity, with unit-ed value equal to x.

source
ThermofluidQuantities.BulkModulus โ€” Method
BulkModulus(x::Unitful.Quantity)

Create an instance of a BulkModulus type dimensional physical quantity, with unit-ed value equal to x. Converts to units Pa.

source
ThermofluidQuantities.Density โ€” Method
Density(x::Unitful.Quantity)

Create an instance of a Density type dimensional physical quantity, with unit-ed value equal to x. Converts to units kg m^-3.

source
ThermofluidQuantities.Depth โ€” Method
Depth(x::Unitful.Quantity)

Create an instance of a Depth type dimensional physical quantity, with unit-ed value equal to x. Converts to units m.

source
ThermofluidQuantities.Diameter โ€” Method
Diameter(x::Unitful.Quantity)

Create an instance of a Diameter type dimensional physical quantity, with unit-ed value equal to x. Converts to units m.

source
ThermofluidQuantities.Enthalpy โ€” Method
Enthalpy(x::Unitful.Quantity)

Create an instance of a Enthalpy type dimensional physical quantity, with unit-ed value equal to x. Converts to units J kg^-1.

source
ThermofluidQuantities.Entropy โ€” Method
Entropy(x::Real)

Create an instance of a Entropy type dimensional physical quantity, with value equal to x and units J kg^-1 K^-1.

source
ThermofluidQuantities.Entropy โ€” Method
Entropy(x::Unitful.Quantity)

Create an instance of a Entropy type dimensional physical quantity, with unit-ed value equal to x. Converts to units J kg^-1 K^-1.

source
ThermofluidQuantities.FLOverD โ€” Method
FLOverD(x::Unitful.Quantity)

Create an instance of a FLOverD type non-dimensional physical quantity, with unit-ed value equal to x.

source
ThermofluidQuantities.Force โ€” Method
Force(x::Unitful.Quantity)

Create an instance of a Force type dimensional physical quantity, with unit-ed value equal to x. Converts to units N.

source
ThermofluidQuantities.ForcePerDepth โ€” Method
ForcePerDepth(x::Unitful.Quantity)

Create an instance of a ForcePerDepth type dimensional physical quantity, with unit-ed value equal to x. Converts to units N m^-1.

source
ThermofluidQuantities.FrictionFactor โ€” Method
FrictionFactor(Re::ReynoldsNumber,ฯตD::RoughnessRatio)

Return the Darcy friction factor for a pipe flow with the given Reynolds number and roughness ratio. The function chooses the laminar formula (f = 64/Re) if Reynolds number is smaller than 2100 and uses the Colebrook equation if Reynolds number is larger than 4000. For transitional Reynolds numbers it uses the laminar formula, but warns the user.

source
ThermofluidQuantities.GasConstant โ€” Method
GasConstant(x::Unitful.Quantity)

Create an instance of a GasConstant type dimensional physical quantity, with unit-ed value equal to x. Converts to units J kg^-1 K^-1.

source
ThermofluidQuantities.GaugePressure โ€” Method
GaugePressure(x::Unitful.Quantity)

Create an instance of a GaugePressure type dimensional physical quantity, with unit-ed value equal to x. Converts to units Pa.

source
ThermofluidQuantities.Gravity โ€” Method
Gravity(x::Unitful.Quantity)

Create an instance of a Gravity type dimensional physical quantity, with unit-ed value equal to x. Converts to units m s^-2.

source
ThermofluidQuantities.Head โ€” Method
Head(x::Unitful.Quantity)

Create an instance of a Head type dimensional physical quantity, with unit-ed value equal to x. Converts to units m.

source
ThermofluidQuantities.HeatFlux โ€” Method
HeatFlux(x::Unitful.Quantity)

Create an instance of a HeatFlux type dimensional physical quantity, with unit-ed value equal to x. Converts to units J kg^-1.

source
ThermofluidQuantities.Height โ€” Method
Height(x::Unitful.Quantity)

Create an instance of a Height type dimensional physical quantity, with unit-ed value equal to x. Converts to units m.

source
ThermofluidQuantities.InternalEnergy โ€” Method
InternalEnergy(x::Unitful.Quantity)

Create an instance of a InternalEnergy type dimensional physical quantity, with unit-ed value equal to x. Converts to units J kg^-1.

source
ThermofluidQuantities.KinematicViscosity โ€” Method
KinematicViscosity(x::Unitful.Quantity)

Create an instance of a KinematicViscosity type dimensional physical quantity, with unit-ed value equal to x. Converts to units m^2 s^-1.

source
ThermofluidQuantities.Length โ€” Method
Length(x::Unitful.Quantity)

Create an instance of a Length type dimensional physical quantity, with unit-ed value equal to x. Converts to units m.

source
ThermofluidQuantities.MassFlowRate โ€” Method
MassFlowRate(x::Unitful.Quantity)

Create an instance of a MassFlowRate type dimensional physical quantity, with unit-ed value equal to x. Converts to units kg s^-1.

source
ThermofluidQuantities.Moment โ€” Method
Moment(x::Unitful.Quantity)

Create an instance of a Moment type dimensional physical quantity, with unit-ed value equal to x. Converts to units m N.

source
ThermofluidQuantities.Pressure โ€” Method
Pressure(x::Unitful.Quantity)

Create an instance of a Pressure type dimensional physical quantity, with unit-ed value equal to x. Converts to units Pa.

source
ThermofluidQuantities.PressureDifference โ€” Method
PressureDifference(x::Unitful.Quantity)

Create an instance of a PressureDifference type dimensional physical quantity, with unit-ed value equal to x. Converts to units Pa.

source
ThermofluidQuantities.RoughnessHeight โ€” Method
RoughnessHeight(x::Unitful.Quantity)

Create an instance of a RoughnessHeight type dimensional physical quantity, with unit-ed value equal to x. Converts to units m.

source
ThermofluidQuantities.SoundSpeed โ€” Method
SoundSpeed(x::Unitful.Quantity)

Create an instance of a SoundSpeed type dimensional physical quantity, with unit-ed value equal to x. Converts to units m s^-1.

source
ThermofluidQuantities.SpecificHeatPressure โ€” Method
SpecificHeatPressure(x::Unitful.Quantity)

Create an instance of a SpecificHeatPressure type dimensional physical quantity, with unit-ed value equal to x. Converts to units J kg^-1 K^-1.

source
ThermofluidQuantities.SpecificHeatVolume โ€” Method
SpecificHeatVolume(x::Unitful.Quantity)

Create an instance of a SpecificHeatVolume type dimensional physical quantity, with unit-ed value equal to x. Converts to units J kg^-1 K^-1.

source
ThermofluidQuantities.SpecificWeight โ€” Method
SpecificWeight(x::Unitful.Quantity)

Create an instance of a SpecificWeight type dimensional physical quantity, with unit-ed value equal to x. Converts to units N m^-3.

source
ThermofluidQuantities.StagnationDensity โ€” Method
StagnationDensity(x::Unitful.Quantity)

Create an instance of a StagnationDensity type dimensional physical quantity, with unit-ed value equal to x. Converts to units kg m^-3.

source
ThermofluidQuantities.StagnationEnthalpy โ€” Method
StagnationEnthalpy(x::Unitful.Quantity)

Create an instance of a StagnationEnthalpy type dimensional physical quantity, with unit-ed value equal to x. Converts to units J kg^-1.

source
ThermofluidQuantities.StagnationPressure โ€” Method
StagnationPressure(x::Unitful.Quantity)

Create an instance of a StagnationPressure type dimensional physical quantity, with unit-ed value equal to x. Converts to units Pa.

source
ThermofluidQuantities.StagnationSoundSpeed โ€” Method
StagnationSoundSpeed(x::Unitful.Quantity)

Create an instance of a StagnationSoundSpeed type dimensional physical quantity, with unit-ed value equal to x. Converts to units m s^-1.

source
ThermofluidQuantities.SurfaceTension โ€” Method
SurfaceTension(x::Unitful.Quantity)

Create an instance of a SurfaceTension type dimensional physical quantity, with unit-ed value equal to x. Converts to units N m^-1.

source
ThermofluidQuantities.Temperature โ€” Method
Temperature(x::Unitful.Quantity)

Create an instance of a Temperature type dimensional physical quantity, with unit-ed value equal to x. Converts to units K.

source
ThermofluidQuantities.Time โ€” Method
Time(x::Unitful.Quantity)

Create an instance of a Time type dimensional physical quantity, with unit-ed value equal to x. Converts to units s.

source
ThermofluidQuantities.UVelocity โ€” Method
UVelocity(x::Unitful.Quantity)

Create an instance of a UVelocity type dimensional physical quantity, with unit-ed value equal to x. Converts to units m s^-1.

source
ThermofluidQuantities.VVelocity โ€” Method
VVelocity(x::Unitful.Quantity)

Create an instance of a VVelocity type dimensional physical quantity, with unit-ed value equal to x. Converts to units m s^-1.

source
ThermofluidQuantities.VaporPressure โ€” Method
VaporPressure(x::Unitful.Quantity)

Create an instance of a VaporPressure type dimensional physical quantity, with unit-ed value equal to x. Converts to units Pa.

source
ThermofluidQuantities.Velocity โ€” Method
Velocity(x::Unitful.Quantity)

Create an instance of a Velocity type dimensional physical quantity, with unit-ed value equal to x. Converts to units m s^-1.

source
ThermofluidQuantities.Viscosity โ€” Method
Viscosity(x::Real)

Create an instance of a Viscosity type dimensional physical quantity, with value equal to x and units kg m^-1 s^-1.

source
ThermofluidQuantities.Viscosity โ€” Method
Viscosity(x::Unitful.Quantity)

Create an instance of a Viscosity type dimensional physical quantity, with unit-ed value equal to x. Converts to units kg m^-1 s^-1.

source
ThermofluidQuantities.Volume โ€” Method
Volume(x::Unitful.Quantity)

Create an instance of a Volume type dimensional physical quantity, with unit-ed value equal to x. Converts to units m^3.

source
ThermofluidQuantities.VolumeFlowRate โ€” Method
VolumeFlowRate(x::Unitful.Quantity)

Create an instance of a VolumeFlowRate type dimensional physical quantity, with unit-ed value equal to x. Converts to units m^3 s^-1.

source
ThermofluidQuantities.WVelocity โ€” Method
WVelocity(x::Unitful.Quantity)

Create an instance of a WVelocity type dimensional physical quantity, with unit-ed value equal to x. Converts to units m s^-1.

source

Functions

ThermofluidQuantities.value โ€” Method
value(a::PhysicalQuantity,units::Unitful.Units)

Return the numerical value of a, converted to units units. The form of units must be of Unitful form, e.g. u"Pa" and must be dimensionally compatible with a

source
Unitful.unit โ€” Method
unit(a::PhysicalQuantity)

Return the units of quantity a. Extends unit operation in Unitful.

source
Unitful.ustrip โ€” Method
ustrip(a::PhysicalQuantity,units::Unitful.Units)

Return the numerical value of a, converted to units units, and stripped of its units. The form of units must be of Unitful form, e.g. u"Pa" and must be dimensionally compatible with a.

source
Unitful.ustrip โ€” Method
ustrip(a::PhysicalQuantity)

Return the numerical value of a, stripped of its units.

source

Macros

ThermofluidQuantities.@dimvar โ€” Macro
@dimvar name utype

Define a dimensional variable type of the given name, with units of type utype. The utype is of the form created with the @displayedunits macro. A list of such types can be found in ThermofluidQuantities.unittypes.

Examples

julia> import ThermofluidQuantities: ๐“

julia> @displayedunits MyTimeType "s" ๐“

julia> @dimvar MyTimeVar MyTimeType

julia> MyTimeVar(5)
MyTimeVar = 5.0 s
source
ThermofluidQuantities.@displayedunits โ€” Macro
@displayedunits name unit dims

Set the preferred units for displaying quantities and create function displayedunits for returning these units and ushow for converting quantities into these units. The new unit type is specified with name, the default units with unit, and the dimensions with dims. The latter use the Unitful dimension names, ๐Œ, ๐“, ๐‹, ๐šฏ, in combinations

Examples

julia> import ThermofluidQuantities: ๐‹, ๐“

julia> @displayedunits MyVelocityType "m/s" ๐‹/๐“

julia> MyVelocityType
Union{Unitful.Quantity{T,๐‹ ๐“โปยน,U}, Unitful.Level{L,S,Unitful.Quantity{T,๐‹ ๐“โปยน,U}} where S where L} where U where T
source
ThermofluidQuantities.@gas โ€” Macro
@gas name temp visc gamma mmass

Create a gas of the specified name, with viscosity visc and ratio of specific heats gamma at reference temperature temp, and molar mass mmass. Each of these must be provided with units if they are not the default.

Example

julia> @gas MyO2 20u"ยฐC" 2.04e-5 1.395 31.999u"g/mol"

julia> MyO2
Perfect gas with
   Density = 1.330236729981785 kg mโปยณ
   Viscosity = 2.04e-5 kg mโปยน sโปยน
   Specific heat ratio = 1.395
   Gas constant = 259.83507666343445 J kgโปยน Kโปยน
   cp = 917.645397330357 J kgโปยน Kโปยน
   cv = 657.8103206669226 J kgโปยน Kโปยน
   at reference temp 293.15 K
source
ThermofluidQuantities.@liquid โ€” Macro
@liquid name temp dens visc surftens pv Ev

Create a liquid of the specified name, with viscosity visc, surface tension surftens, vapor pressure pv, and bulk modulus Ev at reference temperature temp. Each of these must be provided with units if they are not the default.

Example

julia> @liquid MyWater 15u"ยฐC" 999 1.13e-3 7.34e-2 1.77e3 2.15e9

julia> MyWater
Liquid with
   Density = 999.0 kg mโปยณ
   Viscosity = 0.00113 kg mโปยน sโปยน
   Kinematic viscosity = 1.131131131131131e-6 mยฒ sโปยน
   Specific weight = 9796.84335 N mโปยณ
   Surface tension = 0.0734 N mโปยน
   Bulk modulus = 2.15e9 Pa
   Vapor pressure = 1770.0 Pa
   at reference temp 288.15 K
source
ThermofluidQuantities.@nondimvar โ€” Macro
@nondimvar name

Define a non-dimensional variable type of the given name.

Examples

julia> @nondimvar MyNondimVar

julia> MyNondimVar(100)
MyNondimVar = 100.0
source

Index