Dear all, I am trying to figure out a way to mask out cells that contain shocks. One way I can think of is to create a derived field by identifying shocks. It seems that there are different ways of finding shocks: Enzo has a refinement criterion (refine by shocks) and there is also shock finding written by Sam. Has anybody tried to find shocks using yt? I would appreciate it if you would like to share your code/experience/advice. Thank you! Yuan
I don't have yt code, but I agree that this would be a useful standard derived field to add. As for the methodology, the shock detection algorithm that is used in a lot of codes looks for regions where there is compression and a pressure jump (to separate shocks from rarefactions). Most PPM or similar hydro codes (even those that are not directionally split) will do this check in 1d when determining whether to apply flattening to shocks (to prevent their selfsteepening from making them too steep), and then look in all directions to figure out if a zone should be flattened. You want to do a single multid shock detection, which will mean computing the velocity divergence and the pressure jump in the normal direction. Here's the code we use in Castro which inherits some ideas from other codes (Flash, and the ppm papers). Look for the subroutine shock(). https://github.com/BoxLibCodes/Castro/blob/master/Source/Src_3d/riemann_3d.... On Tue, Jun 23, 2015 at 11:51 AM, Yuan Li <yuan@astro.columbia.edu> wrote:
Dear all,
I am trying to figure out a way to mask out cells that contain shocks. One way I can think of is to create a derived field by identifying shocks. It seems that there are different ways of finding shocks: Enzo has a refinement criterion (refine by shocks) and there is also shock finding written by Sam.
Has anybody tried to find shocks using yt? I would appreciate it if you would like to share your code/experience/advice. Thank you!
Yuan
_______________________________________________ ytusers mailing list ytusers@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytusersspacepope.org
 Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 117943800 *phone*: 6316328225 *email*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
that should have read: "to separate shocks from contacts" On Tue, Jun 23, 2015 at 12:04 PM, Michael Zingale < michael.zingale@stonybrook.edu> wrote:
I don't have yt code, but I agree that this would be a useful standard derived field to add. As for the methodology, the shock detection algorithm that is used in a lot of codes looks for regions where there is compression and a pressure jump (to separate shocks from rarefactions). Most PPM or similar hydro codes (even those that are not directionally split) will do this check in 1d when determining whether to apply flattening to shocks (to prevent their selfsteepening from making them too steep), and then look in all directions to figure out if a zone should be flattened. You want to do a single multid shock detection, which will mean computing the velocity divergence and the pressure jump in the normal direction. Here's the code we use in Castro which inherits some ideas from other codes (Flash, and the ppm papers). Look for the subroutine shock().
https://github.com/BoxLibCodes/Castro/blob/master/Source/Src_3d/riemann_3d....
On Tue, Jun 23, 2015 at 11:51 AM, Yuan Li <yuan@astro.columbia.edu> wrote:
Dear all,
I am trying to figure out a way to mask out cells that contain shocks. One way I can think of is to create a derived field by identifying shocks. It seems that there are different ways of finding shocks: Enzo has a refinement criterion (refine by shocks) and there is also shock finding written by Sam.
Has anybody tried to find shocks using yt? I would appreciate it if you would like to share your code/experience/advice. Thank you!
Yuan
_______________________________________________ ytusers mailing list ytusers@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytusersspacepope.org
 Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 117943800 *phone*: 6316328225 *email*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
 Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 117943800 *phone*: 6316328225 *email*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
