packages feed

atmos 0.2.0.0 → 0.3.0.0

raw patch · 3 files changed

+93/−6 lines, 3 filesdep +dimensionaldep +dimensional-tfPVP ok

version bump matches the API change (PVP)

Dependencies added: dimensional, dimensional-tf

API changes (from Hackage documentation)

- Atmosphere: atmosDensity :: Atmos a -> a
- Atmosphere: atmosKinematicViscosity :: Atmos a -> a
- Atmosphere: atmosPressure :: Atmos a -> a
- Atmosphere: atmosSpeedOfSound :: Atmos a -> a
- Atmosphere: atmosTemperature :: Atmos a -> a
- Atmosphere: atmosViscosity :: Atmos a -> a
+ Atmosphere: [atmosDensity] :: Atmos a -> a
+ Atmosphere: [atmosKinematicViscosity] :: Atmos a -> a
+ Atmosphere: [atmosPressure] :: Atmos a -> a
+ Atmosphere: [atmosSpeedOfSound] :: Atmos a -> a
+ Atmosphere: [atmosTemperature] :: Atmos a -> a
+ Atmosphere: [atmosViscosity] :: Atmos a -> a
+ Atmosphere.Dimensional: Atmos :: ThermodynamicTemperature a -> Pressure a -> Density a -> Velocity a -> DynamicViscosity a -> KinematicViscosity a -> Atmos a
+ Atmosphere.Dimensional: [atmosDensity] :: Atmos a -> Density a
+ Atmosphere.Dimensional: [atmosKinematicViscosity] :: Atmos a -> KinematicViscosity a
+ Atmosphere.Dimensional: [atmosPressure] :: Atmos a -> Pressure a
+ Atmosphere.Dimensional: [atmosSpeedOfSound] :: Atmos a -> Velocity a
+ Atmosphere.Dimensional: [atmosTemperature] :: Atmos a -> ThermodynamicTemperature a
+ Atmosphere.Dimensional: [atmosViscosity] :: Atmos a -> DynamicViscosity a
+ Atmosphere.Dimensional: altitudeFromPressure :: (Floating a, Ord a) => Pressure a -> Length a
+ Atmosphere.Dimensional: atmosphere :: (Floating a, Ord a) => Length a -> Atmos a
+ Atmosphere.Dimensional: data Atmos a
+ Atmosphere.DimensionalTF: Atmos :: ThermodynamicTemperature a -> Pressure a -> Density a -> Velocity a -> DynamicViscosity a -> KinematicViscosity a -> Atmos a
+ Atmosphere.DimensionalTF: [atmosDensity] :: Atmos a -> Density a
+ Atmosphere.DimensionalTF: [atmosKinematicViscosity] :: Atmos a -> KinematicViscosity a
+ Atmosphere.DimensionalTF: [atmosPressure] :: Atmos a -> Pressure a
+ Atmosphere.DimensionalTF: [atmosSpeedOfSound] :: Atmos a -> Velocity a
+ Atmosphere.DimensionalTF: [atmosTemperature] :: Atmos a -> ThermodynamicTemperature a
+ Atmosphere.DimensionalTF: [atmosViscosity] :: Atmos a -> DynamicViscosity a
+ Atmosphere.DimensionalTF: altitudeFromPressure :: (Floating a, Ord a) => Pressure a -> Length a
+ Atmosphere.DimensionalTF: atmosphere :: (Floating a, Ord a) => Length a -> Atmos a
+ Atmosphere.DimensionalTF: data Atmos a

Files

