[FLASH-USERS] [EXT] Re: Help with Z-pinch example.

Hansen, Eddie ehansen at pas.rochester.edu
Fri Apr 21 08:57:05 EDT 2023


Hi Alvaro,

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.

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.

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:
Cartesian x • Cylindrical r
Cartesian y • Cylindrical z
Cartesian z • Cylindrical phi
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.

Hope that info clears up everything!

________________________________
From: Alvaro Sanchez <alvaro.sanchez at greentownsbyfusion.com>
Sent: Friday, April 21, 2023 6:17:53 AM
To: Hansen, Eddie <ehansen at pas.rochester.edu>; flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: [EXT] Re: Help with Z-pinch example.

Again with mistakes, I meant Xl to be axysimmetric, as it is in the template, sorry.
________________________________
From: Alvaro Sanchez <alvaro.sanchez at greentownsbyfusion.com>
Sent: Friday, April 21, 2023 12:17 PM
To: Hansen, Eddie <ehansen at pas.rochester.edu>; flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: Re: Help with Z-pinch example.

Hello Eddie,

first of all, thank you very much for your response.

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.

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?

Again, thank you very very much, have a nice day.
________________________________
From: Hansen, Eddie <ehansen at pas.rochester.edu>
Sent: Wednesday, April 12, 2023 6:38 PM
To: Alvaro Sanchez <alvaro.sanchez at greentownsbyfusion.com>; flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: Re: Help with Z-pinch example.


Hi Alvaro,



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.



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).



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:
diff_magzXrBoundaryType = “circuit”



Hope that answers most of your initial questions.



--

Eddie Hansen

Research Scientist

Flash Center for Computational Science





From: flash-users <flash-users-bounces at flash.rochester.edu> on behalf of Alvaro Sanchez <alvaro.sanchez at greentownsbyfusion.com>
Date: Wednesday, April 12, 2023 at 11:55 AM
To: flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: Re: [FLASH-USERS] Help with Z-pinch example.

"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)"



I said multiplying but I meant dividing, sorry for the mistake.

________________________________

From: Alvaro Sanchez
Sent: Wednesday, April 12, 2023 5:51 PM
To: flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: Help with Z-pinch example.



Hello dear folks from FLASH community, a pleasure to be here.



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 :)



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.



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.

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.



Are we making a mistake calculating the number density?

We've seen, in ../HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_getFaceCurrents.F90





!! Compute electron number density at (i,j,k)

nele_rght = ye * hy_avogrado * U(DENS_VAR,i,j,k)



SO, we are worried about being wrong since the beginning.





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.

Does someone know where in the internal code is this issue coded? or...

Does someone know how it works? Does it goes through the higher density the higher the current density? Or am I completely wrong?



Thank you very very much if you read it, I really appreciate it, so thank you very much.



Any help is always nice, have a good day.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20230421/39d743bb/attachment-0001.htm>


More information about the flash-users mailing list