mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Allow temperatures to be assigned to heterogeneous cells
This commit is contained in:
parent
459d3375ca
commit
7175f8ed44
1 changed files with 10 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue