golfball package¶
Submodules¶
golfball.analysis module¶
golfball.sim module¶
3D Golf Ball demo simulation with varying Drag Crisis and Magus Effect.
- class golfball.sim.Sim(args=None)[source]¶
Bases:
object
The primary simulation object.
- read_inputs(filename)[source]¶
Read inputs YAML file.
- Parameters:
filename (type) – Input YAML file.
- Raises:
FileNotFoundError : – Raised if the specified file is not present.
- golfball.sim.calc_drag_coeff(height, vel_mag, l_ref, rho, dimple_size)[source]¶
Calcualte the Coefficient of Drag (Cd).
Calculate Cd as a function of height, velocity magnitude, reference length, and density. Note: this assumes a Temperature profile from the US Standard ATM, and uses CD
golfball.stdAtm76 module¶
Module for querying the 1976 US Standard Atmosphere.
- golfball.stdAtm76.getDynViscosity(T)[source]¶
Return the dynamic viscosity in Pascal-Seconds.
of a air (80% N2 20% 02)
at a specified temperature in Kelvin.
Inputs¶
- T: int or float (in degrees K)
specified temperature
- returns:
Dynamnic viscosity
- rtype:
float (in Pa*s)
- golfball.stdAtm76.getGeopotential(altitude, units='km', earth_radius=6356.766)[source]¶
Return the geopotential altitude in the units specified.
Current units supported are ‘m’ and ‘km’
geopot_height = earth_radius * altitude / (earth_radius + altitude)
computations done in km.
- golfball.stdAtm76.getReynoldsNumber(velocity, rho, l_ref, temp)[source]¶
Compute the reynolds number (unitless).
Inputs¶
velocity: fluid-relative velocity rho: fluid density [kg/m^3] l_ref: reference length [meters] temp: fluid temperature [Kelvin]
- golfball.stdAtm76.getSpeedOfSound(altitude=0.0, units='km')[source]¶
Calculate the speed of sound.
Assumes units are ‘km’, unless otherwise specified in ‘m’.
- golfball.stdAtm76.getStandardDensity(altitude=0.0, units='km')[source]¶
Get the Standard Density given an altitude.
Returns density as a function of altitude from the Standard Pressure and Standard Temperature using the Ideal Gas Law
- golfball.stdAtm76.getStandardPressure(altitude=0.0, units='km')[source]¶
Get the standard Pressure given an altitude.
Below 51 km: Practical Meteorology by Roland Stull, pg 12 Above 51 km: http://www.braeunig.us/space/atmmodel.htm
Validation data: https://www.avs.org/AVS/files/c7/c7edaedb-95b2-438f-adfb-36de54f87b9e.pdf
- golfball.stdAtm76.getStandardTemperature(geopot_height=0.0)[source]¶
Get the Standard Temparature from a given Geopotential Height.
Standard atmospheric temperature, in kelvins (273.15 + Celsius) Below 51 km: Practical Meteorology by Roland Stull, pg 12 Above 51 km: http://www.braeunig.us/space/atmmodel.htm
Module contents¶
golfball is a Simple 2D Golf Ball Trajectory Simulation in Python.
- class golfball.Sim(args=None)[source]¶
Bases:
object
The primary simulation object.
- read_inputs(filename)[source]¶
Read inputs YAML file.
- Parameters:
filename (type) – Input YAML file.
- Raises:
FileNotFoundError : – Raised if the specified file is not present.