[FLASH-USERS] Bug in hy_uhd_getFaceFlux

Dongwook Lee dongwook at flash.uchicago.edu
Fri Feb 4 16:51:51 EST 2011


Hi James again,

After looking at the code, I agree with you that the two averages do look
weird and they
break the symmetry. The same non-symmetry issues are found in the ABAR and
ZBAR
calculations too. They all should be corrected as you suggested in your
email, that is,

for the left state:
eosData(TEMP_VAR) = U(TEMP_VAR,i-1,j,k)
eosMf = U(SPECIES_BEGIN:SPECIES_END,i-1,j,k)

and for the right state:
eosData(TEMP_VAR) = U(TEMP_VAR,i,j,k)
eosMf = U(SPECIES_BEGIN:SPECIES_END,i,j,k),

also the similar is true for the ABAR and ZBAR.

As a default, EOSforRiemann is always false, so you probably did not use the
lines of code in your simulation.

Regarding to the Roe average, I think it is an open question to tell which
one
is indeed correct. You can implement Roe averages for both hydro and MHD,
but in my experience, I haven't seen any strong evidence that the Roe
average
in fact improves the results, compared to a simple average.

Best regards,
Dongwook


On Fri, Feb 4, 2011 at 2:11 PM, James Guillochon <jfg at ucolick.org> wrote:

> I realized after making the initial post that the values assigned to the
> temperature before the Eos call is incorrect as well, it is using the
> average temperature of two adjacent cells, but this average is biased to the
> right, making the results non-symmetric.
>
> So, the temperature and composition lines should look like this for the
> left states:
> eosData(TEMP_VAR) = U(TEMP_VAR,i-1,j,k)
> eosMf = U(SPECIES_BEGIN:SPECIES_END,i-1,j,k)
>
> ...and like this for the right states:
> eosData(TEMP_VAR) = U(TEMP_VAR,i,j,k)
> eosMf = U(SPECIES_BEGIN:SPECIES_END,i,j,k)
>
> I'm not sure about when the EOSforReimann flag is disabled though...I have
> yet to find any bugs in the code outside of that "if" statement. One thing
> that is a little odd is how the average state in the Roe solver is
> calculated: It's just the mean of the left and right states, whereas I would
> think it should be a "Roe" average (i.e. Glaister 1988).
>
> --
> James Guillochon
> Department of Astronomy & Astrophysics
> University of California, Santa Cruz
> jfg at ucolick.org
>
> On Feb 4, 2011, at 10:36 AM, Latif wrote:
>
> > Hi James,
> > I also noticed that  without explicitly making  EOSforRiemann = .true.
>  temperature calculations were going crazy as i was also using multi
> species.  I think  it is  another solution to  bug  you mentioned but  it is
> costly  to make calls to EOS wrappers (as mentioned in users guide). Am i
> right? I did not know the cause  before it is good that you mentioned.
> > Cheers
> > Latif
> >> Hi,
> >>
> >> There is a bug in hy_uhd_getFaceFlux relating to the "EOSforRiemann"
> flag. There is a variable eosMf that defaults to 1.0 and is never set
> afterwards, when it should be set to the cell averages. This means that as
> soon as there is any mixing this routine is not using the correct mass
> fractions when calling the equation of state.
> >>
> >> The fix is easy, simply put this line above all 6 Eos calls (2 for each
> direction), replacing the indices with the appropriate ones that match that
> particular location in the code:
> >> eosMf = 0.5*(U(SPECIES_BEGIN:SPECIES_END,i,j,k) +
> U(SPECIES_BEGIN:SPECIES_END,i,j,k+1))
> >>
> >> Regards,
> >> - James
> >>
> >> --
> >> James Guillochon
> >> Department of Astronomy & Astrophysics
> >> University of California, Santa Cruz
> >> jfg at ucolick.org <mailto:jfg at ucolick.org>
> >>
> >
> >
> > !DSPAM:10135,4d4c47351541165001977!
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20110204/413b0156/attachment.htm>


More information about the flash-users mailing list