Use AstroBEAR to transfer initial data of 3D Ablative RT from fine grid to coarse grid

The initial grid for the Data from LLE is too small and AstroBEAR runs slows with such base grid. Here's how to transfer these initial data to a twice bigger grid with AstroBEAR.

  • 1. Set the Base grid resolution to half and AMR level to be 1 in global.data
GmX      = 50, 601, 50 !100,1205, 100                   ! Base grid resolution [x,y,z]
MaxLevel = 1                            ! Maximum level for this simulation (0 is fixed grid)
  • 2. Set ErrFlag to be 1 everywhere if not restart (or when read in 3D txt data).
  SUBROUTINE ProblemSetErrFlag(Info)
        !! @brief Sets error flags according to problem-specific conditions..
        !! @param Info A grid structure.        
    
    TYPE (InfoDef) :: Info
   
    ! if need to generate coarse grid data (with 1 level AMR) set ErrFlag everywhere to be 1
    if (InitialProfile .eq. 3 .AND. lRestart .eq. .false.) then
       Info%ErrFlag(:,:,:) = 1
    end if 
   
  END SUBROUTINE ProblemSetErrFlag
  • 3. Read the txt data to level 1 grid instead of level 0. Level 0 grid needs to be initialized also to avoid protections.
        DO i =1,mx
        DO j =1,my
        DO k =1,mz
            read(11,*),pos(1),pos(2),pos(3),rho
            read(12,*),pos(1),pos(2),pos(3),p
            read(13,*),pos(1),pos(2),pos(3),vx
            read(14,*),pos(1),pos(2),pos(3),vy
            read(15,*),pos(1),pos(2),pos(3),vz

            rho=5.0*rho/rScale
            p=1.25E+14*p/pScale
            vz=5E+6*vz/VelScale
            vy=5E+6*vy/VelScale
            vx=5E+6*vx/VelScale

           if(Info%level .eq. 0) then
            Info%q(i,j,k,1)=1.0
            Info%q(i,j,k,2)=0.0
            Info%q(i,j,k,3)=0.0
            Info%q(i,j,k,4)=0.0
            Info%q(i,j,k,iE)=0.0
           end if

           if(Info%level .eq. 1) then
            Info%q(i,j,k,1)=rho
            Info%q(i,j,k,2)=rho*vx
            Info%q(i,j,k,3)=rho*vy
            Info%q(i,j,k,4)=rho*vz
            energy = 0.5*rho*(vx**2+vy**2+vz**2)+p/(gamma-1d0)
            Info%q(i,j,k,iE)=energy
           end if

        end do
        end do
        end do
  • 4. Run the program from start. Frame 0 will have level=1 grid everywhere.
http://www.pas.rochester.edu/~bliu/AblativeRT/3Dcase/CoarseGrid/test/CoarseGrid_1AMR_test_frame0.png
  • 5. Restart from Frame 0 (and ErrFlag will be 0). Frame 1 after a tiny step (or any frame other than frame 0) will only have the level 1 at the interface.
http://www.pas.rochester.edu/~bliu/AblativeRT/3Dcase/CoarseGrid/test/CoarseGrid_1AMR_test_dt.png

Comments

No comments.