<div dir="ltr">Hello Ernesto,<div><br></div><div> Assuming you're using the unsplit solver, I spent some time back in June attempting to track this down myself. Today, trying to jog my memory, I did a quick grep of the source/physics/Hydro/HydroMain/unsplit folder and found this in hy_uhd_unsplitUpdate.F90:</div><div><br></div><div><div>555 !! Update conserved quantities</div><div>556 U0(HY_DENS) = U(DENS_VAR,i,j,k) !density</div><div>557 U0(HY_XMOM:HY_ZMOM) = U(VELX_VAR:VELZ_VAR,i,j,k)*U(DENS_VAR,i,j,k) !momenta</div><div><b>558 U0(HY_ENER) = U(DENS_VAR,i,j,k)*U(ENER_VAR,i,j,k) !total gas energy </b></div><div><b>559 #if defined(FLASH_USM_MHD) </b></div><div>560 U0(HY_MAGX:HY_MAGZ) = U(MAGX_VAR:MAGZ_VAR,i,j,k) !magnetic fields</div><div><b>561 U0(HY_ENER) = U0(HY_ENER)+0.5*dot_product(U(MAGX_VAR:MAGZ_VAR,i,j,k),&</b></div><div><b>562 U(MAGX_VAR:MAGZ_VAR,i,j,k))!total plasma energy</b></div><div>563 #endif</div></div><div><br></div><div><br></div><div>which indicates (and this is what I recall) that the ENER_VAR does not store the magnetic energy, so here (I think) Dongwook is adding it to his local solutions array before he runs it through the solver. I looked in the file for where this is reversed and didn't find it right away, but if memory serves this is reversed in a different part of the solver.</div><div><br></div><div>If you'd like to confirm for yourself that this is the case, hopefully this gives you a place to start, but in any event I think you are seeing the intended behavior. This could be due to other parts of the code expecting ENER_VAR to only have thermal and kinetic energies (generally modules try not to interfere with each other, even the Hydro modules). </div><div><br></div><div>Cordially,</div><div><br></div><div>Josh</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 18, 2017 at 10:44 AM Dominik Derigs <<a href="mailto:derigs@ph1.uni-koeln.de">derigs@ph1.uni-koeln.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Dear Ernesto,</p>
<p>Check the file source/IO/IOMain/IO_writeIntegralQuantities.F90:</p>
<p>Here you see that ENER does only contain the magnetic field
energy if the variable MAGP_VAR is defined. <br>
</p>
<p>#ifdef ENER_VAR<br>
lsum(5) = lsum(5) + solnData(ENER_VAR,i,j,k) * &
<br>
&
solnData(DENS_VAR,i,j,k)*dvol<br>
#ifdef MAGP_VAR<br>
! total plasma energy<br>
!!$ lsum(5) = lsum(5) + (solnData(ENER_VAR,i,j,k) *
& <br>
!!$ & solnData(DENS_VAR,i,j,k) +
solnData(MAGP_VAR,i,j,k))*dvol<br>
<br>
lsum(5) = lsum(5) + solnData(MAGP_VAR,i,j,k)*dvol<br>
#endif<br>
#endif</p>
<p>should likely be replaced by something like</p>
<p>#ifdef ENER_VAR<br>
lsum(5) = lsum(5) + solnData(ENER_VAR,i,j,k) * &<br>
&
solnData(DENS_VAR,i,j,k)*dvol<br>
#ifdef MAGX_VAR<br>
lsum(5) = lsum(5) +
0.5*(solnData(MAGX_VAR,i,j,k)**2+solnData(MAGY_VAR,i,j,k)**2+solnData(MAGZ_VAR,i,j,k)**2)*dvol<br>
#endif<br>
#endif</p>
<p>as there is no need for MAGP_VAR here.<br>
</p>
<p>Best regards,<br>
Dominik<br>
</p></div><div text="#000000" bgcolor="#FFFFFF">
<br>
<div class="m_5385178940404084207moz-cite-prefix">On 18.10.2017 16:34, ERNESTO ZURBRIGGEN
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi everybody!</div>
<div>I'm having a doubt about what data is stored in the UNK
specific total energy ENER_VAR in MHD simulations. </div>
<div><br>
</div>
<div>The flash4.2.2 user's guide equation 14.22 says for the
perfect-gas equation of state that</div>
<div>ENER_VAR= 0.5*v + PRES/(DENS*(gamma-1)) + B**2/(2*DENS)</div>
<div><br>
</div>
<div>But, the outputs seem to show that</div>
<div>ENER_VAR= 0.5*v + PRES/(DENS*(gamma-1))<br>
</div>
<div><br>
</div>
<div>So, I'm confused. Any idea?</div>
<div><br>
</div>
<div><br>
</div>
<div>I'm using flash4.2.2 release in an ideal MHD simulation
with 1T perfect-gas equation of state. </div>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="m_5385178940404084207gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr"><font face="monospace,
monospace"><i><font color="#000000">Ernesto
Zurbriggen</font></i><i> </i></font>
<div><font face="monospace, monospace"><i><br>
</i></font>
<div><font face="monospace, monospace"><i><font color="#444444">Instituto de
Astronomía Teórica y
Experimental </font><font color="#274e13">(IATE)</font><font color="#444444">. </font></i></font></div>
<div><font face="monospace, monospace"><i><font color="#444444">Observatorio
Astronómico de Córdoba </font><font color="#274e13">(OAC)</font><font color="#444444">, </font></i></font><i style="color:rgb(68,68,68);font-family:monospace,monospace;font-size:12.8px">Universidad
Nacional de Córdoba </i><i style="font-family:monospace,monospace;font-size:12.8px"><font color="#274e13">(UNC)</font></i><i style="color:rgb(68,68,68);font-family:monospace,monospace;font-size:12.8px">. </i></div>
</div>
<div><i style="color:rgb(68,68,68);font-family:monospace,monospace;font-size:12.8px">Teléfono:
+54 0351 4331064-5, interno 222. </i></div>
<div><span style="font-size:12.8px"><i><font color="#444444">Laprida 854, Bº
Observatorio (CP 5000), Córdoba,
Argentina.</font></i></span><font color="#444444"><br>
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</div></blockquote></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div><div><div>Joshua Wall<br></div>Doctoral Candidate<br></div>Department of Physics<br></div>Drexel University<br></div>3141 Chestnut Street<br></div>Philadelphia, PA 19104<br></div></div>