[FLASH-USERS] [EXT] 回复: Switching Magnetic Diffusion Solvers in Zpinch Simulations
Hansen, Eddie
ehansen at pas.rochester.edu
Tue Mar 26 10:16:53 EDT 2024
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).
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).
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.
Note that this may all change in the next version of FLASh (4.8).
--
Eddie Hansen
Applications Group Leader
Flash Center for Computational Science
From: Bowen Zhu (Student at CentraleSupelec) <bowen.zhu at student-cs.fr>
Date: Tuesday, March 26, 2024 at 3:55 AM
To: Hansen, Eddie <ehansen at pas.rochester.edu>, flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: [EXT] 回复: Switching Magnetic Diffusion Solvers in Zpinch Simulations
Hi,
I hope this message finds you well. I've implemented the settings you recommended, including useHydro, updateHydroFluxes, and setting useDiffuseComputeDtMagnetic to .true. with dt_diff_factor 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 useMagneticResistivity is disabled.
A colleague with more experience in FLASH suggested that transitioning to an explicit solver might require adjusting the magnetic field's boundary conditions in Grid_bcApplyToRegionSpecialized.F90. Could you confirm if this is the case? If so, could you guide me on the necessary modifications?
Additionally, if the zPinch simulation operates with an implicit solver, would switching to an explicit solver necessitate changes in files such as diff_advanceMag.F90 or MagneticResistivity_fullState.F90?
Your expertise and advice would be greatly valued as I navigate this issue.
Warm regards,
Bowen ZHU
________________________________
发件人: Hansen, Eddie <ehansen at pas.rochester.edu>
发送时间: 2024年3月25日 15:29
收件人: Bowen Zhu (Student at CentraleSupelec) <bowen.zhu at student-cs.fr>; flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
主题: Re: Switching Magnetic Diffusion Solvers in Zpinch Simulations
Hi Bowen,
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.
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.
--
Eddie Hansen
Applications Group Leader
Flash Center for Computational Science
From: flash-users <flash-users-bounces at flash.rochester.edu> on behalf of Bowen Zhu (Student at CentraleSupelec) <bowen.zhu at student-cs.fr>
Date: Saturday, March 23, 2024 at 3:18 PM
To: flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: [FLASH-USERS] Switching Magnetic Diffusion Solvers in Zpinch Simulations
Dear Community,
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.
As someone new to FLASH, I wonder if there are additional steps required to successfully switch to the explicit solver.
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?
Your guidance on these matters would be immensely appreciated.
Bon weekend,
Best regards,
Bowen ZHU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20240326/c62a0348/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Grid_bcApplyToRegion.F90
Type: application/octet-stream
Size: 31309 bytes
Desc: Grid_bcApplyToRegion.F90
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20240326/c62a0348/attachment-0001.obj>
More information about the flash-users
mailing list