Esempio n. 1
0
                print io, tdT[io], tdI[io]

    if direc in 'ij':
        # plot traverse along the direction direc.
        # at the specified height.
        plt = Plotter()
        plt.add_line(0, 0, '', 'temp', 0, fmt='og', label='T')
        plt.add_line(0, 1, '', 'temp', 0, fmt='ob', label='I')
        plt.ylabel[0] = 'Fuel temperature, K'
        plt.xlabel[0] = 'Index ' + odir
        plt.ylim[0] = (600, 1300)

        xlst = range(0, len(tdT))
        elst = [0] * len(tdT)

        a1 = Box(X=1, Y=1, Z=51)
        a1.pos.z = 25
        a1.temp.set_grid([1] * 51)
        a2 = a1.copy_tree()

        a0 = Box()
        a0.insert(1, a1)
        a0.insert(2, a2)

        tdT = map(lambda kv: kv[1], sorted(tdT.items()))
        tdI = map(lambda kv: kv[1], sorted(tdI.items()))

        for (tT, tI) in zip(tdT, tdI):
            print tT, tI

        print len(tdT), len(tdI)
Esempio n. 2
0
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from rod_models import pin, ifba, tube, chan
from rod_models import ap, ah, pp
from assembly_map import map_dict

# 1

# Number of rod rows and columns:
Nx = 17
Ny = Nx

# 2

model = Box(Z=ah + 2*ap)
model.X = Nx*pp - 0.000001
model.Y = Ny*pp - 0.000001

model.material = 'water'
model.temp.set_values(580.)
model.dens.set_values(1.)

model.grid.x = pp
model.grid.y = pp
model.grid.z = model.Z

model.temp.prec = 50. 
model.dens.prec = 0.002

# 3
Esempio n. 3
0
# PIRS-2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from pirs.tools.plots import colormap

# pin model
pin = Cylinder(R=0.45, Z=100, material='clad')
pin.insert(Cylinder(R=0.4, Z=pin.Z-5, material='fuel'))

# assembly box
a = Box(X=5, Y=7, Z=pin.Z+10, material='water')
a.grid.x = 1
a.grid.y = 1.1
a.grid.z = a.Z

# insert pins
for i in range(5):
    for j in range(6):
        a.grid.insert((i,j,0), pin.copy_tree())

# center grid with respect to solid
a.grid.center()

colormap(a, filename='sol2z.png')
colormap(a, plane={'x':0}, filename='sol2x.png', aspect='auto')
Esempio n. 4
0
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

Test interpolation of cross sections by comparing
axial power profile.

Model -- one PWR pin with mox fuel.
"""
from pirs.solids import Box
from pirs.tools import dump

from rod_models import mox3
from pin_mcnp import MI

b = Box(Z=mox3.Z, X=1.26, Y=1.26)
b.material = 'bwater'
b.dens.set_grid([1, 1, 1])
b.dens.set_values([0.77, 0.74, 0.77])
b.insert(mox3)
f = mox3.children[0]
f.heat.set_grid([1]*10)

b.temp.set_values(600)
mox3.temp.set_values(600)

MI.gm = b

MI.kcode.Nh = 800000
MI.kcode.Nct = 4000
MI.kcode.Ncs = 3000
Esempio n. 5
0
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PIRS-2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from pirs.solids import Box
from rod_models import pp, ah, ap
from rod_models import ifba as pin

w = Box(X=pp, Y=pp, Z=ah + 2 * ap)  # water box
w.material = 'water'

w.dens.set_values(1)
w.temp.set_values(580.)

w.insert(pin)

# needed in SCF interface:
fuel_key = ('pin', 'gap', 'fuel')
rod_key = pin.get_key()

# unify names
model = w
Esempio n. 6
0
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PIRS-2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from pirs.mcnp import Material
from pirs import McnpInterface

# GEOMETRY 
b = Box(material='m1')
b.dens.set_values(18.8)

# MCNP-SPECIFIC DATA
i = McnpInterface(b)
i.materials['m1'] = Material('U')  # material
i.bc['axial'] = '*'               # b.c.
i.bc['radial'] = '*'
i.adc.append('ksrc 0 0 0')        # kcode source
i.adc.append('kcode 100 1 30 100')

if __name__ == '__main__':
    # RUN MCNP
    i.run('R')                # start MCNP 
    print 'K-inf:', i.keff()  # print Keff
Esempio n. 7
0
from minicore_map2 import m as uox_map
from rod_models import ap, ah, pp
from rod_models import uox, mox1, mox2, mox3, waba, tube, chan, ifba, fuel_key

# master assembly model, Npi x Npj:
Ia = (0, 2
      )  # assembly indices to model (0,0) -- lower left, (2,2) -- upper right
Ja = (0, 2)
Nai = (Ia[1] - Ia[0] + 1)
Naj = (Ja[1] - Ja[0] + 1)
Na = Nai * Naj
Nap = 17  #: Number of rods per assembly
Npi = Nap * Nai
Npj = Nap * Naj

a = Box(Z=ah, X=Npi * pp, Y=Npj * pp)
a.material = 'bwater'
a.temp.set_values(580.)
a.dens.set_values(0.8)
a.grid.x = pp
a.grid.y = pp
a.grid.z = a.Z

rod_dict = {}
rod_dict['u'] = uox
rod_dict['i'] = ifba
rod_dict['c'] = chan
rod_dict['g'] = tube
rod_dict['_'] = tube
rod_dict['m1'] = mox1
rod_dict['m2'] = mox2
Esempio n. 8
0
from qcore_map import core_map, uox_map, mox_map, ref_map, emp_map
from rod_models import ap, ah, pp
from rod_models import uox, mox1, waba, tube, chan, ifba, fuel_key, ifba_fuel_key, ifba_ab_key, waba_ab_key

# for 1/4 model heat tallies not needed:
for pin in [uox, mox1, ifba]:
    for c in pin.values():
        c.heat = None

# steel pin for reflector assembly:
cyl = uox.copy_tree()
for c in cyl.children:  #### .values():
    c.withdraw()

vessel = Cylinder(Z=ah + 2 * ap, R=9 * ap)
awater = Box(X=9 * ap, Y=9 * ap, Z=ah + 2 * ap)
awater.material = 'bwater'
awater.temp.set_values(580.)
awater.dens.set_values(0.8)
awater.name = 'axial_reflector'
awater.pos.x = awater.X / 2.
awater.pos.y = -awater.Y / 2.

qcore = Box(X=9 * ap, Y=9 * ap, Z=ah)

vessel.insert(awater)
vessel.insert(qcore)
qcore.name = 'core_container'
qcore.pos.x = qcore.X / 2.
qcore.pos.y = -qcore.Y / 2.
Esempio n. 9
0
from pirs.solids import Box
from rod_models import uox, mox1, mox2, mox3, waba, tube, chan, ifba

###   # take mox fractions from MCNP materials:
###   from pin_mcnp import moxlist
###   r = moxlist[0].recipe()
###   ux = r[0][0] # uox ingridiend
###   px = r[1][0] # puox ingridiend
###   moxfrac = []
###   for m in moxlist:
###       gux = m.how_much(2, ux)
###       gpx = m.how_much(2, px)
###       f = gpx/(gux + gpx)
###       moxfrac.append(f)

minicore = Box(Z=ah)
minicore.X = Nax * ap
minicore.Y = Nay * ap
minicore.material = 'bwater'
minicore.temp.set_values(560.)
minicore.dens.set_values(0.8)

minicore.grid.x = pp
minicore.grid.y = pp
minicore.grid.z = minicore.Z

print 'minicore variable is created'

# prepare all rods
rods = []
fmt = ' {},{}'
Esempio n. 10
0
# This file is part of PIRS-2.
#
# PIRS-2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PIRS-2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

cnt = Box(X=2.53, Y=2.53, Z=365, material='water')
r = Cylinder(R=0.4583, Z=365, material='steel')
f = Cylinder(R=0.3951, Z=365, material='fuel')

r.insert(f)
cnt.insert(r)

r2 = cnt.insert(r.copy_tree())
r2.pos.x = 0.8
r2.pos.y = 0.8

if __name__ == '__main__':
    from pirs.tools.plots import colormap
    pz = colormap(cnt, plane={'z': 0})
    px = colormap(cnt, plane={'x': 0}, aspect='auto')
    py = colormap(cnt, plane={'y': 0}, aspect='auto')
Esempio n. 11
0
# PIRS-2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PIRS-2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from pirs.tools.plots import colormap

b = Box()
b.X = 3
b.Y = 4
b.Z = 5
b.material = 'm1'

c1 = Cylinder()
c1.R = 1
c1.Z = 4
c1.material = 'm2'

b.insert(c1)

c2 = c1.copy_tree()
c2.material = 'm3'
c2.R = 0.8
Esempio n. 12
0
#
# PIRS-2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PIRS-2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


b = Box(X=3, Y=3)

c = Cylinder(R=0.4)

b.grid.x = 1
b.grid.y = 1

for i in [0, 1]:
    for j in [0, 1]:
        cc = c.copy_tree()
        b.grid.insert((i, j, 0), cc)
        cc.material = 'm{}{}'.format(i,j)

from pirs.tools.plots import colormap
colormap(b, filename='ex3_1.pdf')
Esempio n. 13
0
#
# PIRS-2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PIRS-2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# surrounding water
b = Box(material='water')
b.X = 1.26
b.Y = b.X
b.Z = 400

# clad
c = Cylinder(material='steel')
c.R = 0.4583
c.Z = 360

# fuel
f = Cylinder(material='fuel')
f.R = 0.3951
f.Z = 350

# construct model