diff --git a/armi/physics/thermalHydraulics/settings.py b/armi/physics/thermalHydraulics/settings.py index a8df91ed2..3975a35e7 100644 --- a/armi/physics/thermalHydraulics/settings.py +++ b/armi/physics/thermalHydraulics/settings.py @@ -34,7 +34,7 @@ def defineSettings(): ), setting.Setting( CONF_TH_KERNEL, - default=False, + default="", label="Thermal Hydraulics Kernel", description="Name of primary T/H solver in this run", ), diff --git a/armi/physics/thermalHydraulics/tests/__init__.py b/armi/physics/thermalHydraulics/tests/__init__.py new file mode 100644 index 000000000..84776603f --- /dev/null +++ b/armi/physics/thermalHydraulics/tests/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2024 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. diff --git a/armi/physics/thermalHydraulics/tests/test_thermalHydraulicsPlugin.py b/armi/physics/thermalHydraulics/tests/test_thermalHydraulicsPlugin.py new file mode 100644 index 000000000..3c9938abc --- /dev/null +++ b/armi/physics/thermalHydraulics/tests/test_thermalHydraulicsPlugin.py @@ -0,0 +1,41 @@ +# Copyright 2024 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. + +"""Unit tests for the thermal hydraulics plugin.""" +from armi.physics import thermalHydraulics +from armi.physics.thermalHydraulics.settings import CONF_DO_TH, CONF_TH_KERNEL +from armi.settings import caseSettings +from armi.tests.test_plugins import TestPlugin + + +class TestThermalHydraulicsPlugin(TestPlugin): + plugin = thermalHydraulics.ThermalHydraulicsPlugin + + def test_thermalHydraulicsSettingsLoaded(self): + """Test that the thermal hydraulics case settings are loaded.""" + cs = caseSettings.Settings() + + self.assertIn(CONF_DO_TH, cs) + self.assertIn(CONF_TH_KERNEL, cs) + + def test_thermalHydraulicsSettingsSet(self): + """Test that the thermal hydraulics case settings are applied correctly.""" + cs = caseSettings.Settings() + thKernelName = "testKernel" + + cs[CONF_DO_TH] = True + cs[CONF_TH_KERNEL] = thKernelName + + self.assertTrue(cs[CONF_DO_TH]) + self.assertEqual(cs[CONF_TH_KERNEL], thKernelName) diff --git a/doc/release/0.4.rst b/doc/release/0.4.rst index 2b69760ac..9151fd113 100644 --- a/doc/release/0.4.rst +++ b/doc/release/0.4.rst @@ -25,6 +25,7 @@ Bug Fixes --------- #. Fixed ``DerivedShape.getArea`` for ``cold=True``. (`PR#1831 `_) #. Fixed error parsing command line integers in ``ReportsEntryPoint``. (`PR#1824 `_) +#. Changed data type of ``thKernel`` setting from ``bool`` to ``str`` in ``ThermalHydraulicsPlugin``. (`PR#1855 `_) #. TBD Quality Work