Class UncollidedProblem
Defined in File uncollided_problem.h
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public opensn::LBSProblem(Class LBSProblem)
Class Documentation
-
class UncollidedProblem : public opensn::LBSProblem
Public Functions
-
~UncollidedProblem() override
-
inline virtual void ClearBoundaries() override
Clears all the boundary conditions from the solver.
-
void BuildSourcePoints()
Generation steps run by UncollidedSolver: locate the point sources, add their images in the reflecting planes, and compute and write the uncollided flux moments.
-
void AddReflectedSourcePoints()
-
void Execute(const std::string &file_name, unsigned int progress_interval)
Public Static Functions
-
static InputParameters GetInputParameters()
-
static std::shared_ptr<UncollidedProblem> Create(const ParameterBlock ¶ms)
Protected Functions
-
explicit UncollidedProblem(const InputParameters ¶ms)
Factory-only constructor.
-
virtual void CheckConfigurationErrors(std::vector<std::string> &errors) const override
Uncollided-generation rules.
-
virtual void PrintSimHeader() override
-
virtual void InitializeSpatialDiscretization() override
-
void BuildSweepOrdering(const SourcePoint &source_point)
-
std::vector<ReflectionPlane> ComputeReflectionPlanes(std::vector<std::string> &errors) const
Returns the planes of the reflecting boundaries and appends an error for each invalid boundary condition.
-
virtual void BuildRuntimeData() override
Stores the reflection planes once the configuration has been validated.
-
void RaytraceNearSourceRegion(const SourcePoint &source_point)
-
void ProjectReflectedImageSources(unsigned int progress_interval)
-
std::vector<double> RaytraceLine(RayTracer &ray_tracer, const Cell &cell, const Vector3 &qp_xyz, const SourcePoint &source_point, double tolerance = 1.0e-12)
-
void RaytraceLineInto(RayTracer &ray_tracer, const Cell &cell, const Vector3 &qp_xyz, const SourcePoint &source_point, std::vector<double> &phi_out, std::vector<std::pair<size_t, double>> &scratch_segs, std::vector<double> &scratch_bp, std::vector<double> &scratch_mfp, double tolerance = 1.0e-12)
Zero-allocation variant: writes into pre-allocated
phi_outand reuses the three scratch vectors.All four buffers must be sized to
num_groups_before the first call (they are reset internally each call, so no manual clearing is needed between calls). On return,scratch_mfpholds the optical depth from the source toqp_xyzper group.
-
std::optional<ExactCellIntegrals> IntegrateCellExactly(RayTracer &ray_tracer, const Cell &cell, const SourcePoint &source_point)
Integrates the uncollided flux of a point source over a cell, and its leakage through each outgoing face, exactly over direction.
Every direction from the source through the cell leaves it through an outgoing face. Along it the flux is S exp(-tau(r)) / (4 pi r^2), so with tau_in the optical depth from the source to where the ray enters the cell and Delta the chord through the homogeneous cell, the leakage integrand is S exp(-tau_in - sigma_t Delta) / (4 pi) and the volume integrand is S exp(-tau_in) (1 - exp(-sigma_t Delta)) / (4 pi sigma_t). The optical depth comes from ray tracing, so heterogeneous media are handled. For the cell containing the source, the ray starts in the cell, so tau_in = 0 and Delta is the distance to the face.
The directions through each PWL side triangle of each outgoing face are integrated with a composite Gauss-Legendre rule in variables that keep the integrands smooth however close the source is to a face, edge, or vertex, at points that lie on the face.
Returns std::nullopt when a ray from the source could cross the cell more than once: for a cell that does not contain the source, when it is not convex; and for the cell containing the source, when a face is not directly visible from it. Also returns std::nullopt when the source is on the inner side of a face that is not outgoing.
-
double SubtendedAngleFraction(const Cell &cell, const Vector3 &point) const
Returns the fraction of the full solid angle that a cell subtends at a point on or in it.
The signed solid angles of the PWL side triangles of the cell’s faces are summed, so the result is exact for cells of any shape, including non-convex ones. It is 1 for a point inside the cell, 1/2 on a planar face, and smaller on an edge or vertex.
-
bool IsConvex(const Cell &cell) const
True when every vertex of the cell lies on the inner side of the plane of every face.
-
void SweepBulkRegion(const SourcePoint &source_point)
-
UncollidedMatrices ComputeUncollidedIntegrals(const Cell &cell, const Vector3 &pt_loc)
-
void UpdateBalance(const SourcePoint &source_point)
-
void WriteFluxMoments(hid_t file)
-
void FinalizeBalance(hid_t file)
-
inline bool IsReflectingBoundary(std::uint64_t boundary_id) const
Protected Attributes
-
std::vector<std::shared_ptr<LogicalVolume>> near_source_logvols_
Near source region logical volumes.
-
std::vector<SourcePoint> source_points_
-
std::vector<SourcePoint> reflected_source_points_
-
std::vector<std::pair<std::string, std::string>> boundary_conditions_
Boundary conditions as (name, type).
-
std::vector<ReflectionPlane> reflection_planes_
-
std::set<std::uint64_t> reflecting_boundary_ids_
-
std::vector<std::vector<FaceOrientation>> cell_face_orientations_
Cell face orientations for the cells in the local cell graph.
-
std::vector<size_t> near_spls_
Near source uncollided sweep-plane local subgrid.
-
std::vector<size_t> bulk_spls_
Bulk region uncollided sweep-plane local subgrid.
-
std::vector<CellRegion> cell_regions_
-
std::vector<double> destination_phi_
-
std::vector<double> cell_sizes_
Bounding-box diagonal for each local cell, pre-computed once for RayTracer tolerance scaling.
-
bool all_cells_convex_ = true
False when the mesh contains any geometrically non-convex cell; true for standard hex/tet meshes.
-
std::vector<FaceVertData> all_face_verts_
-
std::vector<uint32_t> cell_face_offsets_
-
std::vector<uint32_t> cell_num_faces_
-
std::unordered_map<uint64_t, uint32_t> global_to_local_id_
O(1) global-to-local cell-ID lookup; replaces two O(log N) std::map calls per while-loop step.
-
bool use_fast_trace_ = false
True when all_cells_convex_ and all faces have <= FaceVertData::max_sides vertices.
-
unsigned int ell_max_ = 0
-
bool exact_near_source_leakage_ = false
Integrate the leakages and volume integrals of the cells that share a vertex with a point source’s cell exactly over direction instead of with spatial quadrature.
-
std::vector<std::string> moment_names_
-
std::vector<std::vector<double>> accumulated_moments_
-
double production_ = 0.
-
double physical_removal_ = 0.
-
double reflected_removal_ = 0.
-
double out_flow_ = 0.
Protected Static Functions
-
struct ExactCellIntegrals
Integrals of the uncollided flux of a point source over a cell.
-
struct FaceVertData
Precomputed face vertex data — bypasses the std::map-backed VertexHandler in the hot path.
Supports faces with up to max_sides vertices (covers common polyhedral mesh faces).
Public Static Attributes
-
static uint32_t max_sides = 8
-
static uint32_t max_sides = 8
-
struct Moment
-
struct ReflectionPlane
-
struct SourcePoint
Public Members
-
std::vector<double> strength
-
std::vector<Subscriber> subscribers
-
std::shared_ptr<LogicalVolume> near_source_logvol
-
std::vector<ReflectionPlane> reflection_planes
-
struct Subscriber
-
std::vector<double> strength
-
~UncollidedProblem() override