Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Since last release:
power (instead of just using `power_cap`) and flux
(required input for running OpenMC with new version) (#18)
* Add CI test to check if CHANGELOG has been updated (#21)
* Added snapshot_inv() and init_inv() to DepleteReactor.py (#23)

**Changed:**

Expand All @@ -33,7 +34,8 @@ Since last release:

**Fixed:**

* Fixed the sudden loss of core count in the Tick step when the <explicit_inventroy> flag is on.

v 0.1.0
=========
Initial release
Initial release
22 changes: 20 additions & 2 deletions openmcyclus/DepleteReactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def get_material_requests(self): # phase 1
ports: list of dictionaries
Format: [{"commodities":
[{commod_name(str):Material object,
"preference":int/float,
"preference":int/float,
"exclusive":Bool}, ...],
"constraints:int/float}, ...]
Defines the request portfolio for the facility.
Expand Down Expand Up @@ -589,7 +589,6 @@ def discharge(self):
tot_spent += mats.quantity
lib.record_time_series(
"supply" + self.fuel_outcommods[ii], self, tot_spent)

return True

def load(self):
Expand Down Expand Up @@ -843,3 +842,22 @@ def record_position(self):
position_table.add_val("AgentId", self.id, None, "int")
position_table.add_val("Latitude", self.latitude, None, "double")
position_table.add_val("Longitude", self.longitude, None, "double")


def snapshot_inv(self):
"""returns a dictionary of current inventories"""
invs = {
"fresh_fuel": list(self.fresh_fuel),
"core": list(self.core),
"spent_fuel": list(self.spent_fuel)
}
return invs

def init_inv(self,invs):
"""intialized facility inventories"""
if "fresh_fuel" in invs:
self.fresh_fuel.push_many(invs["fresh_fuel"])
if "core" in invs:
self.core.push_many(invs["core"])
if "spent_fuel" in invs:
self.spent_fuel.push_many(invs["spent_fuel"])
Loading