mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
updated input files
This commit is contained in:
parent
b0a5be1c1c
commit
6b1ff61284
9 changed files with 9 additions and 51 deletions
|
|
@ -83,6 +83,7 @@ water.add_macroscopic(h2o_data)
|
|||
|
||||
# Instantiate a Materials collection and export to XML
|
||||
materials_file = openmc.Materials([uo2, water])
|
||||
materials_file.cross_sections = "./mgxs.h5"
|
||||
materials_file.export_to_xml()
|
||||
|
||||
|
||||
|
|
@ -132,7 +133,6 @@ geometry.export_to_xml()
|
|||
# Instantiate a Settings object, set all runtime parameters, and export to XML
|
||||
settings_file = openmc.Settings()
|
||||
settings_file.energy_mode = "multi-group"
|
||||
settings_file.cross_sections = "./mgxs.h5"
|
||||
settings_file.batches = batches
|
||||
settings_file.inactive = inactive
|
||||
settings_file.particles = particles
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<cross_sections>./mgxs.h5</cross_sections>
|
||||
|
||||
<!-- UO2 -->
|
||||
<material id="1">
|
||||
<density units="macro" value="1.0" />
|
||||
|
|
|
|||
|
|
@ -34,6 +34,4 @@
|
|||
|
||||
<survival_biasing>false</survival_biasing>
|
||||
|
||||
<cross_sections>./mgxs.h5</cross_sections>
|
||||
|
||||
</settings>
|
||||
|
|
|
|||
|
|
@ -276,6 +276,7 @@ class Element(object):
|
|||
# Create a list of the isotopes in this element
|
||||
isotopes = []
|
||||
for nuclide, abundance in zip(nuclides, abundances):
|
||||
isotopes.append((nuclide, percent*abundance, percent_type))
|
||||
pct = float('{:2.8g}'.format(percent*abundance))
|
||||
isotopes.append((nuclide, pct, percent_type))
|
||||
|
||||
return isotopes
|
||||
|
|
|
|||
|
|
@ -759,16 +759,6 @@ class Materials(cv.CheckedList):
|
|||
cross section library. If it is not set, the
|
||||
:envvar:`OPENMC_MULTIPOLE_LIBRARY` environment variable will be used. A
|
||||
multipole library is optional.
|
||||
temperature : dict
|
||||
Defines a default temperature and method for treating intermediate
|
||||
temperatures at which nuclear data doesn't exist. Accepted keys are
|
||||
'default', 'method', 'tolerance', and 'multipole'. The value for
|
||||
'default' should be a float representing the default temperature in
|
||||
Kelvin. The value for 'method' should be 'nearest' or 'interpolation'.
|
||||
If the method is 'nearest', 'tolerance' indicates a range of temperature
|
||||
within which cross sections may be used. 'multipole' is a boolean
|
||||
indicating whether or not the windowed multipole method should be used
|
||||
to evaluate resolved resonance cross sections.
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -778,7 +768,6 @@ class Materials(cv.CheckedList):
|
|||
self._materials_file = ET.Element("materials")
|
||||
self._cross_sections = None
|
||||
self._multipole_library = None
|
||||
self._temperature = {}
|
||||
|
||||
if materials is not None:
|
||||
self += materials
|
||||
|
|
@ -791,10 +780,6 @@ class Materials(cv.CheckedList):
|
|||
def multipole_library(self):
|
||||
return self._multipole_library
|
||||
|
||||
@property
|
||||
def temperature(self):
|
||||
return self._temperature
|
||||
|
||||
@cross_sections.setter
|
||||
def cross_sections(self, cross_sections):
|
||||
cv.check_type('cross sections', cross_sections, string_types)
|
||||
|
|
@ -805,23 +790,6 @@ class Materials(cv.CheckedList):
|
|||
cv.check_type('cross sections', multipole_library, string_types)
|
||||
self._multipole_library = multipole_library
|
||||
|
||||
@temperature.setter
|
||||
def temperature(self, temperature):
|
||||
cv.check_type('temperature settings', temperature, Mapping)
|
||||
for key, value in temperature.items():
|
||||
cv.check_value('temperature key', key,
|
||||
['default', 'method', 'tolerance', 'multipole'])
|
||||
if key == 'default':
|
||||
cv.check_type('default temperature', value, Real)
|
||||
elif key == 'method':
|
||||
cv.check_value('temperature method', value,
|
||||
['nearest', 'interpolation'])
|
||||
elif key == 'tolerance':
|
||||
cv.check_type('temperature tolerance', value, Real)
|
||||
elif key == 'multipole':
|
||||
cv.check_type('temperature multipole', value, bool)
|
||||
self._temperature = temperature
|
||||
|
||||
def add_material(self, material):
|
||||
"""Append material to collection
|
||||
|
||||
|
|
@ -917,13 +885,6 @@ class Materials(cv.CheckedList):
|
|||
element = ET.SubElement(self._materials_file, "multipole_library")
|
||||
element.text = str(self._multipole_library)
|
||||
|
||||
def _create_temperature_subelements(self):
|
||||
if self.temperature:
|
||||
for key, value in sorted(self.temperature.items()):
|
||||
element = ET.SubElement(self._materials_file,
|
||||
"temperature_{}".format(key))
|
||||
element.text = str(value)
|
||||
|
||||
def export_to_xml(self, path='materials.xml'):
|
||||
"""Export material collection to an XML file.
|
||||
|
||||
|
|
@ -940,7 +901,6 @@ class Materials(cv.CheckedList):
|
|||
self._create_material_subelements()
|
||||
self._create_cross_sections_subelement()
|
||||
self._create_multipole_library_subelement()
|
||||
self._create_temperature_subelements()
|
||||
|
||||
# Clean the indentation in the file to be user-readable
|
||||
sort_xml_elements(self._materials_file)
|
||||
|
|
|
|||
|
|
@ -721,10 +721,6 @@ class Settings(object):
|
|||
@temperature.setter
|
||||
def temperature(self, temperature):
|
||||
|
||||
warnings.warn('Settings.temperature has been deprecated and will '
|
||||
'be removed in a future version. Materials.temperature '
|
||||
'should defined instead.', DeprecationWarning)
|
||||
|
||||
cv.check_type('temperature settings', temperature, Mapping)
|
||||
for key, value in temperature.items():
|
||||
cv.check_value('temperature key', key,
|
||||
|
|
|
|||
|
|
@ -2095,7 +2095,7 @@ contains
|
|||
&find MG cross section libraries. Please consult the user's &
|
||||
&guide at http://mit-crpg.github.io/openmc for information on &
|
||||
&how to set up MG cross section libraries.")
|
||||
else
|
||||
else if (len_trim(env_variable) /= 0) then
|
||||
path_cross_sections = trim(env_variable)
|
||||
end if
|
||||
end if
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
f270ae43a29c53065678b419629ad713f5a4cc23c75825fee4da049d4159756f463fec86263a8dea6ce10fff6d60b24ebf100e8f5cc80e6d4fc31297ae1709ed
|
||||
89207d3b5639e54be2d2a3e4f8ea38a3b7d438c3d3da9d80d76b9fed9f2d44168dfad0ea273891a817ea87ba144107fdd3b9e1b89a2c8c08880a53d645e4af9a
|
||||
|
|
@ -1 +1 @@
|
|||
835357f7b3c10f1153bb5842978075d9bb788d639759f143dfe58064865712fdf4e17ce50747949411e7c5215f33371e883e48b670509e222fa338bbfe613b80
|
||||
87a238e2fef484680349715d37fcac80b10a8b503381923e1aa324c462156802dc01ce07a38ab5d00878dbe26cebede7879227c819334be071086c8b5cb3e5ee
|
||||
Loading…
Add table
Add a link
Reference in a new issue