This notebook runs various solvers for a single step and dumps out some variables -- it is intended for unit testing.
At the moment, it is required to be at the top-level pyro/
directory, because not all the functions find pyro's home directory on their own.
In [1]:
from pyro import Pyro
In [2]:
solver = "advection"
problem_name = "smooth"
param_file = "inputs.smooth"
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()
Out[3]:
In [4]:
dens = pyro_sim.sim.cc_data.get_var("density")
dens.pretty_print(show_ghost=False)
In [5]:
solver = "advection_nonuniform"
problem_name = "slotted"
param_file = "inputs.slotted"
other_commands = ["driver.max_steps=1", "mesh.nx=8", "mesh.ny=8"]
In [6]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[6]:
In [7]:
dens = pyro_sim.sim.cc_data.get_var("density")
dens.pretty_print(show_ghost=False)
In [8]:
solver = "advection_fv4"
problem_name = "smooth"
param_file = "inputs.smooth"
other_commands = ["driver.max_steps=1", "mesh.nx=8", "mesh.ny=8"]
In [9]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[9]:
In [10]:
dens = pyro_sim.sim.cc_data.get_var("density")
dens.pretty_print(show_ghost=False)
In [11]:
solver = "advection_rk"
problem_name = "tophat"
param_file = "inputs.tophat"
other_commands = ["driver.max_steps=1", "mesh.nx=8", "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()
Out[12]:
In [13]:
dens = pyro_sim.sim.cc_data.get_var("density")
dens.pretty_print(show_ghost=False)
In [14]:
solver = "compressible"
problem_name = "rt"
param_file = "inputs.rt"
other_commands = ["driver.max_steps=1", "mesh.nx=8", "mesh.ny=24", "driver.verbose=0", "compressible.riemann=CGF"]
In [15]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[15]:
In [16]:
dens = pyro_sim.sim.cc_data.get_var("density")
dens.pretty_print(show_ghost=False)
In [17]:
solver = "compressible_fv4"
problem_name = "kh"
param_file = "inputs.kh"
other_commands = ["driver.max_steps=1", "mesh.nx=8", "mesh.ny=8", "driver.verbose=0"]
In [18]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[18]:
In [19]:
e = pyro_sim.sim.cc_data.get_var("eint")
e.pretty_print(show_ghost=False)
In [20]:
solver = "compressible_rk"
problem_name = "quad"
param_file = "inputs.quad"
other_commands = ["driver.max_steps=1", "mesh.nx=16", "mesh.ny=16", "driver.verbose=0"]
In [21]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[21]:
In [22]:
p = pyro_sim.sim.cc_data.get_var("pressure")
p.pretty_print(show_ghost=False)
In [23]:
solver = "compressible_sdc"
problem_name = "sod"
param_file = "inputs.sod.y"
other_commands = ["driver.max_steps=1", "mesh.nx=4", "mesh.ny=16", "driver.verbose=0"]
In [24]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[24]:
In [25]:
p = pyro_sim.sim.cc_data.get_var("pressure")
p.pretty_print(show_ghost=False)
In [26]:
solver = "diffusion"
problem_name = "gaussian"
param_file = "inputs.gaussian"
other_commands = ["driver.max_steps=1", "mesh.nx=16", "mesh.ny=16", "driver.verbose=0"]
In [27]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[27]:
In [28]:
dens = pyro_sim.sim.cc_data.get_var("phi")
dens.pretty_print(show_ghost=False)
In [29]:
solver = "incompressible"
problem_name = "shear"
param_file = "inputs.shear"
other_commands = ["driver.max_steps=1", "mesh.nx=8", "mesh.ny=8", "driver.verbose=0"]
In [30]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[30]:
In [31]:
u = pyro_sim.sim.cc_data.get_var("x-velocity")
u.pretty_print(show_ghost=False)
In [32]:
solver = "lm_atm"
problem_name = "bubble"
param_file = "inputs.bubble"
other_commands = ["driver.max_steps=1", "mesh.nx=16", "mesh.ny=16", "driver.verbose=0"]
In [33]:
pyro_sim = Pyro(solver)
pyro_sim.initialize_problem(problem_name, param_file, other_commands=other_commands)
pyro_sim.run_sim()
Out[33]:
In [34]:
v = pyro_sim.sim.cc_data.get_var("y-velocity")
v.pretty_print(show_ghost=False, fmt="%10.3g")
In [ ]: