[FLASH-USERS] dt_cosmo

Aaron Froese aaron.froese at generalfusion.com
Wed Dec 8 15:32:18 EST 2010


If I setup a contracting universe, then the value of dadt becomes negative.

  dadt = (csm_scaleFactor - csm_oldScaleFactor) / dt

This makes dt_cosmo negative, generating an error.  To generalize, dt_cosmo should be calculated as

  if (dadt > 0) then 
     dt_cosmo = csm_maxScaleChange*csm_scaleFactor / dadt
  else if (dadt < 0) then
     dt_cosmo = - r*csm_scaleFactor / dadt
  else 
     dt_cosmo = HUGE

where r is a value between 0 and 1 that prevents the universe from collapsing to a single point in one time step.
Would this method cause other problems in the code?


More information about the flash-users mailing list