<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"PingFang TC";
panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
{font-family:"\@PingFang TC";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
{mso-style-name:x_msonormal;
margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Yes, your colleague is correct. The boundary conditions for the implicit solver (Diffuse unit) are separate from the boundary conditions for the explicit solver (Hydro unit).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">In the current release version, the “circuit” BC is just for implicit diffusion and uses Ampere’s Law to set the B-field at the upper-r domain boundary in diff_advanceMag.F90. However, the explicit solver
does not have an analogous “circuit” BC, so you would have to modify the “nocurrent” case in Grid_bcApplyToRegion.F90 (or create your own “user” BC in Grid_bcApplyToRegionSpecialized.F90).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’m attaching a custom version of Grid_bcApplyToRegion.F90 that should work for the “nocurrent” BC. I didn’t test it so there could be bugs, but this is what you want to do for the explicit solver.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Note that this may all change in the next version of FLASh (4.8).
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">--</span><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#181A1B">Eddie Hansen</span><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#181A1B">Applications Group Leader<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#181A1B">Flash Center for Computational Science</span><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">From:
</span></b><span style="color:black">Bowen Zhu (Student at CentraleSupelec) <bowen.zhu@student-cs.fr><br>
<b>Date: </b>Tuesday, March 26, 2024 at 3:55 AM<br>
<b>To: </b>Hansen, Eddie <ehansen@pas.rochester.edu>, flash-users@flash.rochester.edu <flash-users@flash.rochester.edu><br>
<b>Subject: </b>[EXT] </span><span style="font-family:"MS Gothic";color:black">回复</span><span style="color:black">: Switching Magnetic Diffusion Solvers in Zpinch Simulations<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">Hi,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">I hope this message finds you well. I've implemented the settings you recommended, including</span><span style="font-family:Consolas;color:black"> useHydro, updateHydroFluxes</span><span style="color:black">, and
setting </span><span style="font-family:Consolas;color:black">useDiffuseComputeDtMagnetic</span><span style="color:black"> to .true. with
</span><span style="font-family:Consolas;color:black">dt_diff_factor</span><span style="color:black"> set to 1. Despite these adjustments, I'm encountering an issue where no magnetic field is generated by the zPinch current, and the solution appears the same
as when </span><span style="font-family:Consolas;color:black">useMagneticResistivity</span><span style="color:black"> is disabled.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">A colleague with more experience in FLASH suggested that transitioning to an explicit solver might require adjusting the magnetic field's boundary conditions in
</span><span style="font-family:Consolas;color:black">Grid_bcApplyToRegionSpecialized.F90</span><span style="color:black">. Could you confirm if this is the case? If so, could you guide me on the necessary modifications?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">Additionally, if the zPinch simulation operates with an implicit solver, would switching to an explicit solver necessitate changes in files such as
</span><span style="font-family:Consolas;color:black">diff_advanceMag.F90</span><span style="color:black"> or
</span><span style="font-family:Consolas;color:black">MagneticResistivity_fullState.F90</span><span style="color:black">?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">Your expertise and advice would be greatly valued as I navigate this issue. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">Warm regards,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">Bowen ZHU<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="67%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"PingFang TC",sans-serif;color:black">发</span></b><b><span style="font-size:11.0pt;font-family:"MS Gothic";color:black">件人</span></b><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
Hansen, Eddie <ehansen@pas.rochester.edu><br>
</span><b><span style="font-size:11.0pt;font-family:"PingFang TC",sans-serif;color:black">发</span></b><b><span style="font-size:11.0pt;font-family:"MS Gothic";color:black">送</span></b><b><span style="font-size:11.0pt;font-family:"PingFang TC",sans-serif;color:black">时间</span></b><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
2024</span><span style="font-size:11.0pt;font-family:"MS Gothic";color:black">年</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">3</span><span style="font-size:11.0pt;font-family:"MS Gothic";color:black">月</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">25</span><span style="font-size:11.0pt;font-family:"MS Gothic";color:black">日</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
15:29<br>
</span><b><span style="font-size:11.0pt;font-family:"MS Gothic";color:black">收件人</span></b><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
Bowen Zhu (Student at CentraleSupelec) <bowen.zhu@student-cs.fr>; flash-users@flash.rochester.edu <flash-users@flash.rochester.edu><br>
</span><b><span style="font-size:11.0pt;font-family:"MS Gothic";color:black">主</span></b><b><span style="font-size:11.0pt;font-family:"PingFang TC",sans-serif;color:black">题</span></b><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
Re: Switching Magnetic Diffusion Solvers in Zpinch Simulations</span> </p>
<div>
<p class="MsoNormal"> </p>
</div>
</div>
<div>
<div>
<p class="xmsonormal"><span style="font-size:11.0pt">Hi Bowen,</span></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span></p>
<p class="xmsonormal"><span style="font-size:11.0pt">We don’t always include descriptions of unit tests in the guide, because these are intended to test specific parts of the code rather than provide users with example setups. The MagDiff test you mentioned
is a simple Gaussian diffusion of B-field, which has an analytic solution when the diffusivity is constant.</span></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span></p>
<p class="xmsonormal"><span style="font-size:11.0pt">When you switch to the ‘explicit’ solver, you have to keep a couple of things in mind. The explicit solver is in the Hydro unit, so you need useHydro and updateHydroFluxes to be true. You will also need to
be limiting your timestep dt by the magnetic diffusion time, so you need useDiffuseComputeDtMagnetic = .true. and dt_diff_factor should be set to a value <= 1.</span></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span></p>
<div>
<p class="xmsonormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">--</span></p>
<p class="xmsonormal"><span style="font-family:"Arial",sans-serif;color:#181A1B">Eddie Hansen</span></p>
<p class="xmsonormal"><span style="font-family:"Arial",sans-serif;color:#181A1B">Applications Group Leader</span></p>
<p class="xmsonormal"><span style="font-family:"Arial",sans-serif;color:#181A1B">Flash Center for Computational Science</span></p>
</div>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span></p>
<div id="x_mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="xmsonormal" style="margin-bottom:12.0pt"><b><span style="color:black">From:
</span></b><span style="color:black">flash-users <flash-users-bounces@flash.rochester.edu> on behalf of Bowen Zhu (Student at CentraleSupelec) <bowen.zhu@student-cs.fr><br>
<b>Date: </b>Saturday, March 23, 2024 at 3:18 PM<br>
<b>To: </b>flash-users@flash.rochester.edu <flash-users@flash.rochester.edu><br>
<b>Subject: </b>[FLASH-USERS] Switching Magnetic Diffusion Solvers in Zpinch Simulations</span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black">Dear Community,</span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black">I'm currently exploring Z-pinch simulations in FLASH, focusing on comparing the explicit and implicit magnetic diffusion solvers. While I aim to validate computation results and address concerns about potential
bugs in the implicit solver, I've encountered challenges in switching from the implicit to the explicit solver. Changing resistivitySolver from "implicit" to "explicit" doesn't seem to activate the explicit solver effectively; the simulation results mimic
those without applying magnetic resistivity (useMagneticResistivity = .false.), where the plasma remains static.</span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black">As someone new to FLASH, I wonder if there are additional steps required to successfully switch to the explicit solver.</span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black">Furthermore, in my efforts to validate the solvers' differences, I discovered an example under /magnetoHD/unitTest/MagDiff that seems to implement both solvers. However, I found no description of this example
in the user manual or user archives. Could anyone provide insights into the problem this example addresses and any available analytical solutions for reference?</span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black">Your guidance on these matters would be immensely appreciated.</span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black">Bon weekend,</span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black">Best regards,</span></p>
</div>
<div>
<p class="xmsonormal"><span style="color:black">Bowen ZHU</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>