[FLASH-USERS] What data is stored in ENER_VAR in MHD simulations?
Joshua Wall
joshua.e.wall at gmail.com
Thu Oct 19 11:53:07 EDT 2017
Hello Ernesto,
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:
555 !! Update conserved quantities
556 U0(HY_DENS) = U(DENS_VAR,i,j,k)
!density
557 U0(HY_XMOM:HY_ZMOM) =
U(VELX_VAR:VELZ_VAR,i,j,k)*U(DENS_VAR,i,j,k) !momenta
*558 U0(HY_ENER) = U(DENS_VAR,i,j,k)*U(ENER_VAR,i,j,k)
!total gas energy *
*559 #if defined(FLASH_USM_MHD) *
560 U0(HY_MAGX:HY_MAGZ) = U(MAGX_VAR:MAGZ_VAR,i,j,k)
!magnetic fields
*561 U0(HY_ENER) =
U0(HY_ENER)+0.5*dot_product(U(MAGX_VAR:MAGZ_VAR,i,j,k),&*
*562
U(MAGX_VAR:MAGZ_VAR,i,j,k))!total plasma energy*
563 #endif
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.
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).
Cordially,
Josh
On Wed, Oct 18, 2017 at 10:44 AM Dominik Derigs <derigs at ph1.uni-koeln.de>
wrote:
> Dear Ernesto,
>
> Check the file source/IO/IOMain/IO_writeIntegralQuantities.F90:
>
> Here you see that ENER does only contain the magnetic field energy if the
> variable MAGP_VAR is defined.
>
> #ifdef ENER_VAR
> lsum(5) = lsum(5) + solnData(ENER_VAR,i,j,k) * &
> &
> solnData(DENS_VAR,i,j,k)*dvol
> #ifdef MAGP_VAR
> ! total plasma energy
> !!$ lsum(5) = lsum(5) + (solnData(ENER_VAR,i,j,k) * &
> !!$ & solnData(DENS_VAR,i,j,k) +
> solnData(MAGP_VAR,i,j,k))*dvol
>
> lsum(5) = lsum(5) + solnData(MAGP_VAR,i,j,k)*dvol
> #endif
> #endif
>
> should likely be replaced by something like
>
> #ifdef ENER_VAR
> lsum(5) = lsum(5) + solnData(ENER_VAR,i,j,k) * &
> &
> solnData(DENS_VAR,i,j,k)*dvol
> #ifdef MAGX_VAR
> 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
> #endif
> #endif
>
> as there is no need for MAGP_VAR here.
>
> Best regards,
> Dominik
>
> On 18.10.2017 16:34, ERNESTO ZURBRIGGEN wrote:
>
> Hi everybody!
> I'm having a doubt about what data is stored in the UNK specific total
> energy ENER_VAR in MHD simulations.
>
> The flash4.2.2 user's guide equation 14.22 says for the perfect-gas
> equation of state that
> ENER_VAR= 0.5*v + PRES/(DENS*(gamma-1)) + B**2/(2*DENS)
>
> But, the outputs seem to show that
> ENER_VAR= 0.5*v + PRES/(DENS*(gamma-1))
>
> So, I'm confused. Any idea?
>
>
> I'm using flash4.2.2 release in an ideal MHD simulation with 1T
> perfect-gas equation of state.
>
>
> --
> *Ernesto Zurbriggen*
>
> *Instituto de Astronomía Teórica y Experimental (IATE). *
> *Observatorio Astronómico de Córdoba (OAC), **Universidad Nacional de
> Córdoba **(UNC)**. *
> *Teléfono: +54 0351 4331064-5, interno 222. *
> *Laprida 854, Bº Observatorio (CP 5000), Córdoba, Argentina.*
>
>
> --
Joshua Wall
Doctoral Candidate
Department of Physics
Drexel University
3141 Chestnut Street
Philadelphia, PA 19104
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20171019/7e636d09/attachment-0001.htm>
More information about the flash-users
mailing list