[FLASH-USERS] Two sedov explosions

Slavin, Jonathan jslavin at cfa.harvard.edu
Tue Jun 12 13:42:06 EDT 2018


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.

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.

I'd be happy to give you the code if you want.

Jon

On Tue, Jun 12, 2018 at 1:00 PM, <flash-users-
<flash-users-request at flash.uchicago.edu>
>
> ---------- Forwarded message ----------
> From: Ian Padilla <ia6400pa-s at student.lu.se>
> To: flash-users at flash.uchicago.edu
> Cc:
> Bcc:
> Date: Mon, 11 Jun 2018 23:16:06 +0200
> Subject: [FLASH-USERS] Two sedov explosions
> Dear all,
>
> 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.
>
> Here what I’ve done so far:
>
> 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:
>
>         if( (dr_simTime .ge. 0.0 .and. dr_simTime < 0.01) .or. (dr_simTime
> .ge. 0.05) ) then
>                  call Timers_start("Hydro”)
>                  call Hydro(blockCount, blockList,
>                          & dr_simTime, dr_dt, dr_dtOld, sweepDummy)
>                  call Timers_stop("Hydro”)
>                  call Driver_driftUnk(__FILE__,__LINE__,driftUnk_flags)
>          end if
>
> 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(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.
>
> I’m not sure this is the best way of doing it. I'd be very grateful if you
> had any tips on this.
>
> Thanks in advance,
>
> Ian Padilla
> Lund University
>
>
>
>
> ---------- Forwarded message ----------
> From: Suoqing Ji <suoqing at physics.ucsb.edu>
> To: Ian Padilla <ia6400pa-s at student.lu.se>
> Cc: flash-users at flash.uchicago.edu
> Bcc:
> Date: Mon, 11 Jun 2018 14:27:06 -0700
> Subject: Re: [FLASH-USERS] Two sedov explosions
> Hi Ian,
>
> The easiest way I can come up with is to take advantage of the subroutine
> Simulation_adjustEvolution.F90.
>
> 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).
>
> Hope this will do it!
>
> Best wishes,
>> Suoqing Ji
> Department of Physics
> University of California, Santa Barbara
> http://physics.ucsb.edu/~suoqing
>
> On Jun 11, 2018, at 2:16 PM, Ian Padilla <ia6400pa-s at student.lu.se> wrote:
>
> Dear all,
>
> 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.
>
> Here what I’ve done so far:
>
> 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:
>
> if( (dr_simTime .ge. 0.0 .and. dr_simTime < 0.01) .or. (dr_simTime .ge.
> 0.05) ) then
> call Timers_start("Hydro”)
> call Hydro(blockCount, blockList,
> & dr_simTime, dr_dt, dr_dtOld, sweepDummy)
> call Timers_stop("Hydro”)
> call Driver_driftUnk(__FILE__,__LINE__,driftUnk_flags)
> end if
>
> 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(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.
>
> I’m not sure this is the best way of doing it. I'd be very grateful if you
> had any tips on this.
>
> Thanks in advance,
>
> Ian Padilla
> Lund University
>
>
>
>
> ---------- Forwarded message ----------
> From: Carlo Graziani <carlo at oddjob.uchicago.edu>
> To: flash-users at flash.uchicago.edu
> Cc:
> Bcc:
> Date: Mon, 11 Jun 2018 16:29:03 -0500
> Subject: Re: [FLASH-USERS] Two sedov explosions
> Might it not be better to write a local source term that adds the extra
> local energy to create the second explosion near x=0.3 exactly at the
> time when you want it to go off?
>
> Carlo
>
> On 06/11/2018 04:16 PM, Ian Padilla wrote:
> > Dear all,
> >
> > 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.
> >
> > Here what I’ve done so far:
> >
> > 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:
> >
> >       if( (dr_simTime .ge. 0.0 .and. dr_simTime < 0.01) .or. (dr_simTime
> .ge. 0.05) ) then
> >                call Timers_start("Hydro”)
> >                call Hydro(blockCount, blockList,
> >                        & dr_simTime, dr_dt, dr_dtOld, sweepDummy)
> >                call Timers_stop("Hydro”)
> >                call Driver_driftUnk(__FILE__,__LINE__,driftUnk_flags)
> >        end if
> >
> > 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(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.
> >
> > I’m not sure this is the best way of doing it. I'd be very grateful if
> you had any tips on this.
> >
> > Thanks in advance,
> >
> > Ian Padilla
> > Lund University
> >
>
> --
> Carlo Graziani                                 (630) 252-1543 (Voice)
> Argonne National Laboratory -------------------------------------
> carlo at mcs.anl.gov           | The less a statesman amounts to, the
>                             | more he loves the flag. -- Kin Hubbard
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Ian Padilla <ia6400pa-s at student.lu.se>
> To: Suoqing Ji <suoqing at physics.ucsb.edu>
> Cc: flash-users at flash.uchicago.edu
> Bcc:
> Date: Tue, 12 Jun 2018 13:29:53 +0200
> Subject: Re: [FLASH-USERS] Two sedov explosions
> Hello Suoqing,
>
> I see, makes sense. But then in Simulation_adjustEvolution.F90 one would
> have some code from Simulation_initBlock.90 looking like:
>
> If (some condition on 2nd explosion) then
> if (sim_tinitial .LE. 0.0) then  ! allocation of Profs
>  allocate(rProf(sim_nProfile))
>  allocate(vProf(sim_nProfile))
>  allocate(rhoProf(sim_nProfile))
>  allocate(pProf(sim_nProfile))
> end if
>
> do i = 1, sim_nProfile ! initialization
>  rhoProf(i) = sim_rhoAmbient
> pProf(i) = sim_pAmbient
>  vProf(i) = 0.
>  if (rProf(i) .le. sim_rInit) pProf(i) = sim_pExp
>  enddo
>
> end if
>
> 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:
>
> do i = 1, sim_nProfile ! initialization
>  rhoProf(i) = “ current rho "
> pProf(i) = “ current p "
>  vProf(i) = “ current v "
>  if (rProf(i) .le. sim_rInit) pProf(i) = sim_pExp
> enddo
>
> Is there any way of getting the current Profs arrays? So that both second
> one doesn’t replace first one.
>
> Thank you,
>
> Ian Padilla
> Lund University
>
>
> On Jun 11, 2018, at 23:27, Suoqing Ji <suoqing at physics.ucsb.edu> wrote:
>
> Hi Ian,
>
> The easiest way I can come up with is to take advantage of the subroutine
> Simulation_adjustEvolution.F90.
>
> 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).
>
> Hope this will do it!
>
> Best wishes,
>> Suoqing Ji
> Department of Physics
> University of California, Santa Barbara
> http://physics.ucsb.edu/~suoqing
>
> On Jun 11, 2018, at 2:16 PM, Ian Padilla <ia6400pa-s at student.lu.se> wrote:
>
> Dear all,
>
> 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.
>
> Here what I’ve done so far:
>
> 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:
>
> if( (dr_simTime .ge. 0.0 .and. dr_simTime < 0.01) .or. (dr_simTime .ge.
> 0.05) ) then
> call Timers_start("Hydro”)
> call Hydro(blockCount, blockList,
> & dr_simTime, dr_dt, dr_dtOld, sweepDummy)
> call Timers_stop("Hydro”)
> call Driver_driftUnk(__FILE__,__LINE__,driftUnk_flags)
> end if
>
> 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(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.
>
> I’m not sure this is the best way of doing it. I'd be very grateful if you
> had any tips on this.
>
> Thanks in advance,
>
> Ian Padilla
> Lund University
>
> --
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
jslavin at cfa.harvard.edu       60 Garden Street, MS 83
phone: (617) 496-7981       Cambridge, MA 02138-1516
cell: (781) 363-0035             USA
________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20180612/e63ad8d5/attachment.htm>


More information about the flash-users mailing list