wiki:CalcGlobalScale

Version 7 (modified by Jonathan, 13 years ago) ( diff )

SUBROUTINE CalcGlobalScale()


Defined In:

contrib/astro/i_setprob.f90


Inputs:

None.


Description:

This is the section of the code where the computational scales are set up. Each scale, whether it be density, length, pressure, etc., defines computational units in terms of physical units. The equations of ideal MHD are scale free, and so the scales are unimportant to the simulation, although they may make it easier to initialize the domain for a particular problem involving physical units. If there is cooling or gravity are any other physical source terms, then the scales become important.

The "true" scales are:

rScaledensity scale
pScalepressure scale
lScalelength scale
VelScalevelocity scale
RunTimeSctime scale
BScaleMagnetic field scale
ScaleGravacceleration scale

In addition there are a few proxies:

EOSConstants - Used to find the physical Temperature: T = EOSConstants*P/rho

nscale - Used to find the physical number density: n = nscale*rho

[Note if nscale were truly a scale then nscale=1/(lscale3)]

ScaleCool - ScaleCool is used to scale the cooling rate Lambda which has units of erg cm3/s = erg/cm3 * cm6/s, so in theory ScaleCool = pScale*lScale6/RunTimeSc. However instead of dividing the physical cooling rate by ScaleCool to get the computational cooling rate, it is easier to multiply by the reciprocal, so ScaleCool is actually the inverse: ScaleCool=RunTimeSc/pscale/lscale6. Since the cooling rate also depends on the physical number density2, we include a factor of nScale2 so that de/dt = rho2*ScaleCool*(Physical Cooling rate). So, ScaleCool=RunTimeSc*nScale2/(pScale*lScale6) = rScale*lScale/((hMass2)*Xmu2*VelScale3))

In general to convert from a quantity in cgs units to computational units you divide by the corresponding scale, and there are only three independent scales. Fundamentally these would be mass length and time, however its usually easier to set the density (or number density) scale, pressure (or temperature) scale, and length scale. In the code, the pressure and density scales are set first. These combine to define a velocity scale, but the three fundamental scales of mass, length, and time are still free. Setting the length scale then determines the time scale and the mass scale. If there were a mass scale it would just be rScale*lScale3. (Again, setting the mass scale to be rScale/nScale would not be right since nScale isn't a true scale.)

To convert computational magnetic field strengths to gauss multiply by sqrt(4*Pi*pScale). See the second page of the attached pdf for the reasoning.

The computational potential Phi is in units of (computational velocity)2. To convert to cgs units just multiply by VelScale2.

Additional information on the scaling parameters may be found in the attached PDF.


Called In:

setprob :: setprob()


Modules Used:

None are brought in by the USE statement, but it assumes that ReadPhysics() has been called.


Files Included:

None.

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.