28 | | Using 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}$ || |
35 | | This allows us to write Maxwell's equations as |
| 33 | * eDotScale [erg/cm^3^/s]^-1^ (For heating terms) |
| 34 | * !ScaleCool [erg cm^3^/s]^-1^ (For cooling functions) |
| 35 | * !ChemScale [1 / s]^-1^ (For reaction rates) |
42 | | as 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}}$ || |
| 38 | And there are also a few physical constants that have been converted into computational units |
| 39 | * ScaleC - Speed of light |
| 40 | * !ScaleRad - Radiation constant |
| 41 | * !ScaleGrav - Gravitational constant |
| 42 | |
| 43 | |
| 44 | == Choosing scales == |
| 45 | 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...). |
| 46 | |
| 47 | While from an experimental/observational approach, using real units (like centimeter, gram, second) may be preferred. Keep in mind that if you set |
| 48 | * lScale=1 |
| 49 | * !TimeScale=1 |
| 50 | * nScale=1 |
| 51 | * rScale=1 |
| 52 | 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 $\sqrt{4\pi}$ for the magnetic fields compared to the Gaussian system). |
| 53 | |
| 54 | |
| 55 | For more help on working with computational scales see SimulSetup |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
54 | | In 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 |
55 | | |
56 | | Astrophysical problems involve many different physical units and constants with a wide range of scales. To avoid the loss of precision that comes when computers try to work with, say, a 10^-8^ variable and a 10^24^ constant in the same expression, we scale our units into ''computational units'' before storing them in the data arrays. |
57 | | |
58 | | Usually, the physical scales are defined in the [PhysicsDataExplained physics.data] file--you simply enter the scales for density, temperature, velocity, etc in that file, and AstroBEAR will read them in. More complicated scaling would be defined in the {{{ProblemModuleInit()}}} routine (see above). |
59 | | |
60 | | You have two options for making sure that you only put scaled quantities in the data arrays: you can scale your input values before you enter them into your input file (and then assume that you are reading in scaled quantities), or you can use physical quantities in your input files and then scale them within your problem module |
61 | | |