wiki:CompScales

Version 6 (modified by Jonathan, 4 years ago) ( diff )

Computation Scales

Units in Astrobear

Astrobear can use arbitrary computational units for length, mass, time, etc… These are derived from specifying 4 of the following in physics.data

  • nScale - Number density
  • rScale - Mass density
  • TempScale - Inverse Gas constant
  • pScale - Pressure
  • TimeScale - Time
  • lScale - Length
  • Xmu - Mean atomic mass (in amu)

The 4 specified must be independent. Specifying nScale, rScale and Xmu will result in an error - since there is a single equation linking just those three. Likewise specifying nScale, pScale, and TempScale will result in an error.

When the simulation starts, several other scaling parameters are output in scales.data to make it easy to convert computational values to physical units. These scales are all in cgs units (centimeter, gram, second, gauss, Kelvin). If you multiply computational value by the corresponding scale, you will get the value in physical units.

  • TimeScale [s]
  • lScale [cm]
  • mScale [g]
  • rScale [g/cm3]
  • VelScale [cm/s]
  • pScale [erg/cm3]
  • nScale [cm-3]
  • BScale [Gauss]
  • TempScale [Kelvin]

You should also use these scales in your problem module to convert any physical unit inputs into computational units as needed.

There are also several other scales listed that are generally used for converting source terms from physical units (cgs) into computational units

  • eDotScale [erg/cm3/s]-1 (For heating terms)
  • ScaleCool [erg cm3/s]-1 (For cooling functions)
  • ChemScale [1 / s]-1 (For reaction rates)

And there are also a few physical constants that have been converted into computational units

  • ScaleC - Speed of light
  • ScaleRad - Radiation constant
  • ScaleGrav - Gravitational constant

Choosing scales

From a theoretical approach, you may want to choose scales so that your units fit the natural length and time scales of your particular problem (length in planet radius, time in orbital period, velocity in units of the sound speed etc…).

While from an experimental/observational approach, using real units (like centimeter, gram, second) may be preferred. Keep in mind that if you set

  • lScale=1
  • TimeScale=1
  • nScale=1
  • rScale=1

then the computational scales for mass, momentum, and energy will be in CGS - however, the magnetic field will still need to be scaled by BScale to get a value in Gauss. This is because Astrobear uses rationalized values (with an extra factor of for the magnetic fields compared to the Gaussian system).

For more help on working with computational scales see SimulSetup

BackLinks

Note: See TracWiki for help on using the wiki.