-- 3D Transport test with
Vacuum BCs and a material source reading source moments
-- SDM: PWLD
-- Test: Max-value=1.01701e-04 and 9.14681e-06
num_procs = 4
--############################################### Check num_procs
if (check_num_procs==nil and chi_number_of_processes ~= num_procs) then
chiLog(LOG_0ERROR,
"Incorrect amount of processors. " ..
"Expected "..tostring(num_procs)..
". Pass check_num_procs=false to override if possible.")
os.exit(false)
end
--############################################### Setup mesh
({
inputs =
{
({
filename = "../../../../resources/TestMeshes/SquareMesh2x2Quads.obj"
}),
},
layers = {{z=0.4,n=2},{z=0.8,n=2},{z=1.2,n=2},{z=1.6,n=2}}, -- layers
({
nx = 2, ny=2,
xcuts = {0.0}, ycuts = {0.0}
})
})
--###############################################
Set Material IDs
({ xmin=-0.5/8,xmax=0.5/8,ymin=-0.5/8,ymax=0.5/8, infz=true })
--############################################### Add materials
materials = {}
num_groups = 21
CHI_XSFILE,"xs_graphite_pure.cxs")
CHI_XSFILE,"xs_graphite_pure.cxs")
src={}
for g=1,num_groups do
src[g] = 0.0
end
src[1] = 1.0
--############################################### Setup Physics
lbs_block =
{
num_groups = num_groups,
groupsets =
{
{
groups_from_to = {0, 20},
angular_quadrature_handle = pquad0,
--angle_aggregation_type = "single",
angle_aggregation_num_subsets = 1,
groupset_num_subsets = 1,
inner_linear_method = "gmres",
l_abs_tol = 1.0e-6,
l_max_its = 300,
gmres_restart_interval = 100,
},
}
}
lbs_options =
{
scattering_order = 1,
use_source_moments = true,
}
lbs.SetOptions(phys1, lbs_options)
--############################################### Initialize and Execute Solver
--############################################### Get field functions
--############################################### Slice plot
--slices = {}
--for k=1,count do
--end
--############################################### Volume integrations
curffi = ffi1
chiLog(LOG_0,
string.format(
"Max-value1=%.5e", maxval))
curffi = ffi1
chiLog(LOG_0,
string.format(
"Max-value2=%.5e", maxval))
--############################################### Exports
if (master_export == nil) then
end
--############################################### Plots
if (chi_location_id == 0 and master_export == nil) then
--os.execute("python ZPFFI00.py")
----os.execute("python ZPFFI11.py")
--local handle = io.popen("python ZPFFI00.py")
print("Execution completed")
end
if (chi_location_id == 0) then
os.execute("rm Qmoms*")
end
Pair chiLBSGetScalarFieldFunctionList(int SolverIndex)
void chiFFInterpolationExportPython(int FFIHandle, char BaseName)
Handle chiFFInterpolationCreate(int FFITypeIndex)
void chiFFInterpolationExecute(int FFIHandle)
void chiFFInterpolationGetValue(int FFIHandle)
void chiFFInterpolationInitialize(int FFIHandle)
Handle chiFFInterpolationSetProperty(int FFIHandle, int PropertyIndex)
void chiLog(int LogType, char LogMsg)
MaterialHandle chiPhysicsAddMaterial(char Name)
void chiPhysicsMaterialAddProperty(int MaterialHandle, int PropertyIndex)
void chiPhysicsMaterialSetProperty(int MaterialHandle, int PropertyIndex, int OperationIndex, varying Information)
Returns chiCreateProductQuadrature(int QuadratureType, varying values)
void chiVolumeMesherSetProperty(int PropertyIndex, varying PropertyValue)
void chiSolverExecute(int solver_handle)
void chiSolverInitialize(int solver_handle)
void chiExportMultiFieldFunctionToVTK(table listFFHandles, char BaseName)
void chiLBSReadSourceMoments(int SolverIndex, string file_base, bool single_file_flag)
void Set(VecDbl &x, const double &val)