NEOPAX._fem¶
Classes¶
Functions¶
|
Average face values to cell centers. |
|
Average cell values to faces (interfaces). |
|
Update cell values using net flux and optional source, with optional volume weighting. |
|
Set left/right boundary fluxes for Dirichlet BCs. |
|
Set boundary face flux for a Neumann BC: dQ/dr = grad_value at the boundary. |
|
Set boundary face flux for a Robin/decay BC: dQ/dr = -Q/decay_length at the boundary. |
|
Set Dirichlet BCs by assigning ghost cell values. |
|
Set Neumann BCs by assigning ghost cell values using gradients and dr. |
Module Contents¶
- NEOPAX._fem.cell_centered_from_faces(face_values)¶
Average face values to cell centers.
- NEOPAX._fem.faces_from_cell_centered(cell_values)¶
Average cell values to faces (interfaces).
- NEOPAX._fem.conservative_update(flux, dx, Vprime=None, Vprime_half=None, source=None)¶
Update cell values using net flux and optional source, with optional volume weighting. If Vprime and Vprime_half are provided, use stellarator volume form:
update = -1/(Vprime*dx) * (Vprime_half[1:] * flux[1:] - Vprime_half[:-1] * flux[:-1])
Otherwise, defaults to simple FVM.
Notes: -
dxcan be scalar (uniform spacing) or a per-cell array of shape(n_r,). - JAX broadcasting handles both modes.
- NEOPAX._fem.apply_dirichlet_flux(flux, left_bc, right_bc)¶
Set left/right boundary fluxes for Dirichlet BCs.
- NEOPAX._fem.apply_neumann_flux(flux, grad_value, dr, side='right')¶
Set boundary face flux for a Neumann BC: dQ/dr = grad_value at the boundary. For the right (edge) boundary, set flux[-1] so that:
(Q_edge - Q_interior)/dr = grad_value Q_edge = Q_interior + grad_value * dr
- NEOPAX._fem.apply_robin_flux(flux, cell_value, decay_length, dr, side='right')¶
Set boundary face flux for a Robin/decay BC: dQ/dr = -Q/decay_length at the boundary. For the right (edge) boundary, set flux[-1] so that:
(Q_edge - Q_interior)/dr = -Q_edge/decay_length
- Solving for Q_edge:
Q_edge = Q_interior / (1 + dr/decay_length)
- NEOPAX._fem.set_dirichlet_ghosts(u, left_value, right_value)¶
Set Dirichlet BCs by assigning ghost cell values.
- NEOPAX._fem.set_neumann_ghosts(u, grad_left, grad_right, dr)¶
Set Neumann BCs by assigning ghost cell values using gradients and dr.