atmos.cabal view
@@ -1,17 +1,18 @@ name:                atmos-version:             0.2.0.0-synopsis:            1976 US Standard Atmosphere+version:             0.3.0.0+synopsis:            1976 US Standard Atmosphere Model description: {-1976 US Standard Atmosphere+1976 US Standard Atmosphere Model. .-Adapted by Greg Horn from original programs by Ralph L. Carmichael, Public Domain Aeronautical Software+Adapted by Greg Horn from original programs by Ralph L. Carmichael,+Public Domain Aeronautical Software. .-The original code can be found at <http://www.pdas.com/atmos.html>+The original code can be found at <http://www.pdas.com/atmos.html>. } license:             PublicDomain author:              Greg Horn maintainer:          gregmainland@gmail.com-copyright:           (c) Greg Horn 2012-2014+copyright:           (c) Greg Horn 2012-2015 category:            Science build-type:          Simple cabal-version:       >=1.8@@ -19,9 +20,13 @@ library    hs-source-dirs:      src    exposed-modules:     Atmosphere+                        Atmosphere.Dimensional+                        Atmosphere.DimensionalTF    other-modules:       Atmosphere.Constants     build-depends:       base >= 4 && < 5+                       , dimensional >= 1.0.0.0+                       , dimensional-tf >= 0.1.1   test-suite unit-tests
+ src/Atmosphere/Dimensional.hs view
@@ -0,0 +1,41 @@+{-# OPTIONS_GHC -Wall #-}++-- | This is a thin wrapper on top of the atmos package.+-- It provides the exaxt same functions but uses units+-- from the dimensional package.+module Atmosphere.Dimensional+       ( Atmos(..)+       , atmosphere+       , altitudeFromPressure+       ) where++import qualified Atmosphere as A++import qualified Prelude ()+import Numeric.Units.Dimensional.Prelude++data Atmos a = Atmos { atmosTemperature :: ThermodynamicTemperature a+                     , atmosPressure :: Pressure a+                     , atmosDensity :: Density a+                     , atmosSpeedOfSound :: Velocity a+                     , atmosViscosity :: DynamicViscosity a+                     , atmosKinematicViscosity :: KinematicViscosity a+                     }++atmosphere :: (Floating a, Ord a) => Length a -> Atmos a+atmosphere alt = Atmos+                 { atmosTemperature        = temp *~ kelvin+                 , atmosPressure           = pressure *~ pascal+                 , atmosDensity            = density *~ (kilo gram / meter ^ pos3)+                 , atmosSpeedOfSound       = asound *~ (meter / second)+                 , atmosViscosity          = viscosity *~ (newton * second / meter ^ pos2)+                 , atmosKinematicViscosity = kinematicViscosity *~ (meter ^ pos2 / second)+                 }+  where+    A.Atmos temp pressure density asound viscosity kinematicViscosity = A.siAtmosphere (alt /~ meter)++altitudeFromPressure :: (Floating a, Ord a) => Pressure a -> Length a+altitudeFromPressure dimPressure = siAltitude *~ meter+  where+    siAltitude = A.siAltitudeFromPressure siPressure+    siPressure = dimPressure /~ pascal
+ src/Atmosphere/DimensionalTF.hs view
@@ -0,0 +1,41 @@+{-# OPTIONS_GHC -Wall #-}++-- | This is a thin wrapper on top of the atmos package.+-- It provides the exaxt same functions but uses units+-- from the dimensional-tf package.+module Atmosphere.DimensionalTF+       ( Atmos(..)+       , atmosphere+       , altitudeFromPressure+       ) where++import qualified Atmosphere as A++import qualified Prelude ()+import Numeric.Units.Dimensional.TF.Prelude++data Atmos a = Atmos { atmosTemperature :: ThermodynamicTemperature a+                     , atmosPressure :: Pressure a+                     , atmosDensity :: Density a+                     , atmosSpeedOfSound :: Velocity a+                     , atmosViscosity :: DynamicViscosity a+                     , atmosKinematicViscosity :: KinematicViscosity a+                     }++atmosphere :: (Floating a, Ord a) => Length a -> Atmos a+atmosphere alt = Atmos+                 { atmosTemperature        = temp *~ kelvin+                 , atmosPressure           = pressure *~ pascal+                 , atmosDensity            = density *~ (kilo gram / meter ^ pos3)+                 , atmosSpeedOfSound       = asound *~ (meter / second)+                 , atmosViscosity          = viscosity *~ (newton * second / meter ^ pos2)+                 , atmosKinematicViscosity = kinematicViscosity *~ (meter ^ pos2 / second)+                 }+  where+    A.Atmos temp pressure density asound viscosity kinematicViscosity = A.siAtmosphere (alt /~ meter)++altitudeFromPressure :: (Floating a, Ord a) => Pressure a -> Length a+altitudeFromPressure dimPressure = siAltitude *~ meter+  where+    siAltitude = A.siAltitudeFromPressure siPressure+    siPressure = dimPressure /~ pascal