pyopensn.solver.LBSProblem

class pyopensn.solver.LBSProblem

Base class for all linear Boltzmann problems.

Wrapper of opensn::LBSProblem.

ComputeFissionRate(self: pyopensn.solver.LBSProblem, scalar_flux_iterate: str) float

Computes the total fission rate.

Parameters:

scalar_flux_iterate ({'old', 'new'}) –

Specifies which scalar flux vector to use in the calculation.
  • ’old’: Use the previous scalar flux iterate.

  • ’new’: Use the current scalar flux iterate.

Returns:

The total fission rate.

Return type:

float

Raises:

ValueError – If scalar_flux_iterate is not ‘old’ or ‘new’.

CreateAndWriteSourceMoments(self: pyopensn.solver.LBSProblem, file_base: str) None

Write source moments from latest flux iterate to file.

Parameters:

file_base (str) – File basename.

GetFieldFunctions(self: pyopensn.solver.Problem) list

Get the list of field functions.

Returns:

List of grid-based field functions representing solution data such as scalar fluxes.

Return type:

List[pyopensn.fieldfunc.FieldFunctionGridBased]

GetPowerFieldFunction(self: pyopensn.solver.LBSProblem) pyopensn.fieldfunc.FieldFunctionGridBased

Returns the power generation field function, if enabled.

GetScalarFieldFunctionList(self: pyopensn.solver.LBSProblem, only_scalar_flux: bool = True) list

Return field functions grouped by energy group and, optionally, by moment.

Parameters:

only_scalar_flux (bool, default=True) –

If True, returns only the zeroth moment (scalar flux) field function for each group. The result is a flat list of field functions, one per group.

If False, returns all moment field functions for each group. The result is a nested list where each entry corresponds to a group and contains a list of field functions for all moments (e.g., scalar flux, higher-order moments).

Returns:

The structure of the returned list depends on the only_scalar_flux flag.

Return type:

Union[List[pyopensn.fieldfunc.FieldFunctionGridBased], List[List[pyopensn.fieldfunc.FieldFunctionGridBased]]]

Notes

The moment index varies more rapidly than the group index when only_scalar_flux is False.

ReadAngularFluxes(self: pyopensn.solver.LBSProblem, file_base: str) None

Read angular fluxes from file.

Parameters:

file_base (str) – File basename.

ReadFluxMoments(self: pyopensn.solver.LBSProblem, file_base: str, single_file_flag: bool) None

Read flux moment data.

Parameters:
  • file_base (str) – File basename.

  • single_file_flag (bool) – True if all flux moments are in a single file.

ReadFluxMomentsAndMakeSourceMoments(self: pyopensn.solver.LBSProblem, file_base: str, single_file_flag: bool) None

Read flux moments and compute corresponding source moments.

Parameters:
  • file_base (str) – File basename.

  • single_file_flag (bool) – True if all flux moments are in a single file.

ReadSourceMoments(self: pyopensn.solver.LBSProblem, file_base: str, single_file_flag: bool) None

Read source moments from file.

Parameters:
  • file_base (str) – File basename.

  • single_file_flag (bool) – True if all source moments are in a single file.

SetOptions(self: pyopensn.solver.LBSProblem, **kwargs) None

Set problem options from a large list of parameters.

Parameters:
  • spatial_discretization (str, default='pwld') – What spatial discretization to use. Currently only pwld is supported.

  • scattering_order (int, default=1) – The level of harmonic expansion for the scattering source.

  • max_mpi_message_size (int default=32768) – The maximum MPI message size used during sweeps.

  • restart_writes_enabled (bool, default=False) – Flag that controls writing of restart dumps.

  • write_delayed_psi_to_restart (bool, default=True) – Flag that controls writing of delayed angular fluxes to restarts.

  • read_restart_path (str, default='') – Full path for reading restart dumps including file basename.

  • write_restart_path (str, default='') – Full path for writing restart dumps including file basename.

  • write_restart_time_interval (int, default=0) – Time interval in seconds at which restart data is to be written.

  • use_precursors (bool, default=False) – Flag for using delayed neutron precursors.

  • use_source_moments (bool, default=False) – Flag for ignoring fixed sources and selectively using source moments obtained elsewhere.

  • save_angular_flux (bool, default=False) – Flag indicating whether angular fluxes are to be stored or not.

  • adjoint (bool, default=False) – Flag for toggling whether the solver is in adjoint mode.

  • verbose_inner_iterations (bool, default=True) – Flag to control verbosity of inner iterations.

  • verbose_outer_iterations (bool, default=True) – Flag to control verbosity of across-groupset iterations.

  • max_ags_iterations (int, default=100) – Maximum number of across-groupset iterations.

  • ags_tolerance (float, default=1.0e-6) – Across-groupset iterations tolerance.

  • ags_convergence_check ({'l2', 'pointwise'}, default='l2') – Type of convergence check for AGS iterations.

  • verbose_ags_iterations (bool, default=True) – Flag to control verbosity of across-groupset iterations.

  • power_field_function_on (bool, default=False) – Flag to control the creation of the power generation field function. If set to True, a field function will be created with the general name <solver_name>_power_generation.

  • power_default_kappa (float, default=3.20435e-11) – Default kappa value (Energy released per fission) to use for power generation when cross sections do not have kappa values. Default corresponds to 200 MeV per fission.

  • power_normalization (float, default=-1.0) – Power normalization factor to use. Supply a negative or zero number to turn this off.

  • field_function_prefix_option ({'prefix', 'solver_name'}, default='prefix') – Prefix option on field function names. If unset, flux field functions will be exported as phi_gXXX_mYYY, where XXX is the zero-padded 3-digit group number and YYY is the zero-padded 3-digit moment.

  • field_function_prefix (str, default='') – Prefix to use on all field functions. By default, this is empty. If specified, flux moments are exported as prefix_phi_gXXX_mYYY.

  • boundary_conditions (List[Dict], default=[]) – A list containing tables for each boundary specification.

  • clear_boundary_conditions (bool, default=False) – Clears all boundary conditions. If no additional boundary conditions are supplied, all boundaries become vacuum.

  • point_sources (List[pyopensn.source.PointSource], default=[]) – A list of point sources.

  • clear_point_sources (bool, default=False) – Clear all point sources.

  • volumetric_sources (List[pyopensn.source.VolumetricSource], default=[]) – A list of volumetric sources.

  • clear_volumetric_sources (bool, default=False) – Clear all volumetric sources.

WriteAngularFluxes(self: pyopensn.solver.LBSProblem, file_base: str) None

Write angular flux data to file.

Parameters:

file_base (str) – File basename.

WriteFluxMoments(self: pyopensn.solver.LBSProblem, file_base: str) None

Write flux moments to file.

Parameters:

file_base (str) – File basename.