In [1]:
from pyro import Pyro
solver = "swe"

Acoustic pulse


In [2]:
problem_name = "acoustic_pulse"
param_file = "inputs.acoustic_pulse"
other_commands = ["driver.max_steps=1", "mesh.nx=8",  "mesh.ny=8"]

In [3]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()


pyro ...
initializing the acoustic pulse problem...
cc data: nx = 8, ny = 8, ng = 4
         nvars = 4
         variables:
          height: min:    1.4000000000    max:    1.4977377908
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
      x-momentum: min:    0.0000000000    max:    0.0000000000
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
      y-momentum: min:    0.0000000000    max:    0.0000000000
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
            fuel: min:    1.3086402787    max:    1.4977377908
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    

/home/alice/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py:3285: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=0.0, top=0.0
  'bottom=%s, top=%s') % (bottom, top))
    1    0.00082    0.00082
outputting...
parameter particles.n_particles never used
parameter particles.particle_generator never used
parameter swe.cvisc never used
main:  1.5110516548156738
   evolve:  0.003922462463378906
      unsplitFluxes:  0.003696441650390625
         limiting:  0.0026841163635253906
         interfaceStates:  7.510185241699219e-05
         riemann:  0.00016427040100097656
         transverse flux addition:  0.0004930496215820312
   vis:  0.5120527744293213
Out[3]:
<swe.simulation.Simulation at 0x7fe053310d68>
<matplotlib.figure.Figure at 0x7fe04a82a6d8>

In [4]:
p = pyro_sim.sim.cc_data.get_var("height")
p.pretty_print(show_ghost=False)


       1.4       1.4       1.4       1.4       1.4       1.4       1.4       1.4 
       1.4       1.4    1.4001    1.4007    1.4007    1.4001       1.4       1.4 
       1.4    1.4001    1.4043    1.4219    1.4219    1.4043    1.4001       1.4 
       1.4    1.4007    1.4219    1.4973    1.4973    1.4219    1.4007       1.4 
       1.4    1.4007    1.4219    1.4973    1.4973    1.4219    1.4007       1.4 
       1.4    1.4001    1.4043    1.4219    1.4219    1.4043    1.4001       1.4 
       1.4       1.4    1.4001    1.4007    1.4007    1.4001       1.4       1.4 
       1.4       1.4       1.4       1.4       1.4       1.4       1.4       1.4 

         ^ y
         |
         +---> x
        

Advect


In [5]:
problem_name = "advect"
param_file = "inputs.advect"
other_commands = ["driver.max_steps=1", "mesh.nx=8",  "mesh.ny=8", "swe.riemann=HLLC"]

In [6]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()


pyro ...
initializing the advect problem...
cc data: nx = 8, ny = 8, ng = 4
         nvars = 4
         variables:
          height: min:    1.0000000001    max:    1.6257840096
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
      x-momentum: min:    1.0000000001    max:    1.6257840096
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
      y-momentum: min:    1.0000000001    max:    1.6257840096
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
            fuel: min:    0.6150878556    max:    1.6257840096
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    

/home/alice/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py:3285: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=1.4142135623730951, top=1.4142135623730951
  'bottom=%s, top=%s') % (bottom, top))
/home/alice/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py:3285: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=0.0, top=0.0
  'bottom=%s, top=%s') % (bottom, top))
    1    0.00096    0.00096
outputting...
parameter particles.n_particles never used
parameter particles.particle_generator never used
parameter swe.cvisc never used
main:  1.2293202877044678
   evolve:  0.0036513805389404297
      unsplitFluxes:  0.003047466278076172
         limiting:  0.0008172988891601562
         interfaceStates:  0.00014591217041015625
         riemann:  0.00019502639770507812
         transverse flux addition:  0.0012941360473632812
   vis:  0.5489068031311035

          
Out[6]:
<swe.simulation.Simulation at 0x7fe04a7e8588>
<matplotlib.figure.Figure at 0x7fe04a85b4e0>

