[FLASH-USERS] dt_cosmo
John ZuHone
jzuhone at cfa.harvard.edu
Wed Dec 8 15:36:49 EST 2010
Aaron,
Even if your universe is contracting, dt should still be greater than zero (unless you're trying to run the expansion in reverse, which it doesn't sound like you're doing). It would be better to find a consistent way to alter the cosmology routines for your purposes to ensure that dt > 0 even if dadt < 0.
Naively, I would suppose that simply taking the absolute value would suffice, but others can correct me.
Best,
John Z
On Dec 8, 2010, at 3:32 PM, Aaron Froese wrote:
> 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