A Funz plugin for Cristal (French criticality package).
This plugin enables parametric studies with Cristal (V1 and V2) through the fz framework.
Cristal is a French criticality package available at http://oecd-nea.org/tools/abstract/detail/nea-1903/
This plugin supports:
- Cristal V1.2
- Cristal V2.0, V2.0.2, V2.0.3
- Multiple calculation types: SN KEFF, SN Normes, Pij-MC, and AP2M5 (XML-based)
This plugin requires the Funz/fz framework.
pip install git+https://github.com/Funz/fz.gitSet up your Cristal installation path:
export CRISTAL_HOME="/opt/CRISTAL_V2" # Adjust to your installation
export CRISTAL_VERSION="2.0.3" # Optional: specify versionFor SN KEFF calculations.
Input syntax:
- Variable prefix:
$ - Formula prefix:
@ - Delimiters:
{} - Comment character:
*
Outputs:
keff: Effective multiplication factorkinf: Infinite multiplication factorslowing_down: Slowing down areaM2: Migration area (cm²)B2: Buckling
Example:
DEBUT_APOLLO2
*Umetal
nom_mil = 'FISSIL REFLEC0 ' ;
TOPT.'STMIL'.nom_mil = TABLE: ;
TOPT.'STMIL'.nom_mil.'U238 ' = $(U238~2.49865E-03) ;
TOPT.'STMIL'.nom_mil.'U235 ' = $(U235~4.49988E-02) ;
...
FIN_APOLLO2
For SN Normes calculations with extended outputs.
Additional outputs beyond SnKeff:
dimension: Reactor dimensioncx: C(X) concentration parameterhx: H/X ratio
For Pij Monte Carlo calculations (combined APOLLO + MORET).
Input syntax:
- Variable prefix:
$ - Formula prefix:
@ - Delimiters:
{} - Comment character:
*
Outputs:
mean_keff: Mean k-effective valuesigma_keff: Standard deviation of k-effectivedkeff_pertu: Delta k-effective for perturbationsigma_dkeff_pertu: Standard deviation of delta k-effectivecU: Uranium concentration arraycPU: Plutonium concentration arrayM2: Migration area arrayB2: Buckling arrayKINF: K-infinite array
Example:
DEBUT_APOLLO2
...
FIN_APOLLO2
DEBUT_MORET
TITRE Installation
ARRE
ETAP
ACTI 100
PASS 3
KEFF
SIGM 0.001
FARR
GEOM
MODU 0
TYPE 1 SPHE $(r~8.741)
...
FIN_MORET
For XML-based model definitions.
Input syntax:
- Variable prefix:
$ - Formula prefix:
@ - Delimiters:
{} - Comment character:
#
Same outputs as Cristal-Pij-MC.
import fz
# Example: Run calculation with varying parameters
results = fz.fzr(
input_path="examples/godiva1d.snk",
input_variables={
"U235": [4.0e-2, 4.5e-2, 5.0e-2],
"U238": [2.0e-3, 2.5e-3, 3.0e-3]
},
model="Cristal-SnKeff",
calculators="localhost_Cristal",
results_dir="my_results"
)
print(results[['U235', 'U238', 'keff', 'kinf']])fz-cristal/
├── examples/
│ ├── godiva1d.snk # SN KEFF example
│ ├── godiva1d.snn # SN Normes example
│ ├── godiva.mor # Monte Carlo example
│ └── godiva_model.xml # XML-based model example
├── .fz/
│ ├── models/
│ │ ├── Cristal-SnKeff.json
│ │ ├── Cristal-SnNormes.json
│ │ ├── Cristal-Pij-MC.json
│ │ └── CRISTAL-AP2M5.json
│ └── calculators/
│ ├── Cristal.sh
│ └── localhost_Cristal.json
├── tests/
│ └── test_plugin.py
└── results/ # Generated by fz
CRISTAL_HOME: Path to Cristal installation (required)CRISTAL_VERSION: Cristal version to use (1.2, 2.0, 2.0.2, 2.0.3)- If not set, auto-detects based on available installation
Edit .fz/calculators/localhost_Cristal.json to customize:
{
"uri": "sh://",
"models": {
"Cristal-SnKeff": "bash .fz/calculators/Cristal.sh",
...
}
}See the examples/ directory for example input files organized by model type:
examples/godiva1d.snk- 1D Godiva sphere (SN KEFF)examples/godiva1d.snn- 1D Godiva sphere (SN Normes)examples/godiva.mor- Godiva Monte Carloexamples/godiva_model.xml- XML-based model
To run calculations on a remote server:
results = fz.fzr(
input_path="examples/godiva1d.snk",
input_variables={"U235": [4.0e-2, 4.5e-2]},
model="Cristal-SnKeff",
calculators="ssh://user@server.com/bash /path/to/calculators/Cristal.sh",
results_dir="remote_results"
)python tests/test_plugin.pyBSD 3-Clause License. See LICENSE file.
- Funz/fz - Main framework
- Cristal at NEA - Cristal package information