From 0f691ad1799808622fb122240b2721d169a47480 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 28 Sep 2015 16:38:22 +0700 Subject: [PATCH 01/14] Add energy_min_neutron and energy_max_neutron variables to replace hard-coded instances of 20 MeV. --- src/ace.F90 | 9 +++++++++ src/cross_section.F90 | 2 +- src/energy_grid.F90 | 4 ++-- src/global.F90 | 4 ++++ src/physics.F90 | 8 ++++---- src/source.F90 | 13 +++++++------ 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/ace.F90 b/src/ace.F90 index cccc570926..69ad2f1a9a 100644 --- a/src/ace.F90 +++ b/src/ace.F90 @@ -482,6 +482,15 @@ contains ! Continue reading elastic scattering and heating nuc % elastic = get_real(NE) + ! Determine if minimum/maximum energy for this nuclide is greater/less + ! than the previous + energy_min_neutron = max(energy_min_neutron, nuc%energy(1)) + energy_max_neutron = min(energy_max_neutron, nuc%energy(NE)) + if (nuc%energy(NE) < 20.0_8) then + call warning("Maximum energy for " // trim(adjustl(nuc%name)) // & + " is " // trim(to_str(nuc%energy(NE))) // " MeV. Neutrons will & + ¬ be allowed to go above this energy.") + end if end if end subroutine read_esz diff --git a/src/cross_section.F90 b/src/cross_section.F90 index 4d8fb2f0fb..1c56d961e1 100644 --- a/src/cross_section.F90 +++ b/src/cross_section.F90 @@ -56,7 +56,7 @@ contains if (grid_method == GRID_MAT_UNION) then call find_energy_index(p % E, p % material) else if (grid_method == GRID_LOGARITHM) then - u = int(log(p % E/1.0e-11_8)/log_spacing) + u = int(log(p % E/energy_min_neutron)/log_spacing) end if ! Determine if this material has S(a,b) tables diff --git a/src/energy_grid.F90 b/src/energy_grid.F90 index 1473e52105..66419f83cc 100644 --- a/src/energy_grid.F90 +++ b/src/energy_grid.F90 @@ -73,8 +73,8 @@ contains type(Nuclide), pointer :: nuc ! Set minimum/maximum energies - E_max = 20.0_8 - E_min = 1.0e-11_8 + E_max = energy_max_neutron + E_min = energy_min_neutron ! Determine equal-logarithmic energy spacing M = n_log_bins diff --git a/src/global.F90 b/src/global.F90 index 87d7278296..a4c80daa79 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -74,6 +74,10 @@ module global integer :: n_sab_tables ! Number of S(a,b) thermal scattering tables integer :: n_listings ! Number of listings in cross_sections.xml + ! Minimum/maximum energies + real(8) :: energy_min_neutron = ZERO + real(8) :: energy_max_neutron = INFINITY + ! Dictionaries to look up cross sections and listings type(DictCharInt) :: nuclide_dict type(DictCharInt) :: sab_dict diff --git a/src/physics.F90 b/src/physics.F90 index 11bc3720fe..a109eb1a69 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -1220,8 +1220,8 @@ contains call sample_energy(edist, E, E_out) end if - ! resample if energy is >= 20 MeV - if (E_out < 20) exit + ! resample if energy is greater than maximum neutron energy + if (E_out < energy_max_neutron) exit ! check for large number of resamples n_sample = n_sample + 1 @@ -1246,8 +1246,8 @@ contains call sample_energy(rxn%edist, E, E_out) end if - ! resample if energy is >= 20 MeV - if (E_out < 20) exit + ! resample if energy is greater than maximum neutron energy + if (E_out < energy_max_neutron) exit ! check for large number of resamples n_sample = n_sample + 1 diff --git a/src/source.F90 b/src/source.F90 index c461749472..6226517f3e 100644 --- a/src/source.F90 +++ b/src/source.F90 @@ -211,8 +211,9 @@ contains case (SRC_ENERGY_MONO) ! Monoenergtic source site%E = external_source%params_energy(1) - if (site%E >= 20) then - call fatal_error("Source energies above 20 MeV not allowed.") + if (site%E >= energy_max_neutron) then + call fatal_error("Source energy above range of energies of at least & + &one cross section table") end if case (SRC_ENERGY_MAXWELL) @@ -221,8 +222,8 @@ contains ! Sample Maxwellian fission spectrum site%E = maxwell_spectrum(a) - ! resample if energy is >= 20 MeV - if (site%E < 20) exit + ! resample if energy is greater than maximum neutron energy + if (site%E < energy_max_neutron) exit end do case (SRC_ENERGY_WATT) @@ -232,8 +233,8 @@ contains ! Sample Watt fission spectrum site%E = watt_spectrum(a, b) - ! resample if energy is >= 20 MeV - if (site%E < 20) exit + ! resample if energy is greater than maximum neutron energy + if (site%E < energy_max_neutron) exit end do case default From c4fd2855e6ff9252003d7b2607570ce6884938c4 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Oct 2015 09:20:15 +0700 Subject: [PATCH 02/14] Add support for general quadric surfaces --- docs/source/methods/geometry.rst | 4 + docs/source/usersguide/input.rst | 8 +- docs/source/usersguide/output/summary.rst | 3 +- src/input_xml.F90 | 14 +++ src/summary.F90 | 5 ++ src/surface_header.F90 | 102 +++++++++++++++++++++- 6 files changed, 131 insertions(+), 5 deletions(-) diff --git a/docs/source/methods/geometry.rst b/docs/source/methods/geometry.rst index 9eece1e919..6592909298 100644 --- a/docs/source/methods/geometry.rst +++ b/docs/source/methods/geometry.rst @@ -117,6 +117,10 @@ to fully define the surface. | Cone parallel to the | z-cone | :math:`(x-x_0)^2 + (y-y_0)^2 | :math:`x_0 \; y_0 \; | | :math:`z`-axis | | = R^2(z-z_0)^2` | z_0 \; R^2` | +----------------------+------------+------------------------------+-------------------------+ + | General quadric | quadric | :math:`Ax^2 + By^2 + Cz^2 + | :math:`A \; B \; C \; D | + | surface | | Dxy + Eyz + Fxz + Gx + Hy + | \; E \; F \; G \; H \; | + | | | Jz + K` | J \; K` | + +----------------------+------------+------------------------------+-------------------------+ .. _universes: diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 44db252079..87b613a453 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -787,7 +787,7 @@ Each ```` element can have the following attributes or sub-elements: :type: The type of the surfaces. This can be "x-plane", "y-plane", "z-plane", "plane", "x-cylinder", "y-cylinder", "z-cylinder", "sphere", "x-cone", - "y-cone", or "z-cone". + "y-cone", "z-cone", or "quadric". *Default*: None @@ -855,6 +855,12 @@ The following quadratic surfaces can be modeled: R^2 (z - z_0)^2`. The coefficients specified are ":math:`x_0 \: y_0 \: z_0 \: R^2`". + :quadric: + A general quadric surface of the form :math:`Ax^2 + By^2 + Cz^2 + Dxy + + Eyz + Fxz + Gx + Hy + Jz + K = 0` The coefficients specified are ":math:`A + \: B \: C \: D \: E \: F \: G \: H \: J \: K`". + + ```` Element ------------------ diff --git a/docs/source/usersguide/output/summary.rst b/docs/source/usersguide/output/summary.rst index d37b2172fa..f87f60c4a0 100644 --- a/docs/source/usersguide/output/summary.rst +++ b/docs/source/usersguide/output/summary.rst @@ -132,7 +132,8 @@ The current revision of the summary file format is 1. **/geometry/surfaces/surface /type** (*char[]*) Type of the surface. Can be 'x-plane', 'y-plane', 'z-plane', 'plane', - 'x-cylinder', 'y-cylinder', 'sphere', 'x-cone', 'y-cone', or 'z-cone'. + 'x-cylinder', 'y-cylinder', 'sphere', 'x-cone', 'y-cone', 'z-cone', or + 'quadric'. **/geometry/surfaces/surface /coefficients** (*double[]*) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 6d15f0d204..40e0583daf 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -1294,6 +1294,9 @@ contains case ('z-cone') coeffs_reqd = 4 allocate(SurfaceZCone :: surfaces(i)%obj) + case ('quadric') + coeffs_reqd = 10 + allocate(SurfaceQuadric :: surfaces(i)%obj) case default call fatal_error("Invalid surface type: " // trim(word)) end select @@ -1378,6 +1381,17 @@ contains s%y0 = coeffs(2) s%z0 = coeffs(3) s%r2 = coeffs(4) + type is (SurfaceQuadric) + s%A = coeffs(1) + s%B = coeffs(2) + s%C = coeffs(3) + s%D = coeffs(4) + s%E = coeffs(5) + s%F = coeffs(6) + s%G = coeffs(7) + s%H = coeffs(8) + s%J = coeffs(9) + s%K = coeffs(10) end select ! No longer need coefficients diff --git a/src/summary.F90 b/src/summary.F90 index 1bf57cc93f..d8ac1e3fa8 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -276,6 +276,11 @@ contains allocate(coeffs(4)) coeffs(:) = [s%x0, s%y0, s%z0, s%r2] + type is (SurfaceQuadric) + call write_dataset(surface_group, "type", "quadric") + allocate(coeffs(10)) + coeffs(:) = [s%A, s%B, s%C, s%D, s%E, s%F, s%G, s%H, s%J, s%K] + end select call write_dataset(surface_group, "coefficients", coeffs) deallocate(coeffs) diff --git a/src/surface_header.F90 b/src/surface_header.F90 index 6fc1bbc237..a927ce4d40 100644 --- a/src/surface_header.F90 +++ b/src/surface_header.F90 @@ -1,6 +1,6 @@ module surface_header - use constants, only: ONE, TWO, ZERO, INFINITY, FP_COINCIDENT + use constants, only: ONE, TWO, ZERO, HALF, INFINITY, FP_COINCIDENT implicit none @@ -183,6 +183,15 @@ module surface_header procedure :: normal => z_cone_normal end type SurfaceZCone + type, extends(Surface) :: SurfaceQuadric + ! Ax^2 + By^2 + Cz^2 + Dxy + Eyz + Fxz + Gx + Hy + Jz + K = 0 + real(8) :: A, B, C, D, E, F, G, H, J, K + contains + procedure :: evaluate => quadric_evaluate + procedure :: distance => quadric_distance + procedure :: normal => quadric_normal + end type SurfaceQuadric + contains !=============================================================================== @@ -640,7 +649,7 @@ contains end function z_cylinder_normal !=============================================================================== -! SphereImplementation +! SurfaceSphere Implementation !=============================================================================== pure function sphere_evaluate(this, xyz) result(f) @@ -874,7 +883,7 @@ contains end function y_cone_normal !=============================================================================== -! SurfaceZConeImplementation +! SurfaceZCone Implementation !=============================================================================== pure function z_cone_evaluate(this, xyz) result(f) @@ -953,4 +962,91 @@ contains uvw(3) = -TWO*this%r2*(xyz(3) - this%z0) end function z_cone_normal +!=============================================================================== +! SurfaceQuadric Implementation +!=============================================================================== + + pure function quadric_evaluate(this, xyz) result(f) + class(SurfaceQuadric), intent(in) :: this + real(8), intent(in) :: xyz(3) + real(8) :: f + + associate (x => xyz(1), y => xyz(2), z => xyz(3)) + f = x*(this%A*x + this%D*y + this%G) + & + y*(this%B*y + this%E*z + this%H) + & + z*(this%C*z + this%F*x + this%J) + this%K + end associate + end function quadric_evaluate + + pure function quadric_distance(this, xyz, uvw, coincident) result(d) + class(SurfaceQuadric), intent(in) :: this + real(8), intent(in) :: xyz(3) + real(8), intent(in) :: uvw(3) + logical, intent(in) :: coincident + real(8) :: d + + real(8) :: a, k, c + real(8) :: quad, b + + associate (x => xyz(1), y => xyz(2), z => xyz(3), & + u => uvw(1), v => uvw(2), w => uvw(3)) + + a = this%A*u*u + this%B*v*v + this%C*w*w + this%D*u*v + this%E*v*w + & + this%F*u*w + k = (this%A*u*x + this%B*v*y + this%C*w*z + HALF*(this%D*(u*y + v*x) + & + this%E*(v*z + w*y) + this%F*(w*x + u*z) + this%G*u + this%H*v + & + this%J*w)) + c = this%A*x*x + this%B*y*y + this%C*z*z + this%D*x*y + this%E*y*z + & + this%F*y*z + this%G*x + this%H*y + this%J*z + K + quad = k*k - a*c + + if (quad < ZERO) then + ! no intersection with cone + + d = INFINITY + + elseif (coincident .or. abs(c) < FP_COINCIDENT) then + ! particle is on the cone, thus one distance is positive/negative and the + ! other is zero. The sign of k determines which distance is zero and which + ! is not. + + if (k >= ZERO) then + d = (-k - sqrt(quad))/a + else + d = (-k + sqrt(quad))/a + end if + + else + ! calculate both solutions to the quadratic + quad = sqrt(quad) + d = (-k - quad)/a + b = (-k + quad)/a + + ! determine the smallest positive solution + if (d < ZERO) then + if (b > ZERO) then + d = b + end if + else + if (b > ZERO) d = min(d, b) + end if + end if + + ! If the distance was negative, set boundary distance to infinity + if (d <= ZERO) d = INFINITY + end associate + end function quadric_distance + + pure function quadric_normal(this, xyz) result(uvw) + class(SurfaceQuadric), intent(in) :: this + real(8), intent(in) :: xyz(3) + real(8) :: uvw(3) + + associate (x => xyz(1), y => xyz(2), z => xyz(3)) + uvw(1) = TWO*this%A*x + this%D*y + this%F*z + this%G + uvw(2) = TWO*this%B*y + this%D*x + this%E*z + this%H + uvw(3) = TWO*this%C*z + this%E*y + this%F*x + this%J + end associate + end function quadric_normal + end module surface_header From 80b0a1ad251090159a4f8465511ed01ddfca8ec7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Oct 2015 09:36:00 +0700 Subject: [PATCH 03/14] Add support in Python API for quadric surfaces --- openmc/summary.py | 5 ++ openmc/surface.py | 146 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) diff --git a/openmc/summary.py b/openmc/summary.py index 75f2a0f2a2..2c704557c8 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -179,6 +179,11 @@ class Summary(object): if surf_type == 'z-cone': surface = openmc.ZCone(surface_id, bc, x0, y0, z0, R2, name) + elif surf_type == 'quadric': + a, b, c, d, e, f, g, h, j, k = coeffs + surface = openmc.Quadric(surface_id, bc, a, b, c, d, e, f, + g, h, j, k, name) + # Add Surface to global dictionary of all Surfaces self.surfaces[index] = surface diff --git a/openmc/surface.py b/openmc/surface.py index afa426fa3b..92f047b66d 100644 --- a/openmc/surface.py +++ b/openmc/surface.py @@ -949,6 +949,152 @@ class ZCone(Cone): self._type = 'z-cone' +class Quadric(Surface): + """A sphere of the form :math:`Ax^2 + By^2 + Cz^2 + Dxy + Eyz + Fxz + Gx + Hy + + Jz + K`. + + Parameters + ---------- + surface_id : int + Unique identifier for the surface. If not specified, an identifier will + automatically be assigned. + boundary_type : {'transmission, 'vacuum', 'reflective', 'periodic'} + Boundary condition that defines the behavior for particles hitting the + surface. Defaults to transmissive boundary condition where particles + freely pass through the surface. + a, b, c, d, e, f, g, h, j, k : float + coefficients for the surface + name : str + Name of the sphere. If not specified, the name will be the empty string. + + Attributes + ---------- + a, b, c, d, e, f, g, h, j, k : float + coefficients for the surface + + """ + + def __init__(self, surface_id=None, boundary_type='transmission', + a=None, b=None, c=None, d=None, e=None, f=None, g=None, + h=None, j=None, k=None, name=''): + # Initialize Quadric class attributes + super(Quadric, self).__init__(surface_id, boundary_type, name=name) + + self._type = 'quadric' + self._coeff_keys = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k'] + + if a is not None: + self.a = a + if b is not None: + self.b = b + if c is not None: + self.c = c + if d is not None: + self.d = d + if e is not None: + self.e = e + if f is not None: + self.f = f + if g is not None: + self.g = g + if h is not None: + self.h = h + if j is not None: + self.j = j + if k is not None: + self.k = k + + @property + def a(self): + return self.coeffs['a'] + + @property + def b(self): + return self.coeffs['b'] + + @property + def c(self): + return self.coeffs['c'] + + @property + def d(self): + return self.coeffs['d'] + + @property + def e(self): + return self.coeffs['e'] + + @property + def f(self): + return self.coeffs['f'] + + @property + def g(self): + return self.coeffs['g'] + + @property + def h(self): + return self.coeffs['h'] + + @property + def j(self): + return self.coeffs['j'] + + @property + def k(self): + return self.coeffs['k'] + + @a.setter + def a(self, a): + check_type('a coefficient', a, Real) + self._coeffs['a'] = a + + @b.setter + def b(self, b): + check_type('b coefficient', b, Real) + self._coeffs['b'] = b + + @c.setter + def c(self, c): + check_type('c coefficient', c, Real) + self._coeffs['c'] = c + + @d.setter + def d(self, d): + check_type('d coefficient', d, Real) + self._coeffs['d'] = d + + @e.setter + def e(self, e): + check_type('e coefficient', e, Real) + self._coeffs['e'] = e + + @f.setter + def f(self, f): + check_type('f coefficient', f, Real) + self._coeffs['f'] = f + + @g.setter + def g(self, g): + check_type('g coefficient', g, Real) + self._coeffs['g'] = g + + @h.setter + def h(self, h): + check_type('h coefficient', h, Real) + self._coeffs['h'] = h + + @j.setter + def j(self, j): + check_type('j coefficient', j, Real) + self._coeffs['j'] = j + + @k.setter + def k(self, k): + check_type('k coefficient', k, Real) + self._coeffs['k'] = k + + class Halfspace(Region): """A positive or negative half-space region. From 8fdc5fbba1eea407f9f919980c6456e6cf768591 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Oct 2015 15:05:55 +0700 Subject: [PATCH 04/14] Add test for quadric surface and fix bug in distance calculation. Also remove reflective cone, cylinder, and sphere tests since they are covered in the new test here. --- src/geometry.F90 | 2 +- src/surface_header.F90 | 2 +- tests/test_quadric_surfaces/geometry.xml | 14 ++++++++++++++ .../materials.xml | 3 ++- tests/test_quadric_surfaces/results_true.dat | 2 ++ .../settings.xml | 2 +- .../test_quadric_surfaces.py} | 0 tests/test_reflective_cone/geometry.xml | 7 ------- tests/test_reflective_cone/materials.xml | 9 --------- tests/test_reflective_cone/results_true.dat | 2 -- tests/test_reflective_cylinder/geometry.xml | 8 -------- tests/test_reflective_cylinder/materials.xml | 9 --------- tests/test_reflective_cylinder/results_true.dat | 2 -- tests/test_reflective_cylinder/settings.xml | 16 ---------------- .../test_reflective_cylinder.py | 11 ----------- tests/test_reflective_sphere/geometry.xml | 8 -------- tests/test_reflective_sphere/results_true.dat | 2 -- tests/test_reflective_sphere/settings.xml | 16 ---------------- .../test_reflective_sphere.py | 11 ----------- 19 files changed, 21 insertions(+), 105 deletions(-) create mode 100644 tests/test_quadric_surfaces/geometry.xml rename tests/{test_reflective_sphere => test_quadric_surfaces}/materials.xml (56%) create mode 100644 tests/test_quadric_surfaces/results_true.dat rename tests/{test_reflective_cone => test_quadric_surfaces}/settings.xml (79%) rename tests/{test_reflective_cone/test_reflective_cone.py => test_quadric_surfaces/test_quadric_surfaces.py} (100%) mode change 100644 => 100755 delete mode 100644 tests/test_reflective_cone/geometry.xml delete mode 100644 tests/test_reflective_cone/materials.xml delete mode 100644 tests/test_reflective_cone/results_true.dat delete mode 100644 tests/test_reflective_cylinder/geometry.xml delete mode 100644 tests/test_reflective_cylinder/materials.xml delete mode 100644 tests/test_reflective_cylinder/results_true.dat delete mode 100644 tests/test_reflective_cylinder/settings.xml delete mode 100644 tests/test_reflective_cylinder/test_reflective_cylinder.py delete mode 100644 tests/test_reflective_sphere/geometry.xml delete mode 100644 tests/test_reflective_sphere/results_true.dat delete mode 100644 tests/test_reflective_sphere/settings.xml delete mode 100644 tests/test_reflective_sphere/test_reflective_sphere.py diff --git a/src/geometry.F90 b/src/geometry.F90 index e1e1b1f44e..e922479b1d 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -430,7 +430,7 @@ contains call find_cell(p, found) if (.not. found) then call handle_lost_particle(p, "Couldn't find particle after reflecting& - & from surface.") + & from surface " // trim(to_str(surf%id)) // ".") return end if diff --git a/src/surface_header.F90 b/src/surface_header.F90 index a927ce4d40..257cdbc1a1 100644 --- a/src/surface_header.F90 +++ b/src/surface_header.F90 @@ -997,7 +997,7 @@ contains this%E*(v*z + w*y) + this%F*(w*x + u*z) + this%G*u + this%H*v + & this%J*w)) c = this%A*x*x + this%B*y*y + this%C*z*z + this%D*x*y + this%E*y*z + & - this%F*y*z + this%G*x + this%H*y + this%J*z + K + this%F*x*z + this%G*x + this%H*y + this%J*z + this%K quad = k*k - a*c if (quad < ZERO) then diff --git a/tests/test_quadric_surfaces/geometry.xml b/tests/test_quadric_surfaces/geometry.xml new file mode 100644 index 0000000000..98d647a4f6 --- /dev/null +++ b/tests/test_quadric_surfaces/geometry.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/tests/test_reflective_sphere/materials.xml b/tests/test_quadric_surfaces/materials.xml similarity index 56% rename from tests/test_reflective_sphere/materials.xml rename to tests/test_quadric_surfaces/materials.xml index 315c0fa848..0150332b3c 100644 --- a/tests/test_reflective_sphere/materials.xml +++ b/tests/test_quadric_surfaces/materials.xml @@ -3,7 +3,8 @@ - + + diff --git a/tests/test_quadric_surfaces/results_true.dat b/tests/test_quadric_surfaces/results_true.dat new file mode 100644 index 0000000000..b2e02fdbb7 --- /dev/null +++ b/tests/test_quadric_surfaces/results_true.dat @@ -0,0 +1,2 @@ +k-combined: +9.706301E-01 4.351374E-02 diff --git a/tests/test_reflective_cone/settings.xml b/tests/test_quadric_surfaces/settings.xml similarity index 79% rename from tests/test_reflective_cone/settings.xml rename to tests/test_quadric_surfaces/settings.xml index af56f56368..9f0e8ed05f 100644 --- a/tests/test_reflective_cone/settings.xml +++ b/tests/test_quadric_surfaces/settings.xml @@ -8,7 +8,7 @@ - + diff --git a/tests/test_reflective_cone/test_reflective_cone.py b/tests/test_quadric_surfaces/test_quadric_surfaces.py old mode 100644 new mode 100755 similarity index 100% rename from tests/test_reflective_cone/test_reflective_cone.py rename to tests/test_quadric_surfaces/test_quadric_surfaces.py diff --git a/tests/test_reflective_cone/geometry.xml b/tests/test_reflective_cone/geometry.xml deleted file mode 100644 index f5499fbb61..0000000000 --- a/tests/test_reflective_cone/geometry.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/test_reflective_cone/materials.xml b/tests/test_reflective_cone/materials.xml deleted file mode 100644 index 315c0fa848..0000000000 --- a/tests/test_reflective_cone/materials.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/test_reflective_cone/results_true.dat b/tests/test_reflective_cone/results_true.dat deleted file mode 100644 index c8b833bff4..0000000000 --- a/tests/test_reflective_cone/results_true.dat +++ /dev/null @@ -1,2 +0,0 @@ -k-combined: -2.269987E+00 4.469683E-03 diff --git a/tests/test_reflective_cylinder/geometry.xml b/tests/test_reflective_cylinder/geometry.xml deleted file mode 100644 index e6aed65daf..0000000000 --- a/tests/test_reflective_cylinder/geometry.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/tests/test_reflective_cylinder/materials.xml b/tests/test_reflective_cylinder/materials.xml deleted file mode 100644 index 315c0fa848..0000000000 --- a/tests/test_reflective_cylinder/materials.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/test_reflective_cylinder/results_true.dat b/tests/test_reflective_cylinder/results_true.dat deleted file mode 100644 index 0a11f3ef31..0000000000 --- a/tests/test_reflective_cylinder/results_true.dat +++ /dev/null @@ -1,2 +0,0 @@ -k-combined: -2.272436E+00 7.831006E-04 diff --git a/tests/test_reflective_cylinder/settings.xml b/tests/test_reflective_cylinder/settings.xml deleted file mode 100644 index a6fd5da19e..0000000000 --- a/tests/test_reflective_cylinder/settings.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - 10 - 5 - 1000 - - - - - -4 -4 -4 4 4 4 - - - - diff --git a/tests/test_reflective_cylinder/test_reflective_cylinder.py b/tests/test_reflective_cylinder/test_reflective_cylinder.py deleted file mode 100644 index 2a595f3e66..0000000000 --- a/tests/test_reflective_cylinder/test_reflective_cylinder.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -sys.path.insert(0, os.pardir) -from testing_harness import TestHarness - - -if __name__ == '__main__': - harness = TestHarness('statepoint.10.*') - harness.main() diff --git a/tests/test_reflective_sphere/geometry.xml b/tests/test_reflective_sphere/geometry.xml deleted file mode 100644 index 0dc98eba69..0000000000 --- a/tests/test_reflective_sphere/geometry.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/tests/test_reflective_sphere/results_true.dat b/tests/test_reflective_sphere/results_true.dat deleted file mode 100644 index 91dd20fba8..0000000000 --- a/tests/test_reflective_sphere/results_true.dat +++ /dev/null @@ -1,2 +0,0 @@ -k-combined: -2.271012E+00 3.466351E-03 diff --git a/tests/test_reflective_sphere/settings.xml b/tests/test_reflective_sphere/settings.xml deleted file mode 100644 index a6fd5da19e..0000000000 --- a/tests/test_reflective_sphere/settings.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - 10 - 5 - 1000 - - - - - -4 -4 -4 4 4 4 - - - - diff --git a/tests/test_reflective_sphere/test_reflective_sphere.py b/tests/test_reflective_sphere/test_reflective_sphere.py deleted file mode 100644 index 2a595f3e66..0000000000 --- a/tests/test_reflective_sphere/test_reflective_sphere.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -sys.path.insert(0, os.pardir) -from testing_harness import TestHarness - - -if __name__ == '__main__': - harness = TestHarness('statepoint.10.*') - harness.main() From d61424218f9580053e89a7301e0acebb1b8537f8 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Oct 2015 15:22:50 +0700 Subject: [PATCH 05/14] Clarify geometry methods documentation --- docs/source/methods/geometry.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/source/methods/geometry.rst b/docs/source/methods/geometry.rst index 6592909298..c1be68f72e 100644 --- a/docs/source/methods/geometry.rst +++ b/docs/source/methods/geometry.rst @@ -10,7 +10,7 @@ Constructive Solid Geometry OpenMC uses a technique known as `constructive solid geometry`_ (CSG) to build arbitrarily complex three-dimensional models in Euclidean space. In a CSG model, -every unique object is described as the union, intersection, or difference of +every unique object is described as the union and/or intersection of *half-spaces* created by bounding `surfaces`_. Every surface divides all of space into exactly two half-spaces. We can mathematically define a surface as a collection of points that satisfy an equation of the form :math:`f(x,y,z) = 0` @@ -54,13 +54,12 @@ dividing space into two half-spaces. Example of an ellipse and its associated half-spaces. References to half-spaces created by surfaces are used to define regions of -space of uniform composition, known as *cells*. While some codes allow regions -to be defined by intersections, unions, and differences or half-spaces, OpenMC -is currently limited to cells defined only as intersections of -half-spaces. Thus, the specification of the cell must include a list of -half-space references whose intersection defines the region. The region is then -assigned a material defined elsewhere. Figure :num:`fig-union` shows an -example of a cell defined as the intersection of an ellipse and two planes. +space of uniform composition, which are then assigned to *cells*. OpenMC allows +regions to be defined using union, intersection, and complement operators. As in +MCNP_, the intersection operator is implicit as doesn't need to be written in a +region specification. A defined region is then associated with a material +composition in a cell. Figure :num:`fig-union` shows an example of a cell region +defined as the intersection of an ellipse and two planes. .. _fig-union: From 7adde6fcb3c7744e8bd6104c09ea04bfd5316efd Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Oct 2015 21:35:55 +0700 Subject: [PATCH 06/14] Fix comments in quadric_distance --- src/surface_header.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/surface_header.F90 b/src/surface_header.F90 index 257cdbc1a1..8b4ed00919 100644 --- a/src/surface_header.F90 +++ b/src/surface_header.F90 @@ -1001,14 +1001,14 @@ contains quad = k*k - a*c if (quad < ZERO) then - ! no intersection with cone + ! no intersection with surface d = INFINITY elseif (coincident .or. abs(c) < FP_COINCIDENT) then - ! particle is on the cone, thus one distance is positive/negative and the - ! other is zero. The sign of k determines which distance is zero and which - ! is not. + ! particle is on the surface, thus one distance is positive/negative and + ! the other is zero. The sign of k determines which distance is zero and + ! which is not. if (k >= ZERO) then d = (-k - sqrt(quad))/a From a0a07e2550a82f2a69d5ec2b5760bf150808df73 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 13 Oct 2015 11:13:20 -0400 Subject: [PATCH 07/14] Fixed bug with triggers on tallies with multiple filters. Fixed bug when using triggers with tally score moments --- openmc/trigger.py | 15 +++++++++++++++ src/trigger.F90 | 23 +---------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/openmc/trigger.py b/openmc/trigger.py index e695defde2..0652834b83 100644 --- a/openmc/trigger.py +++ b/openmc/trigger.py @@ -1,6 +1,7 @@ from numbers import Real from xml.etree import ElementTree as ET import sys +import re from openmc.checkvalue import check_type, check_value @@ -96,6 +97,20 @@ class Trigger(object): 'it is not a string'.format(score) raise ValueError(msg) + # If this is a scattering moment, use generic moment order + regexp = re.compile(r'-[0-9]') + if regexp.search(score) is not None: + score = score.strip(regexp.findall(score)[0]) + score += '-n' + regexp = re.compile(r'-[p|P][0-9]') + if regexp.search(score) is not None: + score = score.strip(regexp.findall(score)[0]) + score += '-pn' + regexp = re.compile(r'-[y|Y][0-9]') + if regexp.search(score) is not None: + score = score.strip(regexp.findall(score)[0]) + score += '-yn' + # If the score is already in the Tally, don't add it again if score in self._scores: return diff --git a/src/trigger.F90 b/src/trigger.F90 index a74a64be0a..73cb0c7efe 100644 --- a/src/trigger.F90 +++ b/src/trigger.F90 @@ -92,7 +92,6 @@ contains character(len=52), intent(inout) :: name ! "eigenvalue" or tally score integer :: i ! index in tallies array - integer :: j ! level in tally hierarchy integer :: n ! loop index for nuclides integer :: s ! loop index for triggers integer :: filter_index ! index in results array for filters @@ -167,28 +166,8 @@ contains ! Initialize bins, filter level matching_bins(1:t % n_filters) = 0 - j = 1 - ! Find filter index - FILTER_LOOP: do - find_bin: do - if (t % n_filters == 0) exit find_bin - matching_bins(j) = matching_bins(j) + 1 - if (matching_bins(j) > t % filters(j) % n_bins) then - if (j == 1) exit FILTER_LOOP - matching_bins(j) = 0 - j = j - 1 - else - if (j == t % n_filters) exit find_bin - end if - end do find_bin - - if (t % n_filters > 0) then - filter_index = sum((max(matching_bins(1:t%n_filters),1) - 1) * & - t % stride) + 1 - else - filter_index = 1 - end if + FILTER_LOOP: do filter_index = 1, t % total_filter_bins ! Initialize score index score_index = trigger % score_index From 50e006dea908093834f02bad7aae4ea88b6b7cce Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Mon, 19 Oct 2015 09:19:40 -0400 Subject: [PATCH 08/14] Now only store StatePoint filename string in Tally class --- openmc/statepoint.py | 2 +- openmc/tallies.py | 29 +++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/openmc/statepoint.py b/openmc/statepoint.py index 133bd766c4..f34de86d79 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -358,7 +358,7 @@ class StatePoint(object): # Create Tally object and assign basic properties tally = openmc.Tally(tally_id=tally_key) - tally._statepoint = self + tally._sp_filename = self._f.filename tally.estimator = self._f['{0}{1}/estimator'.format( base, tally_key)].value.decode() tally.num_realizations = n_realizations diff --git a/openmc/tallies.py b/openmc/tallies.py index a0f617d08c..5b69371072 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -8,6 +8,7 @@ from xml.etree import ElementTree as ET import sys import numpy as np +import h5py from openmc import Mesh, Filter, Trigger, Nuclide from openmc.cross import CrossScore, CrossNuclide, CrossFilter @@ -103,7 +104,7 @@ class Tally(object): self._with_batch_statistics = False self._derived = False - self._statepoint = None + self._sp_filename = None self._results_read = False def __deepcopy__(self, memo): @@ -124,7 +125,7 @@ class Tally(object): clone._with_summary = self.with_summary clone._with_batch_statistics = self.with_batch_statistics clone._derived = self.derived - clone._statepoint = self._statepoint + clone._sp_filename = self._sp_filename clone._results_read = self._results_read clone._filters = [] @@ -264,12 +265,16 @@ class Tally(object): @property def sum(self): - if not self._statepoint: + if not self._sp_filename: return None if not self._results_read: + + # Open the HDF5 statepoint file + f = h5py.File(self._sp_filename, 'r') + # Extract Tally data from the file - data = self._statepoint._f['tallies/tally {0}/results'.format( + data = f['tallies/tally {0}/results'.format( self.id)].value sum = data['sum'] sum_sq = data['sum_sq'] @@ -293,11 +298,14 @@ class Tally(object): # Indicate that Tally results have been read self._results_read = True + # Close the HDF5 statepoint file + f.close() + return self._sum @property def sum_sq(self): - if not self._statepoint: + if not self._sp_filename: return None if not self._results_read: @@ -309,7 +317,7 @@ class Tally(object): @property def mean(self): if self._mean is None: - if not self._statepoint: + if not self._sp_filename: return None self._mean = self.sum / self.num_realizations @@ -318,7 +326,7 @@ class Tally(object): @property def std_dev(self): if self._std_dev is None: - if not self._statepoint: + if not self._sp_filename: return None n = self.num_realizations @@ -426,8 +434,13 @@ class Tally(object): # If the score is already in the Tally, don't add it again if score in self.scores: return - else: + + # Normal score strings + if isinstance(score, basestring): self._scores.append(score.strip()) + # CrossScores + else: + self._scores.append(score) @num_score_bins.setter def num_score_bins(self, num_score_bins): From 7173431d6bae3015fe8dc20e17cf425950e01f09 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 20 Oct 2015 23:33:26 -0400 Subject: [PATCH 09/14] Fixed comment in trigger.py for scattering moment regular expressions --- openmc/trigger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/trigger.py b/openmc/trigger.py index 0652834b83..4019d5d468 100644 --- a/openmc/trigger.py +++ b/openmc/trigger.py @@ -97,7 +97,7 @@ class Trigger(object): 'it is not a string'.format(score) raise ValueError(msg) - # If this is a scattering moment, use generic moment order + # If this is a total/flux/scattering moment, use generic moment order regexp = re.compile(r'-[0-9]') if regexp.search(score) is not None: score = score.strip(regexp.findall(score)[0]) From 65bd95fea09e1c0e01dac631003822f9e70e7fd0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 23 Oct 2015 13:56:52 -0500 Subject: [PATCH 10/14] Show maximum neutron transport energy and corresponding nuclide --- src/ace.F90 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ace.F90 b/src/ace.F90 index 69ad2f1a9a..a10af729c7 100644 --- a/src/ace.F90 +++ b/src/ace.F90 @@ -215,6 +215,16 @@ contains end do MATERIAL_LOOP3 + ! Show which nuclide results in lowest energy for neutron transport + do i = 1, n_nuclides_total + if (nuclides(i)%energy(nuclides(i)%n_grid) == energy_max_neutron) then + call write_message("Maximum neutron transport energy: " // & + trim(to_str(energy_max_neutron)) // " MeV for " // & + trim(adjustl(nuclides(i)%name)), 6) + exit + end if + end do + end subroutine read_xs !=============================================================================== @@ -486,11 +496,6 @@ contains ! than the previous energy_min_neutron = max(energy_min_neutron, nuc%energy(1)) energy_max_neutron = min(energy_max_neutron, nuc%energy(NE)) - if (nuc%energy(NE) < 20.0_8) then - call warning("Maximum energy for " // trim(adjustl(nuc%name)) // & - " is " // trim(to_str(nuc%energy(NE))) // " MeV. Neutrons will & - ¬ be allowed to go above this energy.") - end if end if end subroutine read_esz From 4089d6fb38c86179ebda9bfc6761b06d2df16454 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Sat, 24 Oct 2015 09:12:44 -0400 Subject: [PATCH 11/14] Put h5py import in Tally.sum property getter to make it an optional dependency for Python API --- openmc/tallies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/tallies.py b/openmc/tallies.py index 5b69371072..5c78b9d86b 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -8,7 +8,6 @@ from xml.etree import ElementTree as ET import sys import numpy as np -import h5py from openmc import Mesh, Filter, Trigger, Nuclide from openmc.cross import CrossScore, CrossNuclide, CrossFilter @@ -269,6 +268,7 @@ class Tally(object): return None if not self._results_read: + import h5py # Open the HDF5 statepoint file f = h5py.File(self._sp_filename, 'r') From 0fa75f293bb848c81dea309272720d780a5a4ef0 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Sat, 24 Oct 2015 10:04:19 -0400 Subject: [PATCH 12/14] Updated tally trigger score name key dictionary storage per recommendation by @paulromano --- openmc/trigger.py | 14 - src/input_xml.F90 | 9 +- tests/test_score_nuscatter_yn/geometry.xml | 148 +++++++++++ tests/test_score_nuscatter_yn/inputs_test.dat | 1 + tests/test_score_nuscatter_yn/materials.xml | 246 ++++++++++++++++++ tests/test_score_nuscatter_yn/settings.xml | 13 + tests/test_score_nuscatter_yn/tallies.xml | 11 + 7 files changed, 424 insertions(+), 18 deletions(-) create mode 100644 tests/test_score_nuscatter_yn/geometry.xml create mode 100644 tests/test_score_nuscatter_yn/inputs_test.dat create mode 100644 tests/test_score_nuscatter_yn/materials.xml create mode 100644 tests/test_score_nuscatter_yn/settings.xml create mode 100644 tests/test_score_nuscatter_yn/tallies.xml diff --git a/openmc/trigger.py b/openmc/trigger.py index 4019d5d468..9c7c660340 100644 --- a/openmc/trigger.py +++ b/openmc/trigger.py @@ -97,20 +97,6 @@ class Trigger(object): 'it is not a string'.format(score) raise ValueError(msg) - # If this is a total/flux/scattering moment, use generic moment order - regexp = re.compile(r'-[0-9]') - if regexp.search(score) is not None: - score = score.strip(regexp.findall(score)[0]) - score += '-n' - regexp = re.compile(r'-[p|P][0-9]') - if regexp.search(score) is not None: - score = score.strip(regexp.findall(score)[0]) - score += '-pn' - regexp = re.compile(r'-[y|Y][0-9]') - if regexp.search(score) is not None: - score = score.strip(regexp.findall(score)[0]) - score += '-yn' - # If the score is already in the Tally, don't add it again if score in self._scores: return diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 6d15f0d204..debe1309a2 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2796,6 +2796,10 @@ contains ! MOMENT_STRS(:) ! If so, check the order, store if OK, then reset the number to 'n' score_name = trim(sarray(j)) + + ! Append the score to the list of possible trigger scores + if (trigger_on) call trigger_scores % add_key(trim(score_name), j) + do imomstr = 1, size(MOMENT_STRS) if (starts_with(score_name,trim(MOMENT_STRS(imomstr)))) then n_order_pos = scan(score_name,'0123456789') @@ -3196,11 +3200,8 @@ contains end if end select - - ! Append the score to the list of possible trigger scores - if (trigger_on) call trigger_scores % add_key(trim(score_name), l) - end do + t % n_score_bins = n_scores t % n_user_score_bins = n_words diff --git a/tests/test_score_nuscatter_yn/geometry.xml b/tests/test_score_nuscatter_yn/geometry.xml new file mode 100644 index 0000000000..ed66ef8e6b --- /dev/null +++ b/tests/test_score_nuscatter_yn/geometry.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 +1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1 +1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + + + 1.26 1.26 + 17 17 + -10.71 -10.71 + +3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3 +3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3 +3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 +3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 8 8 8 8 8 8 8 7 7 7 +7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 +7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7 +7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 +7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 +7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_score_nuscatter_yn/inputs_test.dat b/tests/test_score_nuscatter_yn/inputs_test.dat new file mode 100644 index 0000000000..632a144031 --- /dev/null +++ b/tests/test_score_nuscatter_yn/inputs_test.dat @@ -0,0 +1 @@ +205e5cac8129797b815f0e79dad6c41a1876157ba69fcffecf67c3603dc36ded5f0168f9961d51fcb7dc7db6d732e7a3e8f82d04947aa0309df56bb8333d4bc9 \ No newline at end of file diff --git a/tests/test_score_nuscatter_yn/materials.xml b/tests/test_score_nuscatter_yn/materials.xml new file mode 100644 index 0000000000..9454c0d8e6 --- /dev/null +++ b/tests/test_score_nuscatter_yn/materials.xml @@ -0,0 +1,246 @@ + + + 71c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_score_nuscatter_yn/settings.xml b/tests/test_score_nuscatter_yn/settings.xml new file mode 100644 index 0000000000..9e514829e6 --- /dev/null +++ b/tests/test_score_nuscatter_yn/settings.xml @@ -0,0 +1,13 @@ + + + + 100 + 10 + 0 + + + + -160 -160 -183 160 160 183 + + + diff --git a/tests/test_score_nuscatter_yn/tallies.xml b/tests/test_score_nuscatter_yn/tallies.xml new file mode 100644 index 0000000000..eeaad08291 --- /dev/null +++ b/tests/test_score_nuscatter_yn/tallies.xml @@ -0,0 +1,11 @@ + + + + + nu-scatter-0 + + + + nu-scatter-y3 + + From f44dccca26413d2a21745c8f3ee59797659e9657 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Sat, 24 Oct 2015 10:07:36 -0400 Subject: [PATCH 13/14] Removed extraneous test inputs added by last commit --- tests/test_score_nuscatter_yn/geometry.xml | 148 ----------- tests/test_score_nuscatter_yn/inputs_test.dat | 1 - tests/test_score_nuscatter_yn/materials.xml | 246 ------------------ tests/test_score_nuscatter_yn/settings.xml | 13 - tests/test_score_nuscatter_yn/tallies.xml | 11 - 5 files changed, 419 deletions(-) delete mode 100644 tests/test_score_nuscatter_yn/geometry.xml delete mode 100644 tests/test_score_nuscatter_yn/inputs_test.dat delete mode 100644 tests/test_score_nuscatter_yn/materials.xml delete mode 100644 tests/test_score_nuscatter_yn/settings.xml delete mode 100644 tests/test_score_nuscatter_yn/tallies.xml diff --git a/tests/test_score_nuscatter_yn/geometry.xml b/tests/test_score_nuscatter_yn/geometry.xml deleted file mode 100644 index ed66ef8e6b..0000000000 --- a/tests/test_score_nuscatter_yn/geometry.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.26 1.26 - 17 17 - -10.71 -10.71 - -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 -1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 8 8 8 8 8 8 8 8 7 7 7 7 7 -7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 -7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 -7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 -7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 -7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 -7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 -7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 -7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 -7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 -7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 -7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 -7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 -7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 -7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7 -7 7 7 7 7 7 7 8 8 8 8 8 8 8 7 7 7 7 7 7 7 -7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 -7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 - - - - - - - - - - - - - - - - - - - diff --git a/tests/test_score_nuscatter_yn/inputs_test.dat b/tests/test_score_nuscatter_yn/inputs_test.dat deleted file mode 100644 index 632a144031..0000000000 --- a/tests/test_score_nuscatter_yn/inputs_test.dat +++ /dev/null @@ -1 +0,0 @@ -205e5cac8129797b815f0e79dad6c41a1876157ba69fcffecf67c3603dc36ded5f0168f9961d51fcb7dc7db6d732e7a3e8f82d04947aa0309df56bb8333d4bc9 \ No newline at end of file diff --git a/tests/test_score_nuscatter_yn/materials.xml b/tests/test_score_nuscatter_yn/materials.xml deleted file mode 100644 index 9454c0d8e6..0000000000 --- a/tests/test_score_nuscatter_yn/materials.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - 71c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/test_score_nuscatter_yn/settings.xml b/tests/test_score_nuscatter_yn/settings.xml deleted file mode 100644 index 9e514829e6..0000000000 --- a/tests/test_score_nuscatter_yn/settings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - 100 - 10 - 0 - - - - -160 -160 -183 160 160 183 - - - diff --git a/tests/test_score_nuscatter_yn/tallies.xml b/tests/test_score_nuscatter_yn/tallies.xml deleted file mode 100644 index eeaad08291..0000000000 --- a/tests/test_score_nuscatter_yn/tallies.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - nu-scatter-0 - - - - nu-scatter-y3 - - From fa9d874dff85627be942b4dd28f7e60012ecf145 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Sat, 24 Oct 2015 10:08:18 -0400 Subject: [PATCH 14/14] Removed unused import for re in trigger.py --- openmc/trigger.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openmc/trigger.py b/openmc/trigger.py index 9c7c660340..e695defde2 100644 --- a/openmc/trigger.py +++ b/openmc/trigger.py @@ -1,7 +1,6 @@ from numbers import Real from xml.etree import ElementTree as ET import sys -import re from openmc.checkvalue import check_type, check_value