[FLASH-USERS] Bug in hy_uhd_getFaceFlux

James Guillochon jfg at ucolick.org
Fri Feb 4 15:11:28 EST 2011


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!
> 




More information about the flash-users mailing list