-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_diffusion_1d.m
79 lines (61 loc) · 2.48 KB
/
test_diffusion_1d.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
%> @file test_diffusion_1d.m
%> @brief Tests 1D diffusion stuff.
%
%> Finish me.
% ==============================================================================
clear
% ==============================================================================
% INPUT
% ==============================================================================
input = Input();
put(input, 'dimension', 1);
put(input, 'number_groups', 1);
put(input, 'inner_solver', 'SI');
put(input, 'inner_print_out', 1);
put(input, 'outer_print_out', 1);
% ==============================================================================
% MATERIALS (Test two group data)
% ==============================================================================
mat = test_materials(1);
% ==============================================================================
% MESH (The simple slab reactors from Mosher's thesis)
% ==============================================================================
% Several such assemblies to make the total coarse mesh definition
xcm = [ 0.0 10];
xfm = [ 10 ];
mt = [ 1 ];
mesh = Mesh1D(xfm, xcm, mt);
% ==============================================================================
% FIXED SOURCE
% ==============================================================================
q_e = Source(mesh, 1);
spectra = [ 1.0 ];
place = [ 1 ];
set_sources(q_e, spectra, place);
% ==============================================================================
% SETUP
% ==============================================================================
state = State(input, mesh);
quadrature = GaussLegendre(8);
boundary = BoundaryMesh(input, mesh, quadrature);
q_f = FissionSource(state, mesh, mat); % Not inititalized = not used.
% ==============================================================================
% SOLVE
% ==============================================================================
solver = Fixed(input, ...
state, ...
boundary, ...
mesh, ...
mat, ...
quadrature, ...
q_e, ...
q_f);
tic
out = solve(solver);
toc
% ==============================================================================
% POSTPROCESS
% ==============================================================================
f = flux(state, 1);
diffop = DiffusionOperator(input, mat, mesh);
M = diffop.get_1g_operator(1);