Hi James again,<br><br>After looking at the code, I agree with you that the two averages do look weird and they<br>break the symmetry. The same non-symmetry issues are found in the ABAR and ZBAR<br>calculations too. They all should be corrected as you suggested in your email, that is,<br>
<br>for the left state:<br>eosData(TEMP_VAR) = U(TEMP_VAR,i-1,j,k)<br>
eosMf = U(SPECIES_BEGIN:SPECIES_END,i-1,j,k)<br><br>and for the right state:<br>
eosData(TEMP_VAR) = U(TEMP_VAR,i,j,k)<br>
eosMf = U(SPECIES_BEGIN:SPECIES_END,i,j,k),<br>
<br>also the similar is true for the ABAR and ZBAR.<br><br>As a default, EOSforRiemann is always false, so you probably did not use the<br>lines of code in your simulation.<br><br>Regarding to the Roe average, I think it is an open question to tell which one<br>
is indeed correct. You can implement Roe averages for both hydro and MHD,<br>but in my experience, I haven't seen any strong evidence that the Roe average<br>in fact improves the results, compared to a simple average.<br>
<br>Best regards,<br>Dongwook<br><br><br><div class="gmail_quote">On Fri, Feb 4, 2011 at 2:11 PM, James Guillochon <span dir="ltr"><<a href="mailto:jfg@ucolick.org">jfg@ucolick.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
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.<br>
<br>
So, the temperature and composition lines should look like this for the left states:<br>
eosData(TEMP_VAR) = U(TEMP_VAR,i-1,j,k)<br>
eosMf = U(SPECIES_BEGIN:SPECIES_END,i-1,j,k)<br>
<br>
...and like this for the right states:<br>
eosData(TEMP_VAR) = U(TEMP_VAR,i,j,k)<br>
eosMf = U(SPECIES_BEGIN:SPECIES_END,i,j,k)<br>
<br>
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).<br>
<br>
--<br>
<div class="im">James Guillochon<br>
Department of Astronomy & Astrophysics<br>
University of California, Santa Cruz<br>
<a href="mailto:jfg@ucolick.org">jfg@ucolick.org</a><br>
<br>
</div>On Feb 4, 2011, at 10:36 AM, Latif wrote:<br>
<br>
> Hi James,<br>
> 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.<br>
> Cheers<br>
> Latif<br>
<div><div></div><div class="h5">>> Hi,<br>
>><br>
>> 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.<br>
>><br>
>> 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:<br>
>> eosMf = 0.5*(U(SPECIES_BEGIN:SPECIES_END,i,j,k) + U(SPECIES_BEGIN:SPECIES_END,i,j,k+1))<br>
>><br>
>> Regards,<br>
>> - James<br>
>><br>
>> --<br>
>> James Guillochon<br>
>> Department of Astronomy & Astrophysics<br>
>> University of California, Santa Cruz<br>
</div></div>>> <a href="mailto:jfg@ucolick.org">jfg@ucolick.org</a> <mailto:<a href="mailto:jfg@ucolick.org">jfg@ucolick.org</a>><br>
>><br>
><br>
><br>
> !DSPAM:10135,4d4c47351541165001977!<br>
><br>
</blockquote></div><br>