<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">I did this with a heating unit that I wrote (named SNexp and placed under source/physics/sourceTerms/Heat/HeatMain). I set a flag scnd_exp that is initially false and set to true after the second explosion is set off. I also used a runtime parameter sim_expTime set to to the explosion time.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">The advantage of this approach is that I found that I ran into problems if the timestep was not reduced to a small value right after the explosion was initiated. Using the Heat unit there is the built-in mechanism of Heat_computeDt which is not available using Simulation_adjustEvolution. I used logical another runtime parameter newexp that I set to .true. when initiating the second explosion. Then in Heat_computeDt I only do anything if newexp is .true. in which case I set dt_check to dr_dtInit (which is very small) and then set newexp to .false.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">I'd be happy to give you the code if you want.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Jon</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 12, 2018 at 1:00 PM, <span dir="ltr"><<a href="mailto:flash-users-request@flash.uchicago.edu" target="_blank">flash-users-</a></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---------- Forwarded message ----------<br>From: Ian Padilla <<a href="mailto:ia6400pa-s@student.lu.se">ia6400pa-s@student.lu.se</a>><br>To: <a href="mailto:flash-users@flash.uchicago.edu">flash-users@flash.uchicago.edu</a><br>Cc: <br>Bcc: <br>Date: Mon, 11 Jun 2018 23:16:06 +0200<br>Subject: [FLASH-USERS] Two sedov explosions<br>Dear all,<br>
<br>
I’m working on two identical Sedov explosions centered at x=0.3 and x=0.8, respectively, in a [1,1,1] domain box. I’d like one of them to start later than the other and I’m looking for advise on how to delay the evolution of one of them.<br>
<br>
Here what I’ve done so far:<br>
<br>
I have set Simulation_initBlock to initialize both explosions. Naively one can “pause” the evolution of BOTH explosions by writing an if-stament in Driver_evolveFlash: <br>
<br>
if( (dr_simTime .ge. 0.0 .and. dr_simTime < 0.01) .or. (dr_simTime .ge. 0.05) ) then <br>
call Timers_start("Hydro”) <br>
call Hydro(blockCount, blockList, <br>
& dr_simTime, dr_dt, dr_dtOld, sweepDummy) <br>
call Timers_stop("Hydro”) <br>
call Driver_driftUnk(__FILE__,__<wbr>LINE__,driftUnk_flags) <br>
end if<br>
<br>
Since I’d like to stop the evolution of only ONE explosion (please correct me if I’m mistaken) one solution is to identify (inside Driver_evolveFlash) the blocks with center < 0.5 (using Grid_getBlkCenterCoords(<wbr>blockId, blockCenter)) and remove them from the blockList array that then is passed to Hydro sequence, so that only blocks belonging to the explosion at x = 0.8 get updated in the hydro unit.<br>
<br>
I’m not sure this is the best way of doing it. I'd be very grateful if you had any tips on this.<br>
<br>
Thanks in advance,<br>
<br>
Ian Padilla<br>
Lund University<br>
<br>
<br>
<br><br>---------- Forwarded message ----------<br>From: Suoqing Ji <<a href="mailto:suoqing@physics.ucsb.edu">suoqing@physics.ucsb.edu</a>><br>To: Ian Padilla <<a href="mailto:ia6400pa-s@student.lu.se">ia6400pa-s@student.lu.se</a>><br>Cc: <a href="mailto:flash-users@flash.uchicago.edu">flash-users@flash.uchicago.edu</a><br>Bcc: <br>Date: Mon, 11 Jun 2018 14:27:06 -0700<br>Subject: Re: [FLASH-USERS] Two sedov explosions<br><div style="word-wrap:break-word">Hi Ian,<div><br></div><div>The easiest way I can come up with is to take advantage of the subroutine Simulation_adjustEvolution.<wbr>F90.</div><div><br></div><div>In your Simulation_initBlock, you can initialize the first explosion only. And then in Simulation_adjustEvolution, you set a trigger to start the second explosion (say, when simtime >= 2nd_explosion_time and 2nd_exploded = .false., trigger the second explosion, and then mark the flag “2nd_exploded” as .true. to make sure it’s triggered only once).</div><div><br></div><div>Hope this will do it!<br><div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;word-wrap:break-word"><div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><br>Best wishes,<br>—<br>Suoqing Ji<br>Department of Physics<br>University of California, Santa Barbara<br><a href="http://physics.ucsb.edu/~suoqing" target="_blank">http://physics.ucsb.edu/~<wbr>suoqing</a></div></div></div></div>
</div>
<div><br><blockquote type="cite"><div>On Jun 11, 2018, at 2:16 PM, Ian Padilla <<a href="mailto:ia6400pa-s@student.lu.se" target="_blank">ia6400pa-s@student.lu.se</a>> wrote:</div><br class="gmail-m_5511442292806821527Apple-interchange-newline"><div><div>Dear all,<br><br>I’m working on two identical Sedov explosions centered at x=0.3 and x=0.8, respectively, in a [1,1,1] domain box. I’d like one of them to start later than the other and I’m looking for advise on how to delay the evolution of one of them.<br><br>Here what I’ve done so far:<br><br>I have set Simulation_initBlock to initialize both explosions. Naively one can “pause” the evolution of BOTH explosions by writing an if-stament in Driver_evolveFlash: <br><br><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span>if( (dr_simTime .ge. 0.0 .and. dr_simTime < 0.01) .or. (dr_simTime .ge. 0.05) ) then <br><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span> call Timers_start("Hydro”) <br><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span> call Hydro(blockCount, blockList, <br><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span> & dr_simTime, dr_dt, dr_dtOld, sweepDummy) <br><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span> call Timers_stop("Hydro”) <br><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span> call Driver_driftUnk(__FILE__,__<wbr>LINE__,driftUnk_flags) <br><span class="gmail-m_5511442292806821527Apple-tab-span" style="white-space:pre-wrap"> </span> end if<br><br>Since I’d like to stop the evolution of only ONE explosion (please correct me if I’m mistaken) one solution is to identify (inside Driver_evolveFlash) the blocks with center < 0.5 (using Grid_getBlkCenterCoords(<wbr>blockId, blockCenter)) and remove them from the blockList array that then is passed to Hydro sequence, so that only blocks belonging to the explosion at x = 0.8 get updated in the hydro unit.<br><br>I’m not sure this is the best way of doing it. I'd be very grateful if you had any tips on this.<br><br>Thanks in advance,<br><br>Ian Padilla<br>Lund University<br><br></div></div></blockquote></div><br></div></div><br><br>---------- Forwarded message ----------<br>From: Carlo Graziani <<a href="mailto:carlo@oddjob.uchicago.edu">carlo@oddjob.uchicago.edu</a>><br>To: <a href="mailto:flash-users@flash.uchicago.edu">flash-users@flash.uchicago.edu</a><br>Cc: <br>Bcc: <br>Date: Mon, 11 Jun 2018 16:29:03 -0500<br>Subject: Re: [FLASH-USERS] Two sedov explosions<br>Might it not be better to write a local source term that adds the extra<br>
local energy to create the second explosion near x=0.3 exactly at the<br>
time when you want it to go off?<br>
<br>
Carlo<br>
<br>
On 06/11/2018 04:16 PM, Ian Padilla wrote:<br>
> Dear all,<br>
> <br>
> I’m working on two identical Sedov explosions centered at x=0.3 and x=0.8, respectively, in a [1,1,1] domain box. I’d like one of them to start later than the other and I’m looking for advise on how to delay the evolution of one of them.<br>
> <br>
> Here what I’ve done so far:<br>
> <br>
> I have set Simulation_initBlock to initialize both explosions. Naively one can “pause” the evolution of BOTH explosions by writing an if-stament in Driver_evolveFlash: <br>
> <br>
> if( (dr_simTime .ge. 0.0 .and. dr_simTime < 0.01) .or. (dr_simTime .ge. 0.05) ) then <br>
> call Timers_start("Hydro”) <br>
> call Hydro(blockCount, blockList, <br>
> & dr_simTime, dr_dt, dr_dtOld, sweepDummy) <br>
> call Timers_stop("Hydro”) <br>
> call Driver_driftUnk(__FILE__,__<wbr>LINE__,driftUnk_flags) <br>
> end if<br>
> <br>
> Since I’d like to stop the evolution of only ONE explosion (please correct me if I’m mistaken) one solution is to identify (inside Driver_evolveFlash) the blocks with center < 0.5 (using Grid_getBlkCenterCoords(<wbr>blockId, blockCenter)) and remove them from the blockList array that then is passed to Hydro sequence, so that only blocks belonging to the explosion at x = 0.8 get updated in the hydro unit.<br>
> <br>
> I’m not sure this is the best way of doing it. I'd be very grateful if you had any tips on this.<br>
> <br>
> Thanks in advance,<br>
> <br>
> Ian Padilla<br>
> Lund University<br>
> <br>
<br>
-- <br>
Carlo Graziani (630) 252-1543 (Voice)<br>
Argonne National Laboratory ------------------------------<wbr>-------<br>
<a href="mailto:carlo@mcs.anl.gov">carlo@mcs.anl.gov</a> | The less a statesman amounts to, the<br>
| more he loves the flag. -- Kin Hubbard<br>
<br>
<br>
<br>
<br><br>---------- Forwarded message ----------<br>From: Ian Padilla <<a href="mailto:ia6400pa-s@student.lu.se">ia6400pa-s@student.lu.se</a>><br>To: Suoqing Ji <<a href="mailto:suoqing@physics.ucsb.edu">suoqing@physics.ucsb.edu</a>><br>Cc: <a href="mailto:flash-users@flash.uchicago.edu">flash-users@flash.uchicago.edu</a><br>Bcc: <br>Date: Tue, 12 Jun 2018 13:29:53 +0200<br>Subject: Re: [FLASH-USERS] Two sedov explosions<br><div style="word-wrap:break-word">Hello Suoqing,<div><br></div><div>I see, makes sense. But then in Simulation_adjustEvolution.<wbr>F90 one would have some code from Simulation_initBlock.90 looking like:</div><div><br></div><div>If (some condition on 2nd explosion) then</div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span></div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>if (sim_tinitial .LE. 0.0) then <span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>! allocation of Profs</div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> allocate(rProf(sim_nProfile))<wbr> </div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> allocate(vProf(sim_nProfile))<wbr> </div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> allocate(rhoProf(sim_<wbr>nProfile)) </div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> allocate(pProf(sim_nProfile))</div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>end if</div><div><br></div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>do i = 1, sim_nProfile<span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>! initialization<span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span></div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> rhoProf(i) = sim_rhoAmbient </div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>pProf(i) = sim_pAmbient </div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> vProf(i) = 0. </div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> if (rProf(i) .le. sim_rInit) pProf(i) = sim_pExp </div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> enddo</div><div><br></div><div>end if</div><div><br></div><div>Then this initialization would replace the values in the blocks belonging to the other explosion already evolved. I guess I’m looking for something like:</div><div><br></div><div><div>do i = 1, sim_nProfile<span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>! initialization<span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span></div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> rhoProf(i) = “ current rho "</div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>pProf(i) = “ current p "</div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> vProf(i) = “ current v "</div><div><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> if (rProf(i) .le. sim_rInit) pProf(i) = sim_pExp </div><div>enddo</div></div><div><br></div><div>Is there any way of getting the current Profs arrays? So that both second one doesn’t replace first one.</div><div><br></div><div>Thank you,</div><div><br></div><div>Ian Padilla</div><div>Lund University</div><div> <br><div><br><blockquote type="cite"><div>On Jun 11, 2018, at 23:27, Suoqing Ji <<a href="mailto:suoqing@physics.ucsb.edu" target="_blank">suoqing@physics.ucsb.edu</a>> wrote:</div><br class="gmail-m_-5884260768356819711Apple-interchange-newline"><div><div style="word-wrap:break-word">Hi Ian,<div><br></div><div>The easiest way I can come up with is to take advantage of the subroutine Simulation_adjustEvolution.<wbr>F90.</div><div><br></div><div>In your Simulation_initBlock, you can initialize the first explosion only. And then in Simulation_adjustEvolution, you set a trigger to start the second explosion (say, when simtime >= 2nd_explosion_time and 2nd_exploded = .false., trigger the second explosion, and then mark the flag “2nd_exploded” as .true. to make sure it’s triggered only once).</div><div><br></div><div>Hope this will do it!<br><div>
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;word-wrap:break-word"><div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><br>Best wishes,<br>—<br>Suoqing Ji<br>Department of Physics<br>University of California, Santa Barbara<br><a href="http://physics.ucsb.edu/~suoqing" target="_blank">http://physics.ucsb.edu/~<wbr>suoqing</a></div></div></div></div>
</div>
<div><br><blockquote type="cite"><div>On Jun 11, 2018, at 2:16 PM, Ian Padilla <<a href="mailto:ia6400pa-s@student.lu.se" target="_blank">ia6400pa-s@student.lu.se</a>> wrote:</div><br class="gmail-m_-5884260768356819711Apple-interchange-newline"><div><div>Dear all,<br><br>I’m working on two identical Sedov explosions centered at x=0.3 and x=0.8, respectively, in a [1,1,1] domain box. I’d like one of them to start later than the other and I’m looking for advise on how to delay the evolution of one of them.<br><br>Here what I’ve done so far:<br><br>I have set Simulation_initBlock to initialize both explosions. Naively one can “pause” the evolution of BOTH explosions by writing an if-stament in Driver_evolveFlash: <br><br><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span>if( (dr_simTime .ge. 0.0 .and. dr_simTime < 0.01) .or. (dr_simTime .ge. 0.05) ) then <br><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> call Timers_start("Hydro”) <br><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> call Hydro(blockCount, blockList, <br><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> & dr_simTime, dr_dt, dr_dtOld, sweepDummy) <br><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> call Timers_stop("Hydro”) <br><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> call Driver_driftUnk(__FILE__,__<wbr>LINE__,driftUnk_flags) <br><span class="gmail-m_-5884260768356819711Apple-tab-span" style="white-space:pre-wrap"> </span> end if<br><br>Since I’d like to stop the evolution of only ONE explosion (please correct me if I’m mistaken) one solution is to identify (inside Driver_evolveFlash) the blocks with center < 0.5 (using Grid_getBlkCenterCoords(<wbr>blockId, blockCenter)) and remove them from the blockList array that then is passed to Hydro sequence, so that only blocks belonging to the explosion at x = 0.8 get updated in the hydro unit.<br><br>I’m not sure this is the best way of doing it. I'd be very grateful if you had any tips on this.<br><br>Thanks in advance,<br><br>Ian Padilla<br>Lund University<br></div></div></blockquote></div></div></div></div></blockquote></div></div></div></blockquote></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">________________________________________________________<br>Jonathan D. Slavin Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a> 60 Garden Street, MS 83<br>phone: (617) 496-7981 Cambridge, MA 02138-1516<br>cell: (781) 363-0035 USA<br>________________________________________________________<br><br></div></div></div></div>
</div></div>