-- 2D Transport test with localized material source
-- SDM: PWLD
-- Test: QOI-value=1.38399e-05
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
nodes={}
N=60
L=5.0
ds=L/N
xmin=0.0
for i=0,N do
nodes[i+1] = xmin + i*ds
end
----###############################################
Set Material IDs
vol0 = NewRPP({infx=true, infy=true, infz=true})
vol1 = NewRPP({ymin=0.0,ymax=0.8*L,infx=true,infz=true})
----###############################################
Set Material IDs
vol0b = NewRPP({xmin=-0.166666+2.5,xmax=0.166666+2.5,infy=true,infz=true})
vol2 = NewRPP({xmin=-0.166666+2.5,xmax=0.166666+2.5,ymin=0.0,ymax=2*0.166666,infz=true})
vol1b = NewRPP({xmin=-1+2.5,xmax=1+2.5,ymin=0.9*L,ymax=L,infz=true})
--############################################### Add materials
materials = {}
num_groups = 1
TRANSPORT_XSECTIONS,
SIMPLEXS1,1,0.01,0.01)
TRANSPORT_XSECTIONS,
SIMPLEXS1,1,0.1*20,0.8)
TRANSPORT_XSECTIONS,
SIMPLEXS1,1,0.3*20,0.0)
src={}
for g=1,num_groups do
src[g] = 0.0
end
src[1] = 0.0
src[1] = 0.0
src[1] = 3.0
--############################################### Setup Physics
lbs_block =
{
num_groups = num_groups,
groupsets =
{
{
groups_from_to = {0, num_groups-1},
angular_quadrature_handle = pquad0,
inner_linear_method = "gmres",
l_abs_tol = 1.0e-6,
l_max_its = 500,
gmres_restart_interval = 100,
},
}
}
lbs_options =
{
scattering_order = 1,
}
lbs.SetOptions(phys1, lbs_options)
--############################################### Initialize and Execute Solver
--############################################### Create QOIs
tvol0 = NewRPP({xmin=2.3333,xmax=2.6666,ymin=4.16666,ymax=4.33333,infz=true})
tvol1 = NewRPP({xmin=0.5 ,xmax=0.8333,ymin=4.16666,ymax=4.33333,infz=true})
--############################################### Get field functions
--############################################### Slice plot
--############################################### Volume integrations
curffi = ffi1
chiLog(LOG_0,
string.format(
"QOI-value=%.5e", QOI_value))
--############################################### Exports
if master_export == nil then
end
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 chiOptimizeAngularQuadratureForPolarSymmetry(in handle, double normalization)
void chiVolumeMesherSetProperty(int PropertyIndex, varying PropertyValue)
void chiSolverExecute(int solver_handle)
void chiSolverInitialize(int solver_handle)
handle chiGetFieldFunctionHandleByName(string FFname)
void chiExportMultiFieldFunctionToVTK(table listFFHandles, char BaseName)
void Set(VecDbl &x, const double &val)