Hi Yuan, Sam's shockfinder for Enzo works quite well. He created some tools that I don't think he would mind me sharing on his behalf. They haven't been updated in two years, so they will likely only work with yt2.x unless you update them. They will create shock mach number fields that you can use in yt. Anyway, they are here: https://bitbucket.org/samskillman/shock_in_a_box/ Britton On Tue, Jun 23, 2015 at 5:06 PM, Michael Zingale < michael.zingale@stonybrook.edu> wrote:
that should have read: "to separate shocks from contacts"
On Tue, Jun 23, 2015 at 12:04 PM, Michael Zingale < michael.zingale@stonybrook.edu> wrote:
I don't have yt code, but I agree that this would be a useful standard derived field to add. As for the methodology, the shock detection algorithm that is used in a lot of codes looks for regions where there is compression and a pressure jump (to separate shocks from rarefactions). Most PPM or similar hydro codes (even those that are not directionally split) will do this check in 1d when determining whether to apply flattening to shocks (to prevent their selfsteepening from making them too steep), and then look in all directions to figure out if a zone should be flattened. You want to do a single multid shock detection, which will mean computing the velocity divergence and the pressure jump in the normal direction. Here's the code we use in Castro which inherits some ideas from other codes (Flash, and the ppm papers). Look for the subroutine shock().
https://github.com/BoxLibCodes/Castro/blob/master/Source/Src_3d/riemann_3d....
On Tue, Jun 23, 2015 at 11:51 AM, Yuan Li <yuan@astro.columbia.edu> wrote:
Dear all,
I am trying to figure out a way to mask out cells that contain shocks. One way I can think of is to create a derived field by identifying shocks. It seems that there are different ways of finding shocks: Enzo has a refinement criterion (refine by shocks) and there is also shock finding written by Sam.
Has anybody tried to find shocks using yt? I would appreciate it if you would like to share your code/experience/advice. Thank you!
Yuan
_______________________________________________ ytusers mailing list ytusers@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytusersspacepope.org
 Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 117943800 *phone*: 6316328225 *email*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
 Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 117943800 *phone*: 6316328225 *email*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
_______________________________________________ ytusers mailing list ytusers@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytusersspacepope.org
Hi Yuan, I don’t have any advice to give on shockfinding in yt or Enzo, but I thought I’d point out this paper: http://arxiv.org/abs/1407.4117 You might find Section 5 interesting. Basically, a common assumption of shock finders is to filter using the dot product of the temperature and entropy gradients. When you do this, the computed dissipated energy can be sensitive to your assumptions for the other jump requirements, and depending on what you assume, can identify spurious shocks. This paper instead of using the entropy gradient, uses the density gradient, and gives somewhat different results. More knowledgable people than me can probably give you better advice, but I thought you might find this interesting, especially if you’re going to write something yourself. Christine On Jun 23, 2015, at 5:51 PM, Yuan Li <yuan@astro.columbia.edu> wrote:
Dear all,
I am trying to figure out a way to mask out cells that contain shocks. One way I can think of is to create a derived field by identifying shocks. It seems that there are different ways of finding shocks: Enzo has a refinement criterion (refine by shocks) and there is also shock finding written by Sam.
Has anybody tried to find shocks using yt? I would appreciate it if you would like to share your code/experience/advice. Thank you!
Yuan _______________________________________________ ytusers mailing list ytusers@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytusersspacepope.org
Hi all, Thank you for all the suggestions! I decided to try something similar to Sam's shock identification first. Here is a problem I encountered: I tried to define a field of the temperature gradient like gradPressureX, but I got an error message: ... new_field[1:1,1:1,1:1] = data["Temperature"][sl_right,1:1,1:1]/ds ValueError: could not broadcast input array from shape (62,62,64) into shape (62,62,62) I then tried to redefine gradPressureX by copying the original definition and giving it a different name, and I got the same error. The original gradPressureX works fine. Is it because I did not load some specific module or something? I am using HydroMethod = 2. Thank you! Yuan On Wed, Jun 24, 2015 at 5:47 AM, Christine Simpson < csimpson@astro.columbia.edu> wrote:
Hi Yuan,
I don’t have any advice to give on shockfinding in yt or Enzo, but I thought I’d point out this paper:
http://arxiv.org/abs/1407.4117
You might find Section 5 interesting. Basically, a common assumption of shock finders is to filter using the dot product of the temperature and entropy gradients. When you do this, the computed dissipated energy can be sensitive to your assumptions for the other jump requirements, and depending on what you assume, can identify spurious shocks. This paper instead of using the entropy gradient, uses the density gradient, and gives somewhat different results. More knowledgable people than me can probably give you better advice, but I thought you might find this interesting, especially if you’re going to write something yourself.
Christine
On Jun 23, 2015, at 5:51 PM, Yuan Li <yuan@astro.columbia.edu> wrote:
Dear all,
I am trying to figure out a way to mask out cells that contain shocks. One way I can think of is to create a derived field by identifying shocks. It seems that there are different ways of finding shocks: Enzo has a refinement criterion (refine by shocks) and there is also shock finding written by Sam.
Has anybody tried to find shocks using yt? I would appreciate it if you would like to share your code/experience/advice. Thank you!
Yuan _______________________________________________ ytusers mailing list ytusers@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytusersspacepope.org
_______________________________________________ ytusers mailing list ytusers@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/ytusersspacepope.org
participants (5)

Britton Smith

Christine Simpson

Michael Zingale

Yuan Li

Yuan Li