Specify temperature from a field (structured mesh only) #3734
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a new way to specify temperature using a field based on a spatial mesh. The motivation for this work is to simplify data transfer (and workflow) when working with multi-physics framework (e.g., Cardinal). It is limited to structured mesh now as a way to get started, but the objective is to add more complexity (support to unstructured mesh via the XDG library) with follow-up PRs.
This work is still in progress (draft PR).
I am planning to:
Do not hesitate to start a conversation here if you are interested in this feature and want to share any ideas!
More details on the implementation
This feature relies on a minimal interface with the mesh class (via the methods get_bin() and distance_to_next_boundary()) which is expected to simplify the connection with unstructured mesh classes once XDG functionalities are available in OpenMC.
In this PR, the temperature field is defined as the association of a spatial mesh and a list of temperature values corresponding to each mesh cell. The temperature in each mesh cell is considered constant in the entire volume of the mesh cell. Now, every time a particle is advancing, OpenMC also checks the distance to the next boundary associated with the mesh of the temperature field. The temperature associated with the particle is updated in three different scenarios (first time the particle is in the transport loop, after crossing a geometric cell boundary, and after crossing a boundary from the mesh of the temperature field) and will take precedence over any temperature value defined for the cell, material, or globally.
Checklist