Skip to content

Generalize RotationalPeriodicBC to allow periodicity around x and y axes #3559

@lewisgross1296

Description

@lewisgross1296

Description

Currently, OpenMC allows rotational periodic boundary conditions to be set for two surfaces as long as the cross product of their normal vectors at the origin is in the z-direction. This allows for a rotational periodic boundary condition for rotations solely around the z-axis.

In terms of neutronics, there is nothing special about the z-axis, however other models that use OpenMC as a part of a multiphysics framework may need periodicity around a different axis. For example, a reactor with coolant flowing in the x or y direction may want to save computational resources by having a periodic boundary around either of those axes. While neutronics is not affected by gravity, coolant flow needs to be in a particular direction, e.g. for buoyancy effects, and so it would be extremely useful to have rotational periodicity for rotations around any of the x, y, or z axes. Currently, you can set any two surface to be periodic, but if you try to do rotational periodicity around, e.g. the y-axis, you get an error message like

terminate called after throwing an instance of 'std::invalid_argument'
  what():  Rotational periodic BCs are only supported for rotations about the z-axis, but surface 955436 is not perpendicular to the z-axis.

Alternatives

There is no alternative. You simply cannot do periodic BCs if your two periodic planes do not intersect along the z-axis.

Compatibility

The feature should not change the actual method signatures, but it will allow more types of surfaces to be paired together in XML as periodic. It will require some generalization of the existing src/boundary_condition.cpp, but it's mostly a mathematical task, coupled with some good error checking and test cases.

In theory, there is a direction around which two arbitrary surfaces can be periodic via some rotation about some commonly intersected line. However, I'm proposing to only support rotational periodicity if it's a rotation around one of x,y, or z. While it doesn't support arbitrary periodicity, I believe most use cases will want periodic boundary conditions around the main cardinal axes. There is an open PR to support arbitrary transformations that the user specifies, so perhaps more complicated cases could be handled via that PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions