[FLASH-USERS] Computing dt for diffusion

Aaron Froese aaron.froese at generalfusion.com
Thu May 5 16:29:32 EDT 2011


Thanks Milad,

As I understand it, the HYPRE library is for the case of non-magnetized ICF, but I am working on MTF compression.  Therefore, I have written my own algorithms to compute Braginskii anisotropic conduction, resistance, and viscosity for the USM MHD solver.  I would like to make them a little more robust by properly calculating dt, but unfortunately they are not compatible with the current diffusion code. 

Aaron
________________________________________
From: icksa1 at gmail.com [icksa1 at gmail.com] On Behalf Of Milad Fatenejad [milad at flash.uchicago.edu]
Sent: Thursday, May 05, 2011 12:49 PM
To: Aaron Froese
Subject: Re: [FLASH-USERS] Computing dt for diffusion

Hi Aaron:

I wanted to mention that FLASH 4.0alpha has an implicit diffusion solver which uses the HYPRE library which may allow you to eliminate the stability constraint. I just wanted to make sure you were aware of it in case it applies to your problem...

Also, there is now electron conduction with the spitzer conductivity in FLASH 4.0alpha

Of course, the time step is still too restrictive and I just turn it off. Using the implicit solver with the normal CFL constraint has been working for me when I use conduction and multigroup radiation in FLASH.

I hope this is useful...
Milad

On Thu, May 5, 2011 at 2:33 PM, Aaron Froese <aaron.froese at generalfusion.com<mailto:aaron.froese at generalfusion.com>> wrote:
Hi all,

I need to write a computeDt routine that can accommodate the Braginskii diffusion rates.  I have found the Diffuse_computeDt subroutine to be inadequate, leaving me manually dropping the CFL to maintain stability in the case of strong diffusion constants or large gradients.  The Diffuse_computeDt subroutine appears to determine the allowable time step using only the maximum diffusivity without checking the gradients of the properties being diffused.  Is it not possible, for example, that in the case of strong temperature gradients the entirety of a cell's thermal energy could be transported to neighbouring cells by even a moderate diffusivity?

It seems inefficient to call all the diffusion routines twice: once to determine the time step and a second time to determine the fluxes.  Would it be reasonable to base the allowable time step on the maximum flux inside the entire domain during the previous step?  Below is some code based on the updateConservedVariable subroutine that I think should give a reasonable time step limit for diffusion.  Any suggestions on how to improve it would be most appreciated.

-----------
dt_check = INF
do k = blkLimits(LOW,KAXIS), blkLimits(HIGH,KAXIS)
  do j = blkLimits(LOW,JAXIS), blkLimits(HIGH,JAXIS)
     do i = blkLimits(LOW,IAXIS), blkLimits(HIGH,IAXIS)
        do var = 1, HY_VARINUM-1
           dt_check = min( dt_check, dx*abs(U(HY_DENS+var)) / abs(xFluxR(HY_DENS_FLUX+var) - xFluxL(HY_DENS_FLUX+var)) )
#if NDIM >= 2
           dt_check = min( dt_check, dy*abs(U(HY_DENS+var)) / abs(yFluxR(HY_DENS_FLUX+var) - yFluxL(HY_DENS_FLUX+var)) )
#if NDIM == 3
           dt_check = min( dt_check, dz*abs(U(HY_DENS+var)) / abs(zFluxR(HY_DENS_FLUX+var) - zFluxL(HY_DENS_FLUX+var)) )
#endif
#endif
        enddo
     enddo
  enddo
enddo
dt_check = dt_check*safety_factor
-----------

Thanks,
Aaron




More information about the flash-users mailing list