-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
335 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Generic fuel performance plugin package. | ||
Fuel performance deals with how nuclear fuel evolves chemically and mechanically with burnup. | ||
It is often a key performance limiter in nuclear reactor design. | ||
The following general phenomena fall into the fuel performance category of physics: | ||
* the fission gas pressure build-up in a solid fuel pin | ||
* the fuel-clad chemical interaction (FCCI) on the inside of fuel cladding | ||
* the fuel-clad mechanical interaction (FCMI) | ||
Fuel performance is always coupled with thermal analysis because the thermal | ||
properties of the fuel change with burnup. | ||
In many cases, fuel performance is coupled with neutronic analysis as well, | ||
because the fission gases are strong neutron absorbers. In some reactors, | ||
significant composition changes during irradiation can influence neutronics | ||
as well (e.g. sodium thermal bond being squeezed out of pins. | ||
""" | ||
from .plugin import FuelPerformancePlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Copyright 2019 TerraPower, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Parameter definitions for fuel performance plugins.""" | ||
from armi.reactor import parameters | ||
from armi.reactor.parameters import ParamLocation | ||
from armi.reactor.blocks import Block | ||
from armi.utils import units | ||
|
||
|
||
def getFuelPerformanceParameterDefinitions(): | ||
"""Return ParameterDefinitionCollections for each appropriate ArmiObject.""" | ||
return {Block: _getFuelPerformanceBlockParams()} | ||
|
||
|
||
def _getFuelPerformanceBlockParams(): | ||
pDefs = parameters.ParameterDefinitionCollection() | ||
with pDefs.createBuilder(default=0.0, location=ParamLocation.AVERAGE) as pb: | ||
|
||
pb.defParam( | ||
"gasReleaseFraction", | ||
units="fraction", | ||
description="Fraction of generated fission gas that no longer exists in the block." | ||
" Should be between 0 and 1, inclusive.", | ||
categories=["eq cumulative shift"], | ||
) | ||
|
||
pb.defParam( | ||
"bondRemoved", | ||
units="fraction", | ||
description="Fraction of thermal bond between fuel and clad that has been pushed out. " | ||
"Should be between 0 and 1, inclusive.", | ||
categories=["eq cumulative shift"], | ||
) | ||
|
||
pb.defParam( | ||
"cladWastage", | ||
units=units.MICRONS, | ||
description="Total cladding wastage from inner and outer surfaces.", | ||
location=ParamLocation.AVERAGE, | ||
categories=["eq cumulative shift"], | ||
) | ||
|
||
pb.defParam( | ||
"totalCladStrain", | ||
units="%", | ||
description="Total diametral clad strain.", | ||
categories=["eq cumulative shift"], | ||
) | ||
|
||
pb.defParam( | ||
"axialGrowthPct", | ||
units="%", | ||
description="Axial growth percentage", | ||
categories=["eq cumulative shift"], | ||
) | ||
|
||
pb.defParam( | ||
"fpPeakFuelTemp", | ||
units="C", | ||
description="Fuel performance calculated peak fuel temperature.", | ||
location=ParamLocation.AVERAGE, | ||
) | ||
|
||
pb.defParam( | ||
"fpAveFuelTemp", | ||
units="C", | ||
description="Fuel performance calculated average fuel temperature.", | ||
location=ParamLocation.AVERAGE, | ||
) | ||
|
||
return pDefs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Copyright 2019 TerraPower, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
""" | ||
Generic Fuel Performance Plugin | ||
""" | ||
|
||
import tabulate | ||
|
||
from armi import plugins | ||
from armi import interfaces | ||
from armi import runLog | ||
from armi.reactor.flags import Flags | ||
from armi.physics.fuelPerformance import settings | ||
|
||
|
||
ORDER = interfaces.STACK_ORDER.CROSS_SECTIONS | ||
|
||
|
||
class FuelPerformancePlugin(plugins.ArmiPlugin): | ||
"""Plugin for fuel performance.""" | ||
|
||
@staticmethod | ||
@plugins.HOOKIMPL | ||
def exposeInterfaces(cs): | ||
"""Expose the fuel performance interfaces.""" | ||
return [] | ||
|
||
@staticmethod | ||
@plugins.HOOKIMPL | ||
def defineSettings(): | ||
"""Define settings for fuel performance.""" | ||
return settings.defineSettings() | ||
|
||
@staticmethod | ||
@plugins.HOOKIMPL | ||
def defineSettingsValidators(inspector): | ||
"""Define settings inspections for fuel performance.""" | ||
return settings.defineValidators(inspector) | ||
|
||
@staticmethod | ||
@plugins.HOOKIMPL | ||
def defineParameters(): | ||
from armi.physics.fuelPerformance import parameters | ||
|
||
return parameters.getFuelPerformanceParameterDefinitions() | ||
|
||
@staticmethod | ||
@plugins.HOOKIMPL | ||
def afterConstructionOfAssemblies(assemblies, cs): | ||
"""After new assemblies are built, set some state information.""" | ||
_setBOLBond(assemblies) | ||
|
||
|
||
def _setBOLBond(assemblies): | ||
"""Set initial bond fractions for each block in the core.""" | ||
assemsWithoutMatchingBond = set() | ||
for a in assemblies: | ||
for b in a: | ||
coolant = b.getComponent(Flags.COOLANT, quiet=True) | ||
bond = b.getComponent(Flags.BOND, quiet=True) | ||
if not bond: | ||
b.p.bondBOL = 0.0 | ||
continue | ||
b.p.bondBOL = sum( | ||
[bond.getNumberDensity(nuc) for nuc in bond.getNuclides()] | ||
) | ||
|
||
if not isinstance(bond.material, coolant.material.__class__): | ||
assemsWithoutMatchingBond.add( | ||
( | ||
a.getType(), | ||
b.getType(), | ||
bond.material.getName(), | ||
coolant.material.getName(), | ||
) | ||
) | ||
|
||
if assemsWithoutMatchingBond: | ||
runLog.warning( | ||
"The following have mismatching `{}` and `{}` materials:\n".format( | ||
Flags.BOND, Flags.COOLANT | ||
) | ||
+ tabulate.tabulate( | ||
list(assemsWithoutMatchingBond), | ||
headers=[ | ||
"Assembly Type", | ||
"Block Type", | ||
"Bond Material", | ||
"Coolant Material", | ||
], | ||
tablefmt="armi", | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Copyright 2019 TerraPower, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Settings related to fuel performance.""" | ||
|
||
from armi.settings import setting2 as setting | ||
from armi.operators.settingsValidation import Query | ||
|
||
|
||
CONF_FUEL_PERFORMANCE_ENGINE = "fuelPerformanceEngine" | ||
CONF_AXIAL_EXPANSION = "axialExpansion" | ||
CONF_BOND_REMOVAL = "bondRemoval" | ||
CONF_FGR_REMOVAL = "fgRemoval" | ||
CONF_CLADDING_WASTAGE = "claddingWastage" | ||
CONF_CLADDING_STRAIN = "claddingStrain" | ||
|
||
|
||
def defineSettings(): | ||
"""Define generic fuel performance settings.""" | ||
settings = [ | ||
setting.Setting( | ||
CONF_FUEL_PERFORMANCE_ENGINE, | ||
default="", | ||
label="Fuel Performance Engine", | ||
description=( | ||
"Fuel performance engine that determines fission gas removal, bond removal," | ||
" axial growth, wastage, and cladding strain." | ||
), | ||
options=[""], | ||
), | ||
setting.Setting( | ||
CONF_AXIAL_EXPANSION, | ||
default=False, | ||
label="Fuel Axial Expansion", | ||
description="Perform axial fuel expansion. This will adjust fuel block lengths.", | ||
), | ||
setting.Setting( | ||
CONF_BOND_REMOVAL, | ||
default=False, | ||
label="Thermal Bond Removal", | ||
description="Toggles fuel performance bond removal. This will remove thermal bond from the fuel.", | ||
), | ||
setting.Setting( | ||
CONF_FGR_REMOVAL, | ||
default=False, | ||
label="Fission Gas Removal", | ||
description="Toggles fuel performance fission gas removal. This will remove fission gas from the fuel.", | ||
), | ||
setting.Setting( | ||
CONF_CLADDING_WASTAGE, | ||
default=False, | ||
label="Cladding Wastage", | ||
description="Evaluate cladding wastage. ", | ||
), | ||
setting.Setting( | ||
CONF_CLADDING_STRAIN, | ||
default=False, | ||
label="Cladding Strain", | ||
description="Evaluate cladding strain. ", | ||
), | ||
] | ||
return settings | ||
|
||
|
||
def defineValidators(inspector): | ||
return [ | ||
Query( | ||
lambda: ( | ||
inspector.cs["axialExpansion"] | ||
or inspector.cs["bondRemoval"] | ||
or inspector.cs["fgRemoval"] | ||
or inspector.cs["claddingWastage"] | ||
or inspector.cs["claddingStrain"] | ||
) | ||
and inspector.cs["fuelPerformanceEngine"] == "", | ||
"A fuel performance behavior has been selected but no fuel performance engine is selected.", | ||
"", | ||
inspector.NO_ACTION, | ||
), | ||
Query( | ||
lambda: ( | ||
inspector.cs["axialExpansion"] | ||
or inspector.cs["bondRemoval"] | ||
or inspector.cs["fgRemoval"] | ||
or inspector.cs["claddingWastage"] | ||
or inspector.cs["claddingStrain"] | ||
) | ||
and not inspector.cs["doTH"], | ||
"A fuel performance behavior has been selected which may require thermal-hydraulics.", | ||
"Would you like to turn the TH option on?", | ||
# pylint: disable=protected-access | ||
lambda: inspector._assignCS("doTH", True), | ||
), | ||
] |
Empty file.
15 changes: 15 additions & 0 deletions
15
armi/physics/fuelPerformance/tests/test_fuelPerformancePlugin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Tests for generic fuel performance plugin. | ||
""" | ||
import unittest | ||
|
||
from armi.tests.test_plugins import TestPlugin | ||
from armi.physics.fuelPerformance.plugin import FuelPerformancePlugin | ||
|
||
|
||
class TestFuelPerformancePlugin(TestPlugin): | ||
plugin = FuelPerformancePlugin | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters