Class SweepChunk

Inheritance Relationships

Derived Types

Class Documentation

class SweepChunk

Sweep work function.

Subclassed by opensn::AAHCSDASweepChunk, opensn::AAHDSweepChunk, opensn::AAHSweepChunk, opensn::AAHSweepChunkRZ, opensn::AAHSweepChunkSpherical, opensn::AAHSweepChunkTD, opensn::CBCDSweepChunk, opensn::CBCSweepChunk, opensn::CBCSweepChunkTD

Public Types

using MomentCallbackFunc = std::function<void(SweepChunk *sweeper, AngleSet *angle_set)>

Convenient typdef for the moment call back function. See moment_callbacks.

Public Functions

inline SweepChunk(std::vector<double> &destination_phi, std::vector<double> &destination_psi, const std::shared_ptr<Mesh> &grid, const SpatialDiscretization &discretization, const std::vector<UnitCellMatrices> &unit_cell_matrices, const std::vector<CellLBSView> &cell_transport_views, std::vector<CellOutflowView> &cell_outflow_views, const std::vector<double> &source_moments, const LBSGroupset &groupset, const BlockID2XSMap &xs, unsigned int num_moments, unsigned int max_num_cell_dofs, unsigned int min_num_cell_dofs)
virtual void Sweep(AngleSet &angle_set)

Sweep chunks should override this.

virtual void SetAngleSet(AngleSet &angle_set)

Sets the currently active angleset.

void SetCell(Cell const *cell_ptr)

Sets the active cell for cell-by-cell sweeps.

virtual void ZeroDestinationPhi()

Zero the portion of the output flux moments vector corresponding to the groupset for this sweep chunk.

inline void ZeroDestinationPsi()

Sets all elements of the output angular flux vector to zero.

inline bool SaveAngularFluxEnabled() const

Returns true if angular flux storage is allocated.

inline void SetBoundarySourceActiveFlag(bool flag_value)

Activates or deactivates the surface src flag.

inline bool IsSurfaceSourceActive() const

Returns the surface src-active flag.

inline void IncludeRHSTimeTerm(bool status)

Include contribution from previous psi_n in RHS source term.

inline virtual bool IsTimeDependent() const
virtual void SetDestinationsFromAngularFlux(const AngleAggregation &angle_agg)

Overwrite this groupset’s scalar flux moments and outflows with sums over the stored angular flux in a fixed order: angle sets in aggregation order, then their directions.

Parameters:

angle_agg – Angle aggregation of the groupset; its order fixes the summation order.

virtual ~SweepChunk() = default

Public Members

std::vector<MomentCallbackFunc> moment_callbacks

Functions of type MomentCallbackFunc can be added to the moment_callbacks vector and these can be called from within functions taking a LBSGroupset instance.

The intention is that this function can be used as a general interface to retrieve angular flux values

Protected Functions

void ComputeDestinationsFromAngularFlux(const AngleAggregation &angle_agg, const std::vector<double> &psi)

Overwrite the scalar flux moments and outflows with fixed-order sums over an angular flux.

Parameters:
  • angle_agg – Angle aggregation of the groupset; its order fixes the summation order.

  • psi – Angular flux laid out like destination_psi_.

void ComputeTimeDependentDestinationsFromAngularFlux(const AngleAggregation &angle_agg, const std::vector<double> &psi_old, double theta)

Overwrite the scalar flux moments and outflows of a time-dependent sweep.

The moments are those of psi^{n+theta} = theta psi^{n+1} + (1 - theta) psi^n, while destination_psi_ holds psi^{n+1}.

Parameters:
  • angle_agg – Angle aggregation of the groupset; its order fixes the summation order.

  • psi_old – Angular flux psi^n at the start of the time step.

  • theta – Time-integration parameter of the theta scheme.

Protected Attributes

const std::shared_ptr<Mesh> grid_
const SpatialDiscretization &discretization_
const std::vector<UnitCellMatrices> &unit_cell_matrices_
const std::vector<CellLBSView> &cell_transport_views_
std::vector<CellOutflowView> &cell_outflow_views_
const std::vector<double> &source_moments_
const LBSGroupset &groupset_
const BlockID2XSMap &xs_
const unsigned int num_moments_
const unsigned int max_num_cell_dofs_
const unsigned int min_num_cell_dofs_
const size_t groupset_angle_group_stride_
const size_t groupset_group_stride_
std::vector<double> &destination_phi_
std::vector<double> &destination_psi_
std::vector<double> psi_theta_

Angular flux at time n + theta, used by ComputeTimeDependentDestinationsFromAngularFlux.

bool surface_source_active_ = false
bool include_rhs_time_term_ = true
const Cell *cell_