diff --git a/openmc/cell.py b/openmc/cell.py index e8b9033a96..bcd2e5fd00 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -291,6 +291,7 @@ class Cell(object): @temperature.setter def temperature(self, temperature): + # Make sure temperatures are positive cv.check_type('cell temperature', temperature, (Iterable, Real)) if isinstance(temperature, Iterable): cv.check_type('cell temperature', temperature, Iterable, Real) @@ -298,7 +299,15 @@ class Cell(object): cv.check_greater_than('cell temperature', T, 0.0, True) else: cv.check_greater_than('cell temperature', temperature, 0.0, True) - self._temperature = temperature + + # If this cell is filled with a universe or lattice, propagate + # temperatures to all cells contained. Otherwise, simply assign it. + if self.fill_type in ('universe', 'lattice'): + for c in self.get_all_cells().values(): + if c.fill_type == 'material': + c._temperature = temperature + else: + self._temperature = temperature @offsets.setter def offsets(self, offsets):