// This contains some routines to test the StandardAtmosphere class, contained
// in the file StandardAtmosphere.frink .
use StandardAtmosphere.frink
defaultAlt = "0 feet"
alt = eval[input["Enter geometric altitude [$defaultAlt]: ", defaultAlt]]
[t,p] = StandardAtmosphere.getTemperatureAndPressure[alt]
println["Temperature is: " + format[t, "K", 3]]
println["Pressure is: " + (p -> "millibars")]
density = StandardAtmosphere.getDensity[alt, t, p]
println["Density is: $density"]
molarMass = StandardAtmosphere.getMolarMass[alt]
println["Molar mass is: $molarMass"]
moleVolume = StandardAtmosphere.getMoleVolume[alt, t, p]
println["Mole volume is: $moleVolume"]
numberDensity = StandardAtmosphere.getNumberDensity[alt, t, p]
println["Number density is: $numberDensity"]
meanSpeed = StandardAtmosphere.getMeanAirParticleSpeed[alt, t, p]
println["Mean air particle speed is: $meanSpeed"]
meanPath = StandardAtmosphere.getMeanFreePath[alt, t, p]
println["Mean free path is: $meanPath"]
meanCollisionFrequency = StandardAtmosphere.getMeanCollisionFrequency[alt, t, p]
println["Mean collision frequency is: $meanCollisionFrequency"]
speedOfSound = StandardAtmosphere.getSpeedOfSound[alt, t, p]
println["Speed of sound is: $speedOfSound"]
dynamicViscosity = StandardAtmosphere.getDynamicViscosity[alt, t, p]
println["Dynamic viscosity is: $dynamicViscosity"]
kinematicViscosity = StandardAtmosphere.getKinematicViscosity[alt, t, p]
println["Kinematic viscosity is: $kinematicViscosity"]
View or download StandardAtmosphereTest.frink in plain text format
This is a program written in the programming language Frink.
For more information, view the Frink
Documentation or see More Sample Frink Programs.
Alan Eliasen was born 14705 days, 20 hours, 10 minutes ago.