Changes between Version 4 and Version 5 of CompScales


Ignore:
Timestamp:
12/30/20 22:42:58 (4 years ago)
Author:
Jonathan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • CompScales

    v4 v5  
    11= Computation Scales =
     2
     3== Units in Astrobear ==
     4
     5Astrobear can use arbitrary computational units for length, mass, time, etc...  These are derived from specifying 4 of the following in physics.data
     6
     7* nScale - Number density
     8* rScale - Mass density
     9* !TempScale - Inverse Gas constant $\frac{\rho T}{P}$
     10* pScale - Pressure
     11* !TimeScale - Time
     12* lScale - Length
     13* Xmu - Mean atomic mass (in amu)
     14
     15The 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.
     16
     17
     18=== Electromagnetism ===
     19
     20For electromagnetic units, Astrobear uses something like rationalized electromagnetic units (extra factor of $\sqrt{4 \pi}$ in the electric and magnetic fields) - or Lorentz-Heaviside but scaling the $E$ field by $c$ and the charge density $\rho$ (and current $J$ ) by $\frac{1}{c}$. This avoids the need for any additional multiplication by factors of $c$.
     21
     22|| Computational || Lorentz-Heaviside || Gaussian ||
     23|| $E$ ||  $c E^{LH}$ ||  $\frac{c }{\sqrt{4\pi}}E^{G}$ ||
     24|| $\rho$ || $\frac{1}{c}\rho^{LH}$ || $ \frac{\sqrt{4 \pi} }{c}\rho^{G}$ ||
     25|| $J$ || $\frac{1}{c} J^{LH}$ || $\frac{\sqrt{4 \pi}}{c} J^{G}$ ||
     26|| $B$ || $ B^{LH} $ || $ \frac{1}{\sqrt{4\pi}} B^{G}$ ||
     27
     28Using the approach in the appendix of Jackson, we have
     29|| $k_1 = \frac{c^2}{4 \pi} $ ||
     30|| $k_2 = \frac{1}{4\pi}$ ||
     31|| $k_3 = 1$ ||
     32|| $\alpha = 1$ ||
     33|| $\mu_0 = 1$ ||
     34|| $\epsilon_0 = \frac{1}{c^2}$ ||
     35This allows us to write Maxwell's equations as
     36
     37|| $\nabla \cdot \mathbf{E} = c^2 \rho$ ||
     38|| $\nabla \times \mathbf{B} = \mathbf{J} + \frac{1}{c^2} \frac{\partial \mathbf{E}}{\partial t}$ ||
     39|| $\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}$ ||
     40|| $\nabla \cdot \mathbf{B} = 0$ ||
     41
     42as well as
     43|| Lorentz Force Law || $\mathbf{F} = q \left ( \mathbf{E} + \mathbf{v} \times \mathbf{B} \right)$ ||
     44|| Coulomb's Law || $\mathbf{F} = -\frac{c^2}{4 \pi} \frac{q_1 q_2}{r^2}\hat{\mathbf{r}}$ ||
     45
     46
     47
     48
     49
     50
     51
     52
    253
    354In general the computational scales you set in physics.data are not that important and should not effect the simulation at all (unless you're scaled values are below 1e-300 or greater than 1e300 in which case double precision values will have under/over flow issues) - however careful choices can help in understanding the results...  For example if nScale is chosen to be the ambient density and lScale is chosen to be the box size and tScale is chosen to be the runtime - then ScaleGrav immediately tells you how important gravity is etc...  From a theoretical point of view it is often convenient to scale density, length, and time to physically motivated values (ie jeans length, mean density, free-fall time) etc... since it is convenient to think about values in these units.  From an observational point of view, however, it is often convenient to use an nScale of 1, a TempScale of 1 and an lScale of either 1pc ~ 3e19 cm or 1AU ~ 1.5e18 cm depending on the problem.  You could also use a rhoScale of 1, a pScale of 1, and an lScale of 1 if you wanted your data files to be in cgs units.  For more help on working with computational scales see SimulSetup