Commit 080fedb3 authored by Patrick Shriwise's avatar Patrick Shriwise
Browse files

Merge branch 'openmc-model-gb' into 'yslan'

Add 127k OpenMC model

See merge request !7
parents 61451fe2 d9b71435
...@@ -18,7 +18,7 @@ ann127602 N, Version 3.2, E39,240,190 ...@@ -18,7 +18,7 @@ ann127602 N, Version 3.2, E39,240,190
- Cylinder (inner) radius = 24.256 (W01, convert to Wall in production run) - Cylinder (inner) radius = 24.256 (W01, convert to Wall in production run)
- Cylinder (outer) radius = 87.895 (W02, convert to Wall in production run) - Cylinder (outer) radius = 87.895 (W02, convert to Wall in production run)
- Zbot of the cylinder = -27.010 (W03, convert to Inflow in production run) - Zbot of the cylinder = -27.010 (W03, convert to Inflow in production run)
- Ztop of the cylinder = -29.031 (W04, convert to Outflow in production run) - Ztop of the cylinder = 29.031 (W04, convert to Outflow in production run)
``` ```
xyz min -87.895 -87.895 -27.010 xyz min -87.895 -87.895 -27.010
xyz max 87.895 87.895 29.031 xyz max 87.895 87.895 29.031
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1" name="m_fuel - uranium oxycarbide - triso particles">
<density units="g/cm3" value="10.5" />
<nuclide name="U234" wo="0.03565284" />
<nuclide name="U235" wo="17.790767159999998" />
<nuclide name="U238" wo="71.75358" />
<nuclide name="C0" wo="1.8" />
<nuclide name="O16" wo="8.616527990092724" />
<nuclide name="O17" wo="0.003472009907274255" />
</material>
<material id="2" name="m_graphite_c_buffer - triso particles">
<density units="g/cm3" value="1.0" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="3" name="m_graphite_pyc - triso particles">
<density units="g/cm3" value="1.87" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="4" name="sic - triso particles">
<density units="g/cm3" value="3.2" />
<nuclide ao="1.0" name="C0" />
<nuclide ao="0.9222968" name="Si28" />
<nuclide ao="0.0468316" name="Si29" />
<nuclide ao="0.0308716" name="Si30" />
</material>
<material id="5" name="m_graphite_matrix - triso particles">
<density units="g/cm3" value="1.6" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="6" name="m_graphite_inner - pebble inner zone">
<density units="g/cm3" value="1.59368" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="7" name="m_graphite_outer - pebble outer zone">
<density units="g/cm3" value="1.74" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="8" name="m_flibe - 2LiF-BeF2">
<density units="kg/m3" value="1962.13354" />
<nuclide ao="1.9999" name="Li7" />
<nuclide ao="9.999999999998899e-05" name="Li6" />
<nuclide ao="1.0" name="Be9" />
<nuclide ao="4.0" name="F19" />
</material>
<material id="9" name="m_reflector">
<density units="kg/m3" value="1668.9749564800002" />
<nuclide ao="4437.662889564637" name="Li7" />
<nuclide ao="0.22189423919016693" name="Li6" />
<nuclide ao="2218.9423919019137" name="Be9" />
<nuclide ao="8875.769567607655" name="F19" />
<nuclide ao="120656.24049957683" name="C0" />
<sab name="c_Graphite" />
</material>
</materials>
import os
import math
import numpy as np
import openmc
import openmc.model
import pandas as pd
import scipy.stats
from math import pi
from IPython.display import Image
import matplotlib.pyplot as plt
# -------------- Unit Conversions -----------
mm = 0.1 # default cm
μm = 1e-4 # default cm
# -------------- Output Parameters -------
voxel = False # Set 1 to generate 3d voxel plots and 0 for 2d ppm plots
random_distribution = False # Set 1 for TRISO particles random distribution and 0 for regular (simple cubic) lattice
verbose = True
# -------------- Functions ------------------
def density_flibe(p, t):
"""
Returns FLiBe density at a pressure, p,
and temperature, t in units of kg/m3
"""
# assumes the default value for drho_dp of 1.7324e-7
rho = -0.4884*t + 1.7324e-7*(p - 101325.0) + 2413.0 # kg/m3
return rho
# -------------- Geometry Parameters --------
# TRISO particle
radius_fuel = 400.0*μm/2 # UCBTH-14-002, Table 2-1
thickness_c_buffer = 100.0*μm # UCBTH-14-002, Table 2-1
thickness_pyc_inner = 35.0*μm # UCBTH-14-002, Table 2-1
thickness_sic = 35.0*μm # UCBTH-14-002, Table 2-1
thickness_pyc_outer = 35.0*μm # UCBTH-14-002, Table 2-1
radius_c_buffer = radius_fuel + thickness_c_buffer
radius_pyc_inner = radius_c_buffer + thickness_pyc_inner
radius_sic = radius_pyc_inner + thickness_sic
radius_pyc_outer = radius_sic + thickness_pyc_outer
packing_fraction = 0.40 # UCBTH-14-002, Table 2-1
if random_distribution == 0:
pitch_triso_lattice = (radius_pyc_outer)*(4*pi/3/packing_fraction)**(1/3.)
# Pebble
radius_pebble_inner = 2.5/2 # UCBTH-14-002, Table 2-1
radius_pebble_outer = 3.0/2 # UCBTH-14-002, Table 2-1
radius_pebble_central = radius_pebble_outer - 0.1 # UCBTH-14-002, Table 2-1
tolerance = 0.00 # Tolerance for pebbles universe filling
radius_pebble_flibe = radius_pebble_outer+tolerance
# Pebble centers coordinates (x,y,z)
print("Reading pebble centers from file pebble_centers.txt...", end="")
pebble_centers = np.loadtxt('pebble_centers.txt', delimiter=' ')
print("Read {} pebble positions\n".format(len(pebble_centers)))
# Scale the pebble dimensions (radius of 1.0) to actual dimensions
for i in range(len(pebble_centers)):
pebble_centers[i] *= radius_pebble_outer
print("After scaling (by {}) pebble dimensions:".format(radius_pebble_outer))
print(" Min pebble (center) z coordinate = {}".format(np.min(pebble_centers[:,2])))
print(" Max pebble (center) z coordinate = {}".format(np.max(pebble_centers[:,2])))
print(" Max pebble (center) r coordinate = {}".format(np.max(np.linalg.norm(pebble_centers[:, :-1], axis=1))))
print(" Min pebble (center) r coordinate = {}\n".format(np.min(np.linalg.norm(pebble_centers[:, :-1], axis=1))))
# Vessel Dimensions - we add a small tolerance to make sure no pebbles are cut off. The vesel
# is the region that actually holds the pebbles
tol = 0.00001
vessel_x, vessel_y = (0.0, 0.0)
vessel_z_min = np.min(pebble_centers[:, 2]) - radius_pebble_outer - tol
vessel_z_max = np.max(pebble_centers[:, 2]) + radius_pebble_outer + tol
vessel_outer_radius = np.max(np.linalg.norm(pebble_centers[:, :-1], axis=1)) + radius_pebble_outer + tol
vessel_inner_radius = np.min(np.linalg.norm(pebble_centers[:, :-1], axis=1)) - radius_pebble_outer - tol
vessel_height = vessel_z_max - vessel_z_min
# Add outer reflector of thickness 40 cm, UCBTH-14-002. We assume that there is then also a reflector
# of the same thickness on the top and bottom (an arbitrary selection). This reflector surrounds the pebble bed
# around its outer radius as well as forms the center reflector column.
reflector_thickness = 40.0
reflector_z_min = vessel_z_min - reflector_thickness
reflector_z_max = vessel_z_max + reflector_thickness
reflector_outer_radius = vessel_outer_radius + reflector_thickness
# -------------- Printing Parameters ---------
if verbose:
print ("GEOMETRY PARAMETERS")
print (" TRISO particle fuel radius [cm] = {}".format(radius_fuel))
print (" TRISO particle buffer radius [cm] = {}".format(radius_c_buffer))
print (" TRISO particle iPyC radius [cm] = {}".format(radius_pyc_inner))
print (" TRISO particle SiC radius [cm] = {}".format(radius_sic))
print (" TRISO particle oPyC radius [cm] = {}".format(radius_pyc_outer))
print (" TRISO particles packing fraction [--] = {}".format(packing_fraction))
if random_distribution==0:
print (" TRISO lattice pitch [cm] = {}".format(pitch_triso_lattice))
print (" TRISO particles regular lattice [cm] = {}".format(pitch_triso_lattice))
print (" Pebble core radius [cm] = {}".format(radius_pebble_inner))
print (" Pebble shell outer radius [cm] = {}".format(radius_pebble_outer))
print (" Pebble shell inner radius [cm] = {}".format(radius_pebble_central))
print (" Vessel outer radius [cm] = {}".format(vessel_outer_radius))
print (" Vessel inner radius [cm] = {}".format(vessel_inner_radius))
print (" Vessel min z [cm] = {}".format(vessel_z_min))
print (" Vessel height [cm] = {}".format(vessel_height))
# -------------- Materials Parameters --------
# TRISO particle
enrichment_uranium = 0.199
fraction_u234 = 2e-3 # U234/(U234+U235) mass from Giacint facility fuel
density_fuel = ('g/cm3', 10.5) # UCBTH-14-002, Table 2-1
density_c_buffer = ('g/cm3', 1.0) # Cisneros , Table 3-1
density_pyc = ('g/cm3', 1.87) # Cisneros , Table 3-1
density_sic = ('g/cm3', 3.2) # Cisneros , Table 3-1
# Pebble Graphite
density_graphite_inner = ('g/cm3', 1.59368) # Cisneros , Table 3-1
density_graphite_outer = ('g/cm3', 1.74) # Cisneros , Table 3-1
# FLiBe coolant
enrichment_li7 = 0.99995
temperature_inlet = 273.15 + 600.0 # UCBTH-14-002, Table 1-1
temperature_outlet = 273.15 + 700.0 # UCBTH-14-002, Table 1-1
temperature_flibe = (temperature_inlet+temperature_outlet)/2
rho_flibe = density_flibe(101.325e3, temperature_flibe)
density_flibe = ('kg/m3', rho_flibe)
# Reflector, a mixture of graphite and flibe.
reflector_porosity = 0.112 # Novak thesis, Table 6.4, assuming 5 mm gaps b/w blocks
rho_graphite = 1632.0 # Novak thesis, page 234
density_reflector = ('kg/m3', reflector_porosity * rho_flibe + (1 - reflector_porosity) * rho_graphite)
# --------------------------------------------------
# NO PARAMETERS DEFINITION BEYOND THIS LINE
# -------------- Materials Definition --------------
# TRISO particle
# Fuel from Nagley et al. Fabrication of Uranium Oxycarbide Kernels for HTR Fuel https://inldigitallibrary.inl.gov/sites/sti/sti/4886646.pdf Table 2
m_fuel = openmc.Material(name='m_fuel - uranium oxycarbide - triso particles')
m_fuel.add_nuclide('U234', 89.58* enrichment_uranium* fraction_u234 , percent_type='wo')
m_fuel.add_nuclide('U235', 89.58* enrichment_uranium*(1-fraction_u234), percent_type='wo')
m_fuel.add_nuclide('U238', 89.58*(1-enrichment_uranium) , percent_type='wo')
m_fuel.add_nuclide('C0' , 1.80 , percent_type='wo')
m_fuel.add_element('O' , 8.62 , percent_type='wo')
m_fuel.set_density(*density_fuel)
# Buffer
m_graphite_c_buffer = openmc.Material(name='m_graphite_c_buffer - triso particles')
m_graphite_c_buffer.set_density(*density_c_buffer)
m_graphite_c_buffer.add_nuclide('C0', 1.0)
m_graphite_c_buffer.add_s_alpha_beta('c_Graphite')
# Pyrolitic carbon
m_graphite_pyc = openmc.Material(name='m_graphite_pyc - triso particles')
m_graphite_pyc.set_density(*density_pyc)
m_graphite_pyc.add_nuclide('C0', 1.0)
m_graphite_pyc.add_s_alpha_beta('c_Graphite')
# Silicon carbide
m_sic = openmc.Material(name='sic - triso particles')
m_sic.add_nuclide('C0' , 1.0)
m_sic.add_element('Si', 1.0)
m_sic.set_density(*density_sic)
# TODO: Add SiC S(alpha, beta) ; ENDF/B-VIIIb4 has data for both Si and C in SiC
# Graphite matrix
m_graphite_matrix = openmc.Material(name='m_graphite_matrix - triso particles')
m_graphite_matrix.set_density('g/cm3', 1.6)
m_graphite_matrix.add_nuclide('C0', 1.0)
m_graphite_matrix.add_s_alpha_beta('c_Graphite')
# TODO: Need real specifications for the carbon filler
# Pebble inner graphite core
m_graphite_inner = openmc.Material(name='m_graphite_inner - pebble inner zone')
m_graphite_inner.set_density(*density_graphite_inner)
m_graphite_inner.add_nuclide('C0', 1.0)
m_graphite_inner.add_s_alpha_beta('c_Graphite')
# Pebble outer graphite shell
m_graphite_outer = openmc.Material(name='m_graphite_outer - pebble outer zone')
m_graphite_outer.set_density(*density_graphite_outer)
m_graphite_outer.add_nuclide('C0', 1.0)
m_graphite_outer.add_s_alpha_beta('c_Graphite')
# FLiBe coolant - From Cisneros, appendix B, material 24
m_flibe = openmc.Material(name='m_flibe - 2LiF-BeF2')
m_flibe.set_density(*density_flibe)
m_flibe.add_nuclide('Li7', 2.0* enrichment_li7)
m_flibe.add_nuclide('Li6', 2.0*(1 - enrichment_li7))
m_flibe.add_element('Be' , 1.0)
m_flibe.add_element('F' , 4.0)
# TODO: FLiBe coolant - no S(alpha, beta) data available up to ENDF/B-VIIIb4
# Graphite-flibe homogenized reflector
flibe_molar_mass = m_flibe.average_molar_mass * 7
graphite_molar_mass = m_graphite_outer.average_molar_mass
# moles of flibe in 1 m^3:
# 0.112 m^3 * g/m^3 * mol / g
mols_flibe = reflector_porosity * (rho_flibe * 1000.0) / flibe_molar_mass
# moles of graphite in 1 m^3:
# 0.888 m^3 * g/m^3 * mol / g
mols_graphite = (1.0 - reflector_porosity) * (rho_graphite * 1000.0) / graphite_molar_mass
# Then, the absolute number of moles is irrelevant since we're adding nuclides based on
# the atomic representation
m_reflector = openmc.Material(name='m_reflector')
m_reflector.add_nuclide('Li7', 2.0 * enrichment_li7 * mols_flibe)
m_reflector.add_nuclide('Li6', 2.0 * (1 - enrichment_li7) * mols_flibe)
m_reflector.add_element('Be' , 1.0 * mols_flibe)
m_reflector.add_element('F' , 4.0 * mols_flibe)
m_reflector.add_nuclide('C0', 1.0 * mols_graphite)
m_reflector.add_s_alpha_beta('c_Graphite')
m_reflector.set_density(*density_reflector)
# -------------- Geometry Definition --------------
# TRISO particle universe
s_fuel = openmc.Sphere(r=radius_fuel)
s_c_buffer = openmc.Sphere(r=radius_c_buffer)
s_pyc_inner = openmc.Sphere(r=radius_pyc_inner)
s_sic = openmc.Sphere(r=radius_sic)
s_pyc_outer = openmc.Sphere(r=radius_pyc_outer)
c_triso_fuel = openmc.Cell(name='TRICO Fuel', fill=m_fuel, region=-s_fuel)
c_triso_c_buffer = openmc.Cell(name='TRISO Graphite Buffer', fill=m_graphite_c_buffer, region=+s_fuel & -s_c_buffer)
c_triso_pyc_inner = openmc.Cell(name='TRISO Pyrolitic Graphite Inner', fill=m_graphite_pyc, region=+s_c_buffer & -s_pyc_inner)
c_triso_sic = openmc.Cell(name='TIRSO Silicone Carbide', fill=m_sic, region=+s_pyc_inner & -s_sic)
c_triso_pyc_outer = openmc.Cell(name='TRISO Pyrolitic Graphite Outer', fill=m_graphite_pyc, region=+s_sic & -s_pyc_outer)
c_triso_matrix = openmc.Cell(name='TRISO Graphite Matrix', fill=m_graphite_matrix, region=+s_pyc_outer)
triso_cells = [c_triso_fuel, c_triso_c_buffer, c_triso_pyc_inner, c_triso_sic, c_triso_pyc_outer, c_triso_matrix]
u_triso = openmc.Universe(cells=triso_cells)
# Pebble Geometry
s_pebble_inner = openmc.Sphere(r=radius_pebble_inner)
s_pebble_central = openmc.Sphere(r=radius_pebble_central)
s_pebble_outer = openmc.Sphere(r=radius_pebble_outer)
c_pebble_inner = openmc.Cell(name='Pebble graphite inner region', fill=m_graphite_inner, region=-s_pebble_inner)
c_pebble_central = openmc.Cell(name='Pebble central region (TRISOs)', region=+s_pebble_inner & -s_pebble_central)
c_pebble_outer = openmc.Cell(name='Pebble graphite outer region', fill=m_graphite_outer, region=+s_pebble_central & -s_pebble_outer)
c_pebble_flibe = openmc.Cell(name='Pebble exterior (FLiBe)', fill=m_flibe, region=+s_pebble_outer)
# Fill c_pebble_central with TRISO particles
if random_distribution==0:
# TRISO particles regular lattice using 'pitch_triso_lattice'
l_triso = openmc.RectLattice(name='Pebble TRISO Lattice')
l_triso.lower_left = (-pitch_triso_lattice/2, -pitch_triso_lattice/2, -pitch_triso_lattice/2)
l_triso.pitch = ( pitch_triso_lattice , pitch_triso_lattice , pitch_triso_lattice)
l_triso.outer = u_triso
l_triso.universes = np.tile(u_triso, (20, 20, 20))
# TRISO particles random distribution using 'packing_fraction'
else:
c_triso_pyc_outer_random = openmc.Cell(name='c_triso_pyc_outer_random', fill=m_graphite_pyc, region=+s_sic)
u_triso_random = openmc.Universe(cells=[c_triso_fuel, c_triso_c_buffer, c_triso_pyc_inner, c_triso_sic, c_triso_pyc_outer_random])
if not os.path.exists('triso_centers.npy'):
print("Writing random TRISO centers to file triso_centers.npy")
r_triso_random = +s_pebble_inner & -s_pebble_central
spheres_random = openmc.model.pack_spheres(radius=radius_pyc_outer, region=r_triso_random, pf=packing_fraction, initial_pf=0.15)
triso_random = [openmc.model.TRISO(radius_pyc_outer, u_triso_random, i) for i in spheres_random]
centers = np.vstack([i.center for i in triso_random])
np.save('triso_centers.npy', triso_random)
if verbose:
packing_fraction = len(triso_random)*radius_pyc_outer**3/(radius_pebble_central**3-radius_pebble_inner**3)
print("Calculated packing fraction of the TRISO particles random distribution = {}".format(packing_fraction))
print("Reading random TRISO centers from file triso_centers.npy")
triso_random = np.load('triso_centers.npy', allow_pickle=True)
lower_left, upper_right = c_pebble_central.region.bounding_box
shape = (5, 5, 5)
pitch = (upper_right - lower_left)/shape
l_triso = openmc.model.create_triso_lattice(triso_random, lower_left, pitch, shape, m_graphite_matrix)
print("File triso_centers.npy reading completed")
# Fil central pebble cell with the TRISO lattice
c_pebble_central.fill = l_triso
pebble_cells = [c_pebble_inner, c_pebble_central, c_pebble_outer, c_pebble_flibe]
u_pebble = openmc.Universe(cells=pebble_cells)
# Vessel cell - this is the pebble-containing region
vessel_outer = openmc.ZCylinder(x0=vessel_x, y0=vessel_y, r=vessel_outer_radius)
vessel_inner = openmc.ZCylinder(x0=vessel_x, y0=vessel_y, r=vessel_inner_radius)
vessel_bottom = openmc.ZPlane(z0=vessel_z_min)
vessel_top = openmc.ZPlane(z0=vessel_z_max)
vessel_region = -vessel_outer & +vessel_bottom & -vessel_top & +vessel_inner
vessel_cell = openmc.Cell(name='Pebble Vessel', region = vessel_region)
# Outer reflector cell
reflector_outer = openmc.ZCylinder(x0=vessel_x, y0=vessel_y, r=reflector_outer_radius, boundary_type = 'reflective')
reflector_bottom = openmc.ZPlane(z0=reflector_z_min, boundary_type = 'reflective')
reflector_top = openmc.ZPlane(z0=reflector_z_max, boundary_type = 'reflective')
outer_reflector_region = -reflector_outer & +vessel_bottom & -vessel_top & +vessel_inner
inner_reflector_region = -vessel_inner & +vessel_bottom & -vessel_top
top_reflector_region = +vessel_top & -reflector_top & -reflector_outer
bottom_reflector_region = -vessel_bottom & +reflector_bottom & -reflector_outer
outer_reflector_cell = openmc.Cell(name = 'Outer Reflector', region = outer_reflector_region, fill = m_reflector)
inner_reflector_cell = openmc.Cell(name = 'Inner Reflector', region = inner_reflector_region, fill = m_reflector)
top_reflector_cell = openmc.Cell(name = 'Top Reflector', region = top_reflector_region, fill = m_reflector)
bottom_reflector_cell = openmc.Cell(name = 'Bottom Reflector', region = bottom_reflector_region, fill = m_reflector)
# Creating TRISOs for the pebbles to pack them into a lattice for efficiency
cell_name = ['cell_pebble_' + str(i) for i in range (len(pebble_centers))]
pebble_trisos = []
for center, name in zip(pebble_centers, cell_name):
pebble_trisos.append(openmc.model.TRISO(radius_pebble_outer, u_pebble, center))
pebble_trisos[-1].name = name
# Place pebbles into a lattice
llc_vessel, urc_vessel = vessel_region.bounding_box
l_pebble_shape = np.asarray((20, 20, 20))
l_pebble_pitch = (urc_vessel - llc_vessel) / l_pebble_shape
l_pebble = openmc.model.create_triso_lattice(pebble_trisos, llc_vessel, l_pebble_pitch, l_pebble_shape, m_flibe)
# fill vessel with pebble lattice
vessel_cell.fill = l_pebble
geom = openmc.Geometry([vessel_cell, outer_reflector_cell, inner_reflector_cell, top_reflector_cell, bottom_reflector_cell])
if verbose:
print ("Cell of the vessel:")
print (vessel_cell)
# -------------- Settings --------------------
settings = openmc.Settings()
settings.source = openmc.Source(space=openmc.stats.Box(*vessel_cell.bounding_box))
settings.particles = 50000
settings.inactive = 50
settings.batches = 250
settings.temperature = dict(default=573, method='interpolation', multipole=True, range=(300.0, 1500.0), tolerance=1000.0)
settings.material_cell_offsets = False
# Fuel volume calculation
volume_fuel = openmc.VolumeCalculation([m_fuel], 10000000, *c_pebble_central.bounding_box)
settings.volume_calculations = [volume_fuel]
model = openmc.model.Model(geometry=geom, settings=settings)
model.export_to_xml()
# -------------- Plots --------------
# Plot parameters
vessel_diameter = 2.0 * reflector_outer_radius
pebble_diameter = 2.0 * radius_pebble_outer
extra = 1.1
m_colors = {m_fuel: 'brown',
m_graphite_c_buffer: 'LightSteelBlue',
m_graphite_pyc: 'blue',
m_sic: 'orange',
m_graphite_matrix: 'cyan',
m_graphite_inner: 'DeepSkyBlue',
m_graphite_outer: 'Navy',
m_flibe: 'yellow',
m_reflector: 'slategray'}
#
plot1 = openmc.Plot()
plot1.filename = 'plot1'
plot1.width = (extra * vessel_diameter, extra * vessel_diameter)
plot1.basis = 'xy'
plot1.origin = (0, 0, 0)
plot1.pixels = (2000, 2000)
plot1.color_by = 'material'
plot1.colors = m_colors
#
plot2 = openmc.Plot()
plot2.filename = 'plot2'
plot_width = extra * max(vessel_diameter, vessel_height)
plot2.width = (plot_width, plot_width)
plot2.basis = 'xz'
plot_zcenter = vessel_z_min + vessel_height/2.0
plot2.origin = (0, 0, plot_zcenter)
plot2.pixels = (2000, 2000)
plot2.color_by = 'material'
plot2.colors = m_colors
#
plots = openmc.Plots([plot1, plot2])
if voxel==1:
plotv1 = openmc.Plot()
plotv1.filename = 'plotv1'
plotv1.width = (pebble_diameter, pebble_diameter, pebble_diameter)
plotv1.origin = (pebble_centers[0,0], pebble_centers[0,1] ,pebble_centers[0,2])
plotv1.pixels = (300, 300, 300)
plotv1.color_by = 'material'
plotv1.colors = m_colors
plotv1.type = 'voxel'
plots.append(plotv1)
plots.export_to_xml()
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version='1.0' encoding='utf-8'?>
<plots>
<plot basis="xy" color_by="material" filename="plot1" id="1" type="slice">
<origin>0 0 0</origin>
<width>377.5601234449048 377.5601234449048</width>
<pixels>2000 2000</pixels>
<color id="1" rgb="165 42 42" />
<color id="2" rgb="176 196 222" />
<color id="3" rgb="0 0 255" />
<color id="4" rgb="255 165 0" />
<color id="5" rgb="0 255 255" />
<color id="6" rgb="0 191 255" />
<color id="7" rgb="0 0 128" />
<color id="8" rgb="255 255 0" />
<color id="9" rgb="112 128 144" />
</plot>
<plot basis="xz" color_by="material" filename="plot2" id="2" type="slice">
<origin>0 0 0.015973350000002995</origin>
<width>377.5601234449048 377.5601234449048</width>
<pixels>2000 2000</pixels>
<color id="1" rgb="165 42 42" />
<color id="2" rgb="176 196 222" />
<color id="3" rgb="0 0 255" />
<color id="4" rgb="255 165 0" />
<color id="5" rgb="0 255 255" />
<color id="6" rgb="0 191 255" />
<color id="7" rgb="0 0 128" />
<color id="8" rgb="255 255 0" />
<color id="9" rgb="112 128 144" />
</plot>
</plots>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>50000</particles>
<batches>250</batches>
<inactive>50</inactive>
<source strength="1.0">
<space type="box">
<parameters>-131.61823792950216 -131.61823792950216 -35.865070300000006 131.61823792950216 131.61823792950216 35.897017000000005</parameters>
</space>
</source>
<temperature_default>573</temperature_default>
<temperature_method>interpolation</temperature_method>
<temperature_multipole>true</temperature_multipole>
<temperature_range>300.0 1500.0</temperature_range>
<temperature_tolerance>1000.0</temperature_tolerance>
<volume_calc>
<domain_type>material</domain_type>
<domain_ids>1</domain_ids>
<samples>10000000</samples>
<lower_left>-1.4 -1.4 -1.4</lower_left>
<upper_right>1.4 1.4 1.4</upper_right>
</volume_calc>
<material_cell_offsets>false</material_cell_offsets>
</settings>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment