A Funz plugin for running SCALE (Standardized Computer Analyses for Licensing Evaluation) calculations.
This plugin provides support for four SCALE calculation types:
- Scale-keno: KENO criticality calculations (=csas5, =csas6)
- Scale-shift: CSAS-Shift criticality calculations with Shift Monte Carlo solver (=csas5-shift, =csas6-shift)
- Scale-tsunami: TSUNAMI sensitivity/uncertainty analysis (=tsunami-3d)
- Scale-xsdrnpm: XSDRNPM transport calculations (=xsdrnpm, =csas1x)
- Variable syntax:
&{variable_name} - Formula syntax:
@{formula} - Comment character:
'(single quote)
mean_keff,sigma_keff: Effective multiplication factor and uncertaintymean_E_lethargy,sigma_E_lethargy: Energy of average lethargy of fissionmean_nubar,sigma_nubar: Average neutrons per fissionmean_free_path,sigma_free_path: System mean free path
Same output variables as Scale-keno:
mean_keff,sigma_keff: Effective multiplication factor and uncertaintymean_E_lethargy,sigma_E_lethargy: Energy of average lethargy of fissionmean_nubar,sigma_nubar: Average neutrons per fissionmean_free_path,sigma_free_path: System mean free path
All Scale-keno outputs plus sensitivity coefficients for various isotopes:
- H-1, O-16, Al-27, Ti-48, Fe-56, C
- U-235, U-238, Pu-239, Pu-240, Rh-103, Mo-95
- For each isotope: total, scatter, capture, fission, nubar sensitivities
lambda: Eigenvalue from XSDRNPM calculation
This plugin requires:
- Funz/fz framework
- SCALE 6.2 or later installed at
/SCALE/scale6.2(or setSCALE_HOMEenvironment variable)
import fz
# Example: KENO calculation with varying sphere radius
results = fz.fzr(
input_path="examples/Scale-keno/godiva.inp",
input_variables={
"r": [8.5, 8.6, 8.7, 8.741, 8.8, 8.9, 9.0]
},
model="Scale-keno",
calculators="localhost_Scale",
results_dir="godiva_results"
)
print(results[['r', 'mean_keff', 'sigma_keff']])
# Example: CSAS-Shift calculation with varying sphere radius
# Uses the Shift Monte Carlo solver for improved performance
results = fz.fzr(
input_path="examples/Scale-shift/godiva.inp",
input_variables={
"r": [8.5, 8.6, 8.7, 8.741, 8.8, 8.9, 9.0]
},
model="Scale-shift",
calculators="localhost_Scale",
results_dir="godiva_shift_results"
)
print(results[['r', 'mean_keff', 'sigma_keff']])your_project/
├── examples/
│ ├── Scale-keno/
│ │ └── godiva.inp # Example KENO input file
│ └── Scale-shift/
│ └── godiva.inp # Example CSAS-Shift input file
├── .fz/
│ ├── models/
│ │ ├── Scale-keno.json
│ │ ├── Scale-shift.json
│ │ ├── Scale-tsunami.json
│ │ └── Scale-xsdrnpm.json
│ └── calculators/
│ ├── Scale-keno.sh
│ ├── Scale-shift.sh
│ ├── Scale-tsunami.sh
│ ├── Scale-xsdrnpm.sh
│ └── localhost_Scale.json
└── results/ # Generated by fz
'Input generated by GeeWiz SCALE 6.0.2
=csas6
godiva
ce_v7_endf
read composition
uranium 1 den=18.742 1 293
92234 1.0202
92235 93.7112
92238 5.2686 end
end composition
read geometry
global unit 1
sphere 10 &{r}
media 1 1 10
boundary 10
end geometry
end data
end
In this example:
&{r}is a variable parameter that will be substituted by fz- The comment character
'is used for the header line - The calculation type is
=csas6(KENO-VI)
For CSAS-Shift calculations, simply use =csas5-shift or =csas6-shift instead of =csas5 or =csas6:
'Input generated by GeeWiz SCALE 6.0.2
=csas6-shift
godiva
ce_v7_endf
read composition
uranium 1 den=18.742 1 293
92234 1.0202
92235 93.7112
92238 5.2686 end
end composition
read geometry
global unit 1
sphere 10 &{r}
media 1 1 10
boundary 10
end geometry
end data
end
The key difference:
=csas6-shiftuses the Shift Monte Carlo solver instead of KENO- Improved performance and scalability, especially for parallel computations
- Compatible with all KENO V.a and KENO-VI geometries
When running a parametric study, fz returns a pandas DataFrame:
r mean_keff sigma_keff mean_E_lethargy sigma_E_lethargy ...
0 8.5 0.9850 0.0018 820684.0 2191.56 ...
1 8.6 0.9910 0.0019 820684.0 2191.56 ...
2 8.7 0.9965 0.0018 820684.0 2191.56 ...
3 8.741 0.9996 0.0019 820684.0 2191.56 ...
4 8.8 1.0040 0.0019 820684.0 2191.56 ...
5 8.9 1.0095 0.0018 820684.0 2191.56 ...
6 9.0 1.0150 0.0019 820684.0 2191.56 ...
The calculator JSON files define how to execute SCALE:
{
"uri": "sh://",
"n": 1,
"models": {
"Scale-keno": "bash .fz/calculators/Scale-keno.sh"
}
}uri: Execution method (sh:// for local shell, ssh:// for remote)n: Number of parallel workersmodels: Mapping of model names to execution commands
The model JSON files define variable syntax and output parsing:
{
"id": "Scale-keno",
"varprefix": "&",
"formulaprefix": "@",
"delim": "{}",
"commentline": "'",
"output": {
"mean_keff": "grep 'best estimate system k-eff' *.out | ...",
"sigma_keff": "grep 'best estimate system k-eff' *.out | ..."
}
}To run SCALE calculations on a remote server:
results = fz.fzr(
input_path="godiva.inp",
input_variables={"r": [8.5, 8.6, 8.7]},
model="Scale-keno",
calculators="ssh://user@server.com/bash /path/to/scale/calculators/Scale-keno.sh",
results_dir="remote_results"
)If SCALE is not installed at /SCALE/scale6.2, set the environment variable:
export SCALE_HOME=/path/to/your/scale/installationThe calculator scripts check for "Congratulations" in the output to verify successful completion. If this fails:
- Check that SCALE is properly installed
- Verify the input file syntax is correct
- Check the
.msgand.outfiles in the results directory
This plugin follows the same license as the Funz framework.
- Funz/fz - Main framework
- Original plugin-scale - Legacy Java-based plugin
- SCALE - SCALE code system