Chi-Tech
test/modules/LinearBoltzmannSolvers/Transport_Keigen/c5g7/c5g7.lua
-- Final k-eigenvalue : 1.1925596 (265)
dofile("mesh/gmesh_coarse.lua")
--os.exit()
dofile("materials/materials.lua")
--############################################### Setup Physics
--========== ProdQuad
pquad = chiCreateProductQuadrature(GAUSS_LEGENDRE_CHEBYSHEV,2, 2)
--pquad = chiCreateProductQuadrature(GAUSS_LEGENDRE_CHEBYSHEV,1, 1)
phys1 = lbs.DiscreteOrdinatesSolver.Create
({
num_groups = num_groups,
groupsets =
{
{
groups_from_to = {0, num_groups-1},
angular_quadrature_handle = pquad,
inner_linear_method = "gmres",
l_max_its = 5,
l_abs_tol = 1.0e-10,
angle_aggregation_type = "polar",
angle_aggregation_num_subsets = 1,
groupset_num_subsets = 1,
}
},
options =
{
boundary_conditions = { { name = "xmin", type = "reflecting"},
{ name = "ymin", type = "reflecting"} },
scattering_order = 1,
verbose_inner_iterations = true,
verbose_outer_iterations = true,
power_field_function_on = true,
power_default_kappa = 1.0,
-- power_normalization = -1.0, --Disabled
power_normalization = 1.0, --Disabled
save_angular_flux = true
},
sweep_type = "CBC"
})
--############################################### Initialize and Execute Solver
if (k_method == "pi") then
k_solver = lbs.XXPowerIterationKEigen.Create
({
lbs_solver_handle = phys1,
k_tol = 1.0e-8
})
chiSolverExecute(k_solver)
elseif (k_method == "pi_scdsa") then
k_solver = lbs.XXPowerIterationKEigenSCDSA.Create
({
lbs_solver_handle = phys1,
diff_accel_sdm = "pwld",
accel_pi_verbose = true,
k_tol = 1.0e-8,
accel_pi_k_tol = 1.0e-8,
accel_pi_max_its = 50,
})
chiLBSGroupsetSetIterativeMethod(phys1, 0, KRYLOV_RICHARDSON_CYCLES)
chiSolverExecute(k_solver)
elseif (k_method == "pi_scdsa_pwlc") then
k_solver = lbs.XXPowerIterationKEigenSCDSA.Create
({
lbs_solver_handle = phys1,
diff_accel_sdm = "pwlc",
accel_pi_verbose = true,
k_tol = 1.0e-8,
accel_pi_k_tol = 1.0e-8,
accel_pi_max_its = 50,
})
chiLBSGroupsetSetIterativeMethod(phys1, 0, KRYLOV_RICHARDSON_CYCLES)
chiSolverExecute(k_solver)
elseif (k_method == "jfnk") then
k_solver = lbs.XXNonLinearKEigen.Create
({
lbs_solver_handle = phys1,
nl_max_its = 50,
nl_abs_tol = 1.0e-10,
nl_rel_tol = 1.0e-10,
l_max_its = 20,
num_free_power_iterations = 2,
})
chiSolverExecute(k_solver)
else
chiLog(LOG_0ERROR, "k_method must be specified. \"pi\", "..
"\"pi_scdsa\", \"pi_scdsa_pwlc\" or \"jfnk\"");
os.exit(1)
end
if (master_export == nil) then
fflist,count = chiLBSGetScalarFieldFunctionList(phys1)
chiExportMultiFieldFunctionToVTK(fflist,"solutions/ZPhi")
end
Pair chiLBSGetScalarFieldFunctionList(int SolverIndex)
void chiLBSGroupsetSetMaxIterations(int SolverIndex, int GroupsetIndex, int Numiter)
void chiLBSGroupsetSetIterativeMethod(int SolverIndex, int GroupsetIndex, int IterativeMethod)
void chiLog(int LogType, char LogMsg)
void chiMeshHandlerExportMeshToVTK(char FileName)
Returns chiCreateProductQuadrature(int QuadratureType, varying values)
void chiOptimizeAngularQuadratureForPolarSymmetry(in handle, double normalization)
void chiSolverExecute(int solver_handle)
void chiSolverInitialize(int solver_handle)
Definition: lua_functions.c:92
void chiExportMultiFieldFunctionToVTK(table listFFHandles, char BaseName)