|
24 | 24 |
|
25 | 25 | #---------------------------------------------------------------------------------------# |
26 | 26 | class ADVANTG_Settings: |
27 | | - """ |
28 | | - Creates a object representing the settings for running the ADVANTG deterministic radiation trasport code calculations. |
29 | | - |
30 | | - Attributes |
31 | | - ========== |
32 | | - lib : string |
33 | | - The multi-group library used |
34 | | - [Default: "dplus"] |
35 | | - method : string |
36 | | - The solution method for ADVANTG (CADIS or DX) |
37 | | - [Default: "cadis"] |
38 | | - ouputs : string |
39 | | - The output files to be produced |
40 | | - [Default: "mcnp"] |
41 | | - tnum : int |
42 | | - The tally number for calculating the adjoint flux |
43 | | - [Default: 24] |
44 | | - pt_src : string |
45 | | - Whether or not the source should be treated as a point source in deterministic transport |
46 | | - [Default: False] |
47 | | - mix_tol : string |
48 | | - The material mix tolerance fraction. Controls the precision of mixed cells. |
49 | | - [Default: 0.01] |
50 | | - pn_order : integer |
51 | | - The scattering order |
52 | | - [Default: 1] |
53 | | - eta_x : float |
54 | | - The spacing of the mesh intervals in the x (radial) axis in cm in the ETA. |
55 | | - [Default: 0.5 cm] |
56 | | - eta_y : float |
57 | | - The spacing of the mesh intervals in the y (radial) axis in cm in the ETA. |
58 | | - [Default: 0.5 cm] |
59 | | - eta_z : float |
60 | | - The spacing of the mesh intervals in the z (axial) axis in cm in the ETA. |
61 | | - [Default: 0.5 cm] |
62 | | - foil_x : float |
63 | | - The spacing of the mesh intervals in the x (radial) axis in cm near the foil. |
64 | | - [Default: 0.25 cm] |
65 | | - foil_y : float |
66 | | - The spacing of the mesh intervals in the y (radial) axis in cm near the foil. |
67 | | - [Default: 0.25 cm] |
68 | | - foil_z : float |
69 | | - The spacing of the mesh intervals in the z (axial) axis in cm near the foil. |
70 | | - [Default: 0.05 cm] |
71 | | - ext_spacing : float |
72 | | - The spacing of the mesh intervals in x,y, and z axis in cm outside the ETA. |
73 | | - [Default: 1 cm] |
74 | | - |
75 | | - Returns |
76 | | - ======= |
77 | | - None |
78 | | - """ |
79 | | - |
80 | 27 |
|
| 28 | + ## Creates a object representing the settings for running the ADVANTG deterministic radiation trasport code calculations. |
81 | 29 | def __init__(self, lib="dplus", method="cadis", outputs="mcnp silo", tnum=24, pt_src="True", mix_tol=0.01, pn_order=1, eta_x=0.5, eta_y=0.5, eta_z =0.5, foil_x=0.25, foil_y=0.25, foil_z=0.05, ext_spacing=1.0): |
| 30 | + ## string The multi-group library used |
| 31 | + # [Default: "dplus"] |
82 | 32 | self.lib=lib |
| 33 | + ## string The solution method for ADVANTG (CADIS or DX) |
| 34 | + # [Default: "cadis"] |
83 | 35 | self.method=method |
| 36 | + ## string The output files to be produced |
| 37 | + # [Default: "mcnp"] |
84 | 38 | self.outputs=outputs |
| 39 | + ## int The tally number for calculating the adjoint flux |
| 40 | + # [Default: 24] |
85 | 41 | self.tnum=tnum |
| 42 | + ## string Whether or not the source should be treated as a point source in deterministic transport |
| 43 | + # [Default: False] |
86 | 44 | self.pt_src=pt_src |
| 45 | + ## string The material mix tolerance fraction. Controls the precision of mixed cells. |
| 46 | + # [Default: 0.01] |
87 | 47 | self.mix_tol=mix_tol |
| 48 | + ## integer The scattering order |
| 49 | + # [Default: 1] |
88 | 50 | self.pn_order=pn_order |
| 51 | + ## float The spacing of the mesh intervals in the x (radial) axis in cm in the ETA. |
| 52 | + # [Default: 0.5 cm] |
89 | 53 | self.eta_x=eta_x |
| 54 | + ## float The spacing of the mesh intervals in the y (radial) axis in cm in the ETA. |
| 55 | + # [Default: 0.5 cm] |
90 | 56 | self.eta_y=eta_y |
| 57 | + ## float The spacing of the mesh intervals in the z (axial) axis in cm in the ETA. |
| 58 | + # [Default: 0.5 cm] |
91 | 59 | self.eta_z=eta_z |
| 60 | + ## float The spacing of the mesh intervals in the x (radial) axis in cm near the foil. |
| 61 | + # [Default: 0.25 cm] |
92 | 62 | self.foil_x=foil_x |
| 63 | + ## float The spacing of the mesh intervals in the y (radial) axis in cm near the foil. |
| 64 | + # [Default: 0.25 cm] |
93 | 65 | self.foil_y=foil_y |
| 66 | + ## float The spacing of the mesh intervals in the z (axial) axis in cm near the foil. |
| 67 | + # [Default: 0.05 cm] |
94 | 68 | self.foil_z=foil_z |
| 69 | + ## float The spacing of the mesh intervals in x,y, and z axis in cm outside the ETA. |
| 70 | + # [Default: 1 cm] |
95 | 71 | self.ext=ext_spacing |
96 | 72 |
|
97 | 73 |
|
@@ -119,25 +95,24 @@ def __str__(self): |
119 | 95 | s = header |
120 | 96 | return s |
121 | 97 |
|
122 | | - |
| 98 | + ## Parses a ADVANTG settings csv input file. |
| 99 | + # The key word options are: |
| 100 | + # Library |
| 101 | + # Method |
| 102 | + # Outputs |
| 103 | + # Tally Number |
| 104 | + # Point Source |
| 105 | + # Material Mix Tolerance |
| 106 | + # Scattering Order |
| 107 | + # ETA X Spacing Interval |
| 108 | + # ETA Y Spacing Interval |
| 109 | + # ETA Z Spacing Interval |
| 110 | + # Foil X Spacing Interval |
| 111 | + # Foil Y Spacing Interval |
| 112 | + # Foil Z Spacing Interval |
| 113 | + # External Spacing Interval |
123 | 114 | def read_settings(self, filename): |
124 | | - """Parses a ADVANTG settings csv input file. |
125 | | - The key word options are: |
126 | | - Library |
127 | | - Method |
128 | | - Outputs |
129 | | - Tally Number |
130 | | - Point Source |
131 | | - Material Mix Tolerance |
132 | | - Scattering Order |
133 | | - ETA X Spacing Interval |
134 | | - ETA Y Spacing Interval |
135 | | - ETA Z Spacing Interval |
136 | | - Foil X Spacing Interval |
137 | | - Foil Y Spacing Interval |
138 | | - Foil Z Spacing Interval |
139 | | - External Spacing Interval |
140 | | - """ |
| 115 | + |
141 | 116 | # Open file |
142 | 117 | try: |
143 | 118 | self.f = open(filename, 'r') |
@@ -202,31 +177,14 @@ def read_settings(self, filename): |
202 | 177 | # Test that the file closed |
203 | 178 | assert self.f.closed==True, "File did not close properly." |
204 | 179 |
|
205 | | -#-------------------------------------------------------------------------------------------------------------# |
| 180 | +## Print the generated MCNP input deck to file |
| 181 | +# @param eta [ETA parameters object] An object that contains all of the constraints required to initialize the geometry |
| 182 | +# @param geom [MCNP_Geometry object] The geometry for running the MCNP radiation trasport code. Contains the surfaces, cells, and material information |
| 183 | +# @param S [ADVANTG_Settings object] An object representing the settings for running the ADVANTG radiation trasport code. |
| 184 | +# @param num integer The current cuckoo number being generated |
| 185 | +# @param cluster boolean (optional) An indicator to change the file to run on a cluster using Run_Transport function and slurm job submission |
206 | 186 | def Print_ADVANTG_Input(eta,geom,S,num,cluster=False): |
207 | | - """ |
208 | | - Print the generated MCNP input deck to file |
209 | | - |
210 | | - Parameters |
211 | | - ========== |
212 | | - eta : ETA parameters object |
213 | | - An object that contains all of the constraints required to initialize the geometry |
214 | | - geom : MCNP_Geometry object |
215 | | - The geometry for running the MCNP radiation trasport code. Contains the surfaces, cells, and material information |
216 | | - S : ADVANTG_Settings object |
217 | | - An object representing the settings for running the ADVANTG radiation trasport code. |
218 | | - num : integer |
219 | | - The current cuckoo number being generated |
220 | | -
|
221 | | - Optional |
222 | | - ======== |
223 | | - cluster : boolean |
224 | | - An indicator to change the file to run on a cluster using Run_Transport function and slurm job submission |
225 | | - |
226 | | - Returns |
227 | | - ======= |
228 | | - None |
229 | | - """ |
| 187 | + |
230 | 188 | path=os.path.abspath(os.path.join(os.path.abspath(os.getcwd()), os.pardir)) |
231 | 189 |
|
232 | 190 | # Delete previous input file if present |
|
0 commit comments