pyro.incompressible package#
The pyro solver for incompressible flow. This implements as second-order approximate projection method. The general flow is:
create the limited slopes of u and v (in both directions)
get the advective velocities through a piecewise linear Godunov method
enforce the divergence constraint on the velocities through a projection (the MAC projection)
recompute the interface states using the new advective velocity
update U in time to get the provisional velocity field
project the final velocity to enforce the divergence constraint.
The projections are done using multigrid
Subpackages#
Submodules#
pyro.incompressible.incomp_interface module#
- pyro.incompressible.incomp_interface.apply_gradp_corrections(dt, u_xl, u_xr, u_yl, u_yr, v_xl, v_xr, v_yl, v_yr, gradp_x, gradp_y)[source]#
- Parameters:
- gridGrid2d
The grid object
- dtfloat
The timestep
- u_xl, u_xrndarray ndarray
left and right states of x-velocity in x-interface.
- u_yl, u_yrndarray ndarray
left and right states of x-velocity in y-interface.
- v_xl, v_xrndarray ndarray
left and right states of y-velocity in x-interface.
- v_yl, u_yrndarray ndarray
left and right states of y-velocity in y-interface.
- Returns:
- outndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray
correct the interface states of the left and right states of u and v on both the x- and y-interfaces interface states with the pressure gradient terms.
- pyro.incompressible.incomp_interface.apply_other_source_terms(dt, u_xl, u_xr, u_yl, u_yr, v_xl, v_xr, v_yl, v_yr, source_x, source_y)[source]#
- Parameters:
- gridGrid2d
The grid object
- dtfloat
The timestep
- u_xl, u_xrndarray ndarray
left and right states of x-velocity in x-interface.
- u_yl, u_yrndarray ndarray
left and right states of x-velocity in y-interface.
- v_xl, v_xrndarray ndarray
left and right states of y-velocity in x-interface.
- v_yl, u_yrndarray ndarray
left and right states of y-velocity in y-interface.
- source_x, source_yndarray
Any other source terms
- Returns:
- outndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray
correct the interface states of the left and right states of u and v on both the x- and y-interfaces interface states with the source terms.
- pyro.incompressible.incomp_interface.mac_vels(grid, dt, u, v, ldelta_ux, ldelta_vx, ldelta_uy, ldelta_vy, gradp_x, gradp_y, source_x=None, source_y=None)[source]#
Calculate the MAC velocities in the x and y directions.
- Parameters:
- gridGrid2d
The grid object
- dtfloat
The timestep
- u, vndarray
x-velocity and y-velocity
- ldelta_ux, ldelta_uy: ndarray
Limited slopes of the x-velocity in the x and y directions
- ldelta_vx, ldelta_vy: ndarray
Limited slopes of the y-velocity in the x and y directions
- gradp_x, gradp_yndarray
Pressure gradients in the x and y directions
- source_x, source_yndarray
Any other source terms
- Returns:
- outndarray, ndarray
MAC velocities in the x and y directions
- pyro.incompressible.incomp_interface.states(grid, dt, u, v, ldelta_ux, ldelta_vx, ldelta_uy, ldelta_vy, gradp_x, gradp_y, u_MAC, v_MAC, source_x=None, source_y=None)[source]#
This is similar to
mac_vels
, but it predicts the interface states of both u and v on both interfaces, using the MAC velocities to do the upwinding.- Parameters:
- gridGrid2d
The grid object
- dtfloat
The timestep
- u, vndarray
x-velocity and y-velocity
- ldelta_ux, ldelta_uy: ndarray
Limited slopes of the x-velocity in the x and y directions
- ldelta_vx, ldelta_vy: ndarray
Limited slopes of the y-velocity in the x and y directions
- gradp_x, gradp_yndarray
Pressure gradients in the x and y directions
- u_MAC, v_MACndarray
MAC velocities in the x and y directions
- source_x, source_yndarray
Any other source terms
- Returns:
- outndarray, ndarray, ndarray, ndarray
x and y velocities predicted to the interfaces
pyro.incompressible.simulation module#
- class pyro.incompressible.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:
Simulation
- do_other_update_velocity(U_MAC, U_INT)[source]#
Change the method for updating the velocity from the projected velocity and interface states (see e.g. incompressible_viscous)
- evolve(other_update_velocity=False, other_source_term=False)[source]#
Evolve the incompressible equations through one timestep.
- initialize(*, other_bc=False, aux_vars=())[source]#
Initialize the grid and variables for incompressible flow and set the initial conditions for the chosen problem.