<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=utf-8">
<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:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.xxxmsonormal, li.xxxmsonormal, div.xxxmsonormal
{mso-style-name:x_x_x_msonormal;
margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.xxxcontentpasted0
{mso-style-name:x_x_x_contentpasted0;}
span.xxxxcontentpasted0
{mso-style-name:x_x_x_xcontentpasted0;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<div>
<p class="MsoNormal">Hi Alvaro,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">To clarify the interpolation question. For all of the circuit models, you can think of the entire computational domain as a circuit element, and the model is solving for Iload which is the total current running through this element. So
there is no spatial interpolation. The FileInput implementation only needs to do temporal interpolation to find Iload. Then, Bphi is set as an upper-r boundary condition with Ampere’s Law: Bphi = 0.2*Iload / (R * sqrt(4*pi)), where R is the upper-r boundary
radius (cm). There are multiplicative factors in that equation for the units to work out correctly with Iload in Amperes.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is technically not how a current-carrying wire and magnetic field operate in the real world, but if a “vacuum” region is modeled with sufficiently high magnetic resistivity, then the Bphi field will diffuse nearly instantaneously through
the vacuum to the liner. So the result is a B-field profile that does indeed match the physically realistic case.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For the question about coordinates. It can be a little confusing in FLASH, but many parts of the code do not change how the axes are named and/or used. This is the transformation:<o:p></o:p></p>
<p class="MsoNormal">Cartesian x <span style="font-family:Wingdings"></span> Cylindrical r<o:p></o:p></p>
<p class="MsoNormal">Cartesian y <span style="font-family:Wingdings"></span> Cylindrical z<o:p></o:p></p>
<p class="MsoNormal">Cartesian z <span style="font-family:Wingdings"></span> Cylindrical phi<o:p></o:p></p>
<p class="MsoNormal">So when you are setting things like ‘ymin’, ‘yl_boundary_type’, etc., you are setting the cylindrical z axis. The same naming convention is done for vector quantities like velocity and B-field. So when you plot ‘magz’, you are plotting
Bphi, ‘magy’ is Bz, etc.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hope that info clears up everything!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="91%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Alvaro Sanchez <alvaro.sanchez@greentownsbyfusion.com><br>
<b>Sent:</b> Friday, April 21, 2023 6:17:53 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] Re: Help with Z-pinch example.</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">Again with mistakes, I meant Xl to be axysimmetric, as it is in the template, sorry.<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="91%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Alvaro Sanchez <alvaro.sanchez@greentownsbyfusion.com><br>
<b>Sent:</b> Friday, April 21, 2023 12:17 PM<br>
<b>To:</b> Hansen, Eddie <ehansen@pas.rochester.edu>; flash-users@flash.rochester.edu <flash-users@flash.rochester.edu><br>
<b>Subject:</b> Re: Help with Z-pinch example.</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">Hello Eddie,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">first of all, thank you very much for your response.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">The first question is solved, but I'm not sure about the second question, we've been looking into the Circuit.F90, all of them, and we didn't find anything related to spatial
interpolation, but it's ok we have enough for now with this info.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">I have another quick question in case you or someone else know about it, and it is related to boundary conditions in the Z axis. In the template, we find boundary conditions
for X and Y axis, we get that, but we don't really understand which condition should we set for Z. Xr is set to be axysimmetric, which we assume to be rotational simmetry, so we thought Z boundaries would not influence the simulation, but they do in some cases
that we tried. Do you know about this?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">Again, thank you very very much, have a nice day.<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="91%" align="center">
</div>
<div id="x_x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Hansen, Eddie <ehansen@pas.rochester.edu><br>
<b>Sent:</b> Wednesday, April 12, 2023 6:38 PM<br>
<b>To:</b> Alvaro Sanchez <alvaro.sanchez@greentownsbyfusion.com>; flash-users@flash.rochester.edu <flash-users@flash.rochester.edu><br>
<b>Subject:</b> Re: Help with Z-pinch example.</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="xxxmsonormal">Hi Alvaro,</p>
<p class="xxxmsonormal"> </p>
<p class="xxxmsonormal">The ZPinch problem is definitely just an example/template, and most (if not all) users who want to run their own Z-pinch will need to change the densities, dimensions, materials, etc.</p>
<p class="xxxmsonormal"> </p>
<p class="xxxmsonormal">Yes, FLASH is in CGS by default so ‘dens’ is in g/cm^3. To convert this to number density, multiply by Avogadro’s number and divide by the atomic mass of your material (e.g., 1.00784 g/mol for hydrogen). That gives you ion number density.
To calculate electron number density, you would multiply that by the average ionization state (zbar).</p>
<p class="xxxmsonormal"> </p>
<p class="xxxmsonormal">The interpolation of the current input file (when you’re using the FileInput circuit implementation) is done in Circuit.F90. This current is used with Ampere’s Law to set a boundary condition for the azimuthal field on the upper-r boundary.
In the flash.par file, this line enables that BC:<br>
diff_magzXrBoundaryType = “circuit”</p>
<p class="xxxmsonormal"> </p>
<p class="xxxmsonormal">Hope that answers most of your initial questions.</p>
<p class="xxxmsonormal"> </p>
<div>
<div>
<p class="xxxmsonormal"><span style="color:black">--</span></p>
<p class="xxxmsonormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#181A1B">Eddie Hansen</span></p>
<p class="xxxmsonormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#181A1B">Research Scientist</span></p>
<p class="xxxmsonormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#181A1B">Flash Center for Computational Science</span></p>
</div>
</div>
<p class="xxxmsonormal"> </p>
<p class="xxxmsonormal"> </p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="xxxmsonormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">flash-users <flash-users-bounces@flash.rochester.edu> on behalf of Alvaro Sanchez <alvaro.sanchez@greentownsbyfusion.com><br>
<b>Date: </b>Wednesday, April 12, 2023 at 11:55 AM<br>
<b>To: </b>flash-users@flash.rochester.edu <flash-users@flash.rochester.edu><br>
<b>Subject: </b>Re: [FLASH-USERS] Help with Z-pinch example.</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">"<span class="xxxcontentpasted0"><span style="background:white">So, to check densities in our simulation (we removed the liner btw) we compare with these papers by
</span></span></span><span class="xxxcontentpasted0"><span style="font-size:12.0pt;color:#ED5C57;background:white">multiplying</span></span><span class="xxxcontentpasted0"><span style="font-size:12.0pt;color:black;background:white"> the FLASH density in the
Z-pinch example with DD mass in grams (for the fill)"</span></span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">I said multiplying but I meant dividing, sorry for the mistake.</span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="84%" align="center">
</div>
<div id="x_x_x_divRplyFwdMsg">
<p class="xxxmsonormal"><b><span style="color:black">From:</span></b><span style="color:black"> Alvaro Sanchez<br>
<b>Sent:</b> Wednesday, April 12, 2023 5:51 PM<br>
<b>To:</b> flash-users@flash.rochester.edu <flash-users@flash.rochester.edu><br>
<b>Subject:</b> Help with Z-pinch example.</span> </p>
<div>
<p class="xxxmsonormal"> </p>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">Hello dear folks from FLASH community, a pleasure to be here.
</span></p>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">I'm new in FLASH so I still probably have beginner mistakes and questions, but I really need help with a couple of things, so thank you very much in advance :)</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">We are working on a Z-pinch, using the example as a template, so we are trying to understand pretty much everything (or as much as possible) it has.</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">First is a very basic thing, density units. We suppose g/cm^3. The problem we have with the example is the high density of vacuum, even the density of the fill seems
too high for us, as well as the density during the stagnation period. We've been researching and, in almost every seen paper, number density is used.</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">So, to check densities in our simulation (we removed the liner btw) we compare with these papers by multiplying the FLASH density in the Z-pinch example with DD mass
in grams (for the fill). And we get much lower values than those used in BC and simulated in the example (which could make sense, since our Z-pinch is a different one). We are also using lower values as initial conditions because we need, during our stagnation
period, values of 1e17 cm^-3 for dens.</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">Are we making a mistake calculating the number density?</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">We've seen, in ../HydroMain/unsplit/MHD_StaggeredMesh/<b><i>hy_uhd_getFaceCurrents.F90</i></b></span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:aqua;background:blue">!! Compute electron number density at (i,j,k)</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:aqua;background:blue">nele_rght = ye * hy_avogrado * U(DENS_VAR,i,j,k)</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">SO, we are worried about being wrong since the beginning.</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">We found that .F90 in our search of the interpolation of the current from the Circuit source term. We don't understand how FLASH spatially interpolates the input current (we
use the FileInput way) in a 2D cylindrical axisymmetric plane.</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">Does someone know where in the internal code is this issue coded? or...</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">Does someone know how it works? Does it goes through the higher density the higher the current density? Or am I completely wrong?</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black">Thank you very very much if you read it, I really appreciate it, so thank you very much.</span></p>
</div>
<div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
<p class="xxxmsonormal" style="background:white"><span class="xxxxcontentpasted0"><span style="font-size:12.0pt;color:black">Any help is always nice, have a good day.</span></span></p>
</div>
</div>
<p class="xxxmsonormal" style="background:white"><span style="font-size:12.0pt;color:black"> </span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>