adding back files to be reviewed

This commit is contained in:
Paul Romano 2019-10-28 11:55:45 -05:00
parent ae28233110
commit bc09d1ef55
1244 changed files with 301904 additions and 0 deletions

View file

@ -0,0 +1,53 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="1" material="1" region="-1" universe="0" />
<surface boundary="vacuum" coeffs="0.0 0.0 0.0 10.0" id="1" type="sphere" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1" temperature="294">
<density units="g/cm3" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>1000</particles>
<batches>10</batches>
<inactive>5</inactive>
<source strength="0.5">
<space type="cartesian">
<x parameters="-3.0 3.0" type="uniform" />
<y type="discrete">
<parameters>-4.0 -1.0 3.0 0.2 0.3 0.5</parameters>
</y>
<z interpolation="linear-linear" type="tabular">
<parameters>-2.0 0.0 2.0 0.2 0.3 0.2</parameters>
</z>
</space>
<angle reference_uvw="0.0 0.0 1.0" type="mu-phi">
<mu type="discrete">
<parameters>-1.0 0.0 1.0 0.5 0.25 0.25</parameters>
</mu>
<phi parameters="0.0 6.28318530718" type="uniform" />
</angle>
<energy parameters="1289500.0" type="maxwell" />
</source>
<source strength="0.3">
<space type="box">
<parameters>-4.0 -4.0 -4.0 4.0 4.0 4.0</parameters>
</space>
<angle reference_uvw="0.0 1.0 0.0" type="monodirectional" />
<energy parameters="988000.0 2.249e-06" type="watt" />
</source>
<source strength="0.2">
<space type="point">
<parameters>1.2 -2.3 0.781</parameters>
</space>
<angle type="isotropic" />
<energy interpolation="histogram" type="tabular">
<parameters>1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23</parameters>
</energy>
</source>
</settings>

View file

@ -0,0 +1,2 @@
k-combined:
2.800827E-01 7.360163E-03

View file

@ -0,0 +1,63 @@
from math import pi
import numpy as np
import openmc
from tests.testing_harness import PyAPITestHarness
class SourceTestHarness(PyAPITestHarness):
def _build_inputs(self):
mat1 = openmc.Material(material_id=1, temperature=294)
mat1.set_density('g/cm3', 4.5)
mat1.add_nuclide(openmc.Nuclide('U235'), 1.0)
materials = openmc.Materials([mat1])
materials.export_to_xml()
sphere = openmc.Sphere(surface_id=1, r=10.0, boundary_type='vacuum')
inside_sphere = openmc.Cell(cell_id=1)
inside_sphere.region = -sphere
inside_sphere.fill = mat1
root = openmc.Universe(universe_id=0)
root.add_cell(inside_sphere)
geometry = openmc.Geometry()
geometry.root_universe = root
geometry.export_to_xml()
# Create an array of different sources
x_dist = openmc.stats.Uniform(-3., 3.)
y_dist = openmc.stats.Discrete([-4., -1., 3.], [0.2, 0.3, 0.5])
z_dist = openmc.stats.Tabular([-2., 0., 2.], [0.2, 0.3, 0.2])
spatial1 = openmc.stats.CartesianIndependent(x_dist, y_dist, z_dist)
spatial2 = openmc.stats.Box([-4., -4., -4.], [4., 4., 4.])
spatial3 = openmc.stats.Point([1.2, -2.3, 0.781])
mu_dist = openmc.stats.Discrete([-1., 0., 1.], [0.5, 0.25, 0.25])
phi_dist = openmc.stats.Uniform(0., 6.28318530718)
angle1 = openmc.stats.PolarAzimuthal(mu_dist, phi_dist)
angle2 = openmc.stats.Monodirectional(reference_uvw=[0., 1., 0.])
angle3 = openmc.stats.Isotropic()
E = np.logspace(0, 7)
p = np.sin(np.linspace(0., pi))
p /= sum(np.diff(E)*p[:-1])
energy1 = openmc.stats.Maxwell(1.2895e6)
energy2 = openmc.stats.Watt(0.988e6, 2.249e-6)
energy3 = openmc.stats.Tabular(E, p, interpolation='histogram')
source1 = openmc.Source(spatial1, angle1, energy1, strength=0.5)
source2 = openmc.Source(spatial2, angle2, energy2, strength=0.3)
source3 = openmc.Source(spatial3, angle3, energy3, strength=0.2)
settings = openmc.Settings()
settings.batches = 10
settings.inactive = 5
settings.particles = 1000
settings.source = [source1, source2, source3]
settings.export_to_xml()
def test_source():
harness = SourceTestHarness('statepoint.10.h5')
harness.main()