In [7]:
p = pyro_sim.sim.cc_data.get_var("x-momentum")
p.pretty_print(show_ghost=False)


         1         1   0.99998   0.99985   0.99985   0.99998         1         1 
         1         1    1.0003     1.002     1.002    1.0003         1         1 
         1    1.0003    1.0151    1.0996    1.1005     1.016    1.0003   0.99998 
         1    1.0021    1.0945    1.6239    1.6298    1.1005     1.002   0.99985 
         1     1.002    1.0936     1.618    1.6239    1.0996     1.002   0.99985 
         1    1.0003    1.0142    1.0936    1.0945    1.0151    1.0003   0.99998 
         1         1    1.0003     1.002    1.0021    1.0003         1         1 
         1         1         1         1         1         1         1         1 

         ^ y
         |
         +---> x
        

Dam


In [8]:
problem_name = "dam"
param_file = "inputs.dam.x"
other_commands = ["driver.max_steps=1", "mesh.nx=16",  "mesh.ny=4"]

In [9]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()


pyro ...
initializing the dam problem...
cc data: nx = 16, ny = 4, ng = 4
         nvars = 4
         variables:
          height: min:    0.1250000000    max:    1.0000000000
                  BCs: -x: outflow      +x: outflow      -y: reflect-even +y: reflect-even
      x-momentum: min:    0.0000000000    max:    0.0000000000
                  BCs: -x: outflow      +x: outflow      -y: reflect-even +y: reflect-even
      y-momentum: min:    0.0000000000    max:    0.0000000000
                  BCs: -x: outflow      +x: outflow      -y: reflect-odd  +y: reflect-odd 
            fuel: min:    0.0000000000    max:    1.0000000000
                  BCs: -x: outflow      +x: outflow      -y: reflect-even +y: reflect-even

/home/alice/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py:2961: UserWarning: Attempting to set identical left==right results
in singular transformations; automatically expanding.
left=0.0, right=0.0
  'left=%s, right=%s') % (left, right))
    1    0.00010    0.00010
outputting...
parameter particles.n_particles never used
parameter particles.particle_generator never used
parameter swe.cvisc never used
main:  1.1560947895050049
   evolve:  0.004359245300292969
      unsplitFluxes:  0.0036864280700683594
         limiting:  0.0018572807312011719
         interfaceStates:  9.846687316894531e-05
         riemann:  0.00026535987854003906
         transverse flux addition:  0.0010950565338134766
   vis:  0.5056569576263428

          The script analysis/dam_compare.py can be used to compare
          this output to the exact solution.
          
Out[9]:
<swe.simulation.Simulation at 0x7fe04a9c7240>
<matplotlib.figure.Figure at 0x7fe04a9f6e10>

In [10]:
p = pyro_sim.sim.cc_data.get_var("y-momentum")
p.pretty_print(show_ghost=False)


         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0 
         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0 
         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0 
         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0 

         ^ y
         |
         +---> x
        

Kelvin-Helmholtz


In [11]:
problem_name = "kh"
param_file = "inputs.kh"
other_commands = ["driver.max_steps=1", "mesh.nx=16",  "mesh.ny=8"]

In [12]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()


pyro ...
warning, key: driver.splitting not defined
warning, key: io.tplot not defined
initializing the Kelvin-Helmholtz problem...
cc data: nx = 16, ny = 8, ng = 4
         nvars = 4
         variables:
          height: min:    1.0000000000    max:    1.0000000000
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
      x-momentum: min:   -0.4997234578    max:    0.4997234578
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
      y-momentum: min:   -0.0092387953    max:    0.0092387953
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    
            fuel: min:    0.0002765422    max:    0.9997234578
                  BCs: -x: periodic     +x: periodic     -y: periodic     +y: periodic    

/home/alice/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py:3285: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=1.0, top=1.0
  'bottom=%s, top=%s') % (bottom, top))
    1    0.00033    0.00033
outputting...
parameter particles.n_particles never used
parameter particles.particle_generator never used
parameter swe.cvisc never used
main:  1.2434208393096924
   evolve:  0.0065517425537109375
      unsplitFluxes:  0.00631260871887207
         limiting:  0.005168437957763672
         interfaceStates:  0.00012350082397460938
         riemann:  0.00015425682067871094
         transverse flux addition:  0.0005147457122802734
   vis:  0.5764517784118652
Out[12]:
<swe.simulation.Simulation at 0x7fe04aa1a9e8>
<matplotlib.figure.Figure at 0x7fe04ae144e0>

In [13]:
f = pyro_sim.sim.cc_data.get_var("fuel")
f.pretty_print(show_ghost=False)


   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972 
   0.95895   0.95893   0.95893   0.95895   0.95896   0.95896   0.95896   0.95896   0.95895   0.95893   0.95893   0.95895   0.95896   0.95896   0.95896   0.95896 
  0.041042   0.04104   0.04104  0.041042  0.041052  0.041065  0.041065  0.041052  0.041042   0.04104   0.04104  0.041042  0.041052  0.041065  0.041065  0.041052 
0.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.00027654 
0.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.000276540.00027654 
  0.041052  0.041065  0.041065  0.041052  0.041042   0.04104   0.04104  0.041042  0.041052  0.041065  0.041065  0.041052  0.041042   0.04104   0.04104  0.041042 
   0.95896   0.95896   0.95896   0.95896   0.95895   0.95893   0.95893   0.95895   0.95896   0.95896   0.95896   0.95896   0.95895   0.95893   0.95893   0.95895 
   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972   0.99972 

         ^ y
         |
         +---> x
        

Quad


In [14]:
problem_name = "quad"
param_file = "inputs.quad"
other_commands = ["driver.max_steps=1", "mesh.nx=8",  "mesh.ny=8"]

In [15]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()


pyro ...
initializing the quadrant problem...
cc data: nx = 8, ny = 8, ng = 4
         nvars = 4
         variables:
          height: min:    0.1379928315    max:    1.4000000000
                  BCs: -x: outflow      +x: outflow      -y: outflow      +y: outflow     
      x-momentum: min:    0.0000000000    max:    0.6419273788
                  BCs: -x: outflow      +x: outflow      -y: outflow      +y: outflow     
      y-momentum: min:    0.0000000000    max:    0.6419273788
                  BCs: -x: outflow      +x: outflow      -y: outflow      +y: outflow     
            fuel: min:    0.0000000000    max:    1.4000000000
                  BCs: -x: outflow      +x: outflow      -y: outflow      +y: outflow     

/home/alice/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py:3285: UserWarning: Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=0.0, top=0.0
  'bottom=%s, top=%s') % (bottom, top))
    1    0.00052    0.00052
outputting...
parameter particles.n_particles never used
parameter particles.particle_generator never used
parameter swe.cvisc never used
main:  1.2175016403198242
   evolve:  0.004194974899291992
      unsplitFluxes:  0.00395655632019043
         limiting:  0.0027303695678710938
         interfaceStates:  7.748603820800781e-05
         riemann:  0.00019359588623046875
         transverse flux addition:  0.0006589889526367188
   vis:  0.5826215744018555
Out[15]:
<swe.simulation.Simulation at 0x7fe04a9396d8>
<matplotlib.figure.Figure at 0x7fe04a9a4860>

In [16]:
p = pyro_sim.sim.cc_data.get_var("height")
p.pretty_print(show_ghost=False)


   0.53226   0.53226   0.53226   0.53226   0.53226   0.53434    1.4006       1.4 
   0.53261   0.53261   0.53261   0.53261   0.53261   0.53469    1.4011    1.4006 
   0.13833   0.13833   0.13833   0.13833   0.13833   0.13868   0.53469   0.53434 
   0.13799   0.13799   0.13799   0.13799   0.13799   0.13833   0.53261   0.53226 
   0.13799   0.13799   0.13799   0.13799   0.13799   0.13833   0.53261   0.53226 
   0.13799   0.13799   0.13799   0.13799   0.13799   0.13833   0.53261   0.53226 
   0.13799   0.13799   0.13799   0.13799   0.13799   0.13833   0.53261   0.53226 
   0.13799   0.13799   0.13799   0.13799   0.13799   0.13833   0.53261   0.53226 

         ^ y
         |
         +---> x