ndiffusion.transport_to_diffusion

ndiffusion.transport_to_diffusion(data, G, scatter_orientation='from_to', transport_correction='auto')[source]

Convert one material’s transport cross sections to diffusion ones.

Parameters:
  • data (dict-like) –

    Transport cross sections for a single material. Recognized keys:

    • SigT or Siga - total, or absorption; one is required and the other is derived from the scatter matrix.

    • Scat - P0 scatter matrix, shape (G, G). Required.

    • SigTr - transport cross section, shape (G,). Optional.

    • Scat1 - P1 scatter moment matrix, shape (G, G). Optional.

    • nuSigf - nu-fission, shape (G,) or (G, G). Required.

    • chi - fission spectrum, shape (G,). Optional; when absent the caller gets fission-matrix mode if nuSigf is (G, G).

  • G (int) – Number of energy groups.

  • scatter_orientation ({"from_to", "to_from"}) – Storage order of Scat (and Scat1, and a matrix nuSigf). "from_to" (the default, and the usual transport convention) means Scat[g_from][g_to]; "to_from" means the data is already in the solver’s [g_to][g_from] order and is used as-is.

  • transport_correction ({"auto", "p1", "none"}) – How to obtain Sigma_tr. See the module docstring.

Returns:

Diffusion cross sections for this material, ready to pass to ndiffusion.make_materials(): D, Removal, Scat ([g_to][g_from], diagonal zeroed), nuSigf, and chi when the input had one. The derived Siga, SigT and SigTr are also included for inspection. Because Removal is present, make_materials takes the data as-is and does not re-zero the diagonal.

Return type:

dict

Raises:
  • ValueError – On an unknown orientation or correction, a shape mismatch, or a non-positive Sigma_tr (which would give a negative or infinite D).

  • KeyError – When a required cross section is missing.