[FLASH-USERS] Total energy in periodic self-gravitating fluids

Daniel Pfenniger Daniel.Pfenniger at obs.unige.ch
Thu Jan 17 06:49:30 EST 2008


Dear John,

zuhone at flash.uchicago.edu wrote:
> Dan,
> 
> 
>      I think that you are correct, it should be the one-half the density
> difference. In wr_integrals the "reference_density" parameter would
> be included by adding the following line to wr_integrals.F90:
> 
> call get_parm_from_context('reference_density', reference_density)
> 
> and by making sure you have the real variable reference_density defined
> somewhere. I recommend putting your own copy of wr_integrals.F90 into your
> setup directory and doing this.


Thanks.  This indeed improves the energy conservation check.
Here are the differences I included in the wr_integrals.F90 file:

---------------------------------------------------------------------------------------
$ diff FLASH2.5/setups/jeans/wr_integrals.F90 FLASH2.5/source/io/wr_integrals.F90
187d186
<       real, save :: reference_density = 0.
212,215d210
<          if (igpot >= 0) then
<               call get_parm_from_context('reference_density', reference_density)
<          endif
<
276,277c271,272
<      &              lsum(8) = lsum(8) + 0.5*(solnData(idens,i,j,k)-reference_density) * &
<      &                          solnData(igpot,i,j,k)*dvol
---
 >      &                 lsum(8) = lsum(8) + 0.5*solnData(idens,i,j,k) * &
 >      &                                  solnData(igpot,i,j,k)*dvol
---------------------------------------------------------------------------------------

Now the indicated total energy in the Jeans test is very well conserved during the
regular phases of evolution, and shows up to when the calculations may be trusted
(despite lowering the Courant condition by an order of magnitude the total
energy may be increased by an order of magnitude when singularities grow).

I will redo the Jeans test in unstable conditions when FLASH 3.0 will become available.

Best regards,

	Dan



More information about the flash-users mailing list