wiki:DataScaling

Version 2 (modified by Brandon Shroyer, 14 years ago) ( diff )

Data Scaling

The wide variety of scales in astrophysical variables is a chronic problem for numerical simulation codes. When variables of widely disparate scales are combined in a machine calculation, the results are vulnerable to truncation error, especially if the order-of-magnitude difference between two values is below machine precision. Handled improperly, these scaling differences can cause massive problems in a simulation.

AstroBEAR handles the problem by dividing a scaling constant out of certain variables. The equations of ideal MHD are scale-free, so the scaling of variables does not change the results of the simulation. This does not hold true if physical source terms such as cooling or gravity are present; during source term steps, physical scaling must be reintroduced.

Scaling in AstroBEAR

Data File Parameters

The most basic physical scaling options are set by the user in the physics.data file:

nScalenumber density scale (cm-3)
rScaledensity scale (g cm-3)
pScalepressure scale (dynes cm-2)
TempScaletemperature scale (K)
lScalelength scale (cm)

AstroBEAR derives other scaling constants such as magnetic pressure and velocity from these basic parameters:

VelScalevelocity scale (cm s-1)
BScalemagnetic field scale (esu)
TimeScaletime scale (s)
ScaleGrav*gravity scale (cm3)
ScaleCool**cooling scale (erg-1 cm3)

*requires elliptic source terms.
**requires cooling source terms.

Calculating the appropriate scales to use is not always a trivial task, especially if the important scale for your problem is a derived one. For instance,

Note: See TracWiki for help on using the wiki.