pyro.diffusion package#

The pyro diffusion solver. This implements second-order implicit diffusion using Crank-Nicolson time-differencing. The resulting system is solved using multigrid.

The general flow is:

  • compute the RHS given the current state

  • set up the MG

  • solve the system using MG for updated phi

The timestep is computed as:

CFL* 0.5*dt/dx**2

Subpackages#

Submodules#

pyro.diffusion.simulation module#

A simulation of diffusion

class pyro.diffusion.simulation.Simulation(solver_name, problem_name, problem_func, rp, *, problem_finalize_func=None, problem_source_func=None, timers=None, data_class=<class 'pyro.mesh.patch.CellCenterData2d'>)[source]#

Bases: NullSimulation

A simulation of diffusion

dovis()[source]#

Do runtime visualization.

evolve()[source]#

Diffusion through dt using C-N implicit solve with multigrid

initialize()[source]#

Initialize the grid and variables for diffusion and set the initial conditions for the chosen problem.

method_compute_timestep()[source]#

The diffusion timestep() function computes the timestep using the explicit timestep constraint as the starting point. We then multiply by the CFL number to get the timestep. Since we are doing an implicit discretization, we do not require CFL < 1.