Changes between Version 5 and Version 6 of CompScales


Ignore:
Timestamp:
12/30/20 23:09:09 (4 years ago)
Author:
Jonathan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • CompScales

    v5 v6  
    1515The 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.
    1616
     17When 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.
    1718
    18 === Electromagnetism ===
     19* !TimeScale [s]
     20* lScale [cm]
     21* mScale [g]
     22* rScale [g/cm^3^]
     23* !VelScale [cm/s]
     24* pScale [erg/cm^3^]
     25* nScale [cm^-3^]
     26* BScale [Gauss]
     27* !TempScale [Kelvin] $T_p = \frac{P_c}{\rho_c} \times \mbox{TempScale}$
    1928
    20 For 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$.
     29You should also use these scales in your problem module to convert any physical unit inputs into computational units as needed.
    2130
    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}$ ||
     31There are also several other scales listed that are generally used for converting source terms from physical units (cgs) into computational units
    2732
    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)
    3636
    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$ ||
    4137
    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}}$ ||
     38And 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 ==
     45From 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
     47While 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
     52then 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
     55For more help on working with computational scales see SimulSetup
    4556
    4657
    4758
    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 
    6259[[BackLinks]]