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:
SigTorSiga- 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 ifnuSigfis(G, G).
G (int) – Number of energy groups.
scatter_orientation ({"from_to", "to_from"}) – Storage order of
Scat(andScat1, and a matrixnuSigf)."from_to"(the default, and the usual transport convention) meansScat[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, andchiwhen the input had one. The derivedSiga,SigTandSigTrare also included for inspection. BecauseRemovalis present,make_materialstakes the data as-is and does not re-zero the diagonal.- Return type:
- 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.