Example #1
0
    }
}

if (core_config < 1) or (core_config > 3):
    raise TypeError('Invalid core configuration no. [1-3].')
else:
    core = np.ones(nfa, dtype=np.int)
    core[1::2] += core_config

cum_sum_list = lambda l1: l1[0] + cum_sum_list(l1[1:]) if len(l1) != 1 else l1[
    0]
media = cum_sum_list([get_fa(core[i], i, Lmat) for i in range(nfa)])

# set b.c.
LBC, RBC = 0, 0

Heter2GSlab_data = input_data(xs_media, media, xi, geometry_type, LBC, RBC)

if __name__ == "__main__":

    import logging as lg
    lg.info("*** Solve the Rahnema 1997 problem ***")
    from FDsDiff1D import run_calc_with_RM_its, solver_options

    ritmax = 10
    CMFD, pCMFD = True, False
    slvr_opts = solver_options(ritmax=ritmax, CMFD=CMFD, pCMFD=pCMFD)
    filename = "../output/kflx_Rahnema1997_C%d_LBC%dRBC%d_I%d_itr%d" % \
               (core_config, LBC, RBC, I, ritmax)
    flx, k = run_calc_with_RM_its(Heter2GSlab_data, slvr_opts, filename)
Example #2
0
 lg.info('analytical solution of the diffusion equation')
 ansol, DFkref = diffsol_ref(data.xim), \
                 diffk_ref(BG**2, materials[m])
 # lg.info('fund. flx\n' +
 #         str(ansol / np.sum(ansol * data.Vi) * G * I))
 lg.info('kinf = {:.6}, k_DIFF = {:.6f}, BG2 = {:.6f}'.format(
     materials[m]['kinf'], diffk_ref(BG**2, materials[m]), BG**2))
 lg.info(' -o-' * 15)
 # diffusion problem
 slvr_opts = solver_options(iitmax=5,
                            oitmax=5,
                            ritmax=0,
                            ks=np.full(I, nks))
 filename = os.path.join(
     odir, case + "_LBC%dRBC%d_I%d_diff" % (LBC, 0, I))
 flx, k = run_calc_with_RM_its(data, slvr_opts, filename)
 flx *= anorm / np.sum(flx) / data.Vi
 np.save(
     filename.replace('_diff', '_andf') + '.npy',
     (DFkref, BG, (1 - flx[0, :] / ansol) * 100))
 np.testing.assert_allclose(
     k,
     DFkref,
     atol=Dktol,
     err_msg=case +
     ": criticality against diffusion analytically solved not " +
     "verified")
 np.testing.assert_allclose(
     flx[0, :],
     ansol,
     rtol=Dftol,