Skip to content

Funz/fz-Cristal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fz-cristal

A Funz plugin for Cristal (French criticality package).

This plugin enables parametric studies with Cristal (V1 and V2) through the fz framework.

Features

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)

Installation

This plugin requires the Funz/fz framework.

pip install git+https://github.com/Funz/fz.git

Set up your Cristal installation path:

export CRISTAL_HOME="/opt/CRISTAL_V2"  # Adjust to your installation
export CRISTAL_VERSION="2.0.3"         # Optional: specify version

Supported Models

1. Cristal-SnKeff

For SN KEFF calculations.

Input syntax:

  • Variable prefix: $
  • Formula prefix: @
  • Delimiters: {}
  • Comment character: *

Outputs:

  • keff: Effective multiplication factor
  • kinf: Infinite multiplication factor
  • slowing_down: Slowing down area
  • M2: 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

2. Cristal-SnNormes

For SN Normes calculations with extended outputs.

Additional outputs beyond SnKeff:

  • dimension: Reactor dimension
  • cx: C(X) concentration parameter
  • hx: H/X ratio

3. Cristal-Pij-MC

For Pij Monte Carlo calculations (combined APOLLO + MORET).

Input syntax:

  • Variable prefix: $
  • Formula prefix: @
  • Delimiters: {}
  • Comment character: *

Outputs:

  • mean_keff: Mean k-effective value
  • sigma_keff: Standard deviation of k-effective
  • dkeff_pertu: Delta k-effective for perturbation
  • sigma_dkeff_pertu: Standard deviation of delta k-effective
  • cU: Uranium concentration array
  • cPU: Plutonium concentration array
  • M2: Migration area array
  • B2: Buckling array
  • KINF: 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

4. CRISTAL-AP2M5

For XML-based model definitions.

Input syntax:

  • Variable prefix: $
  • Formula prefix: @
  • Delimiters: {}
  • Comment character: #

Same outputs as Cristal-Pij-MC.

Usage

With fz Python API

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']])

Directory Structure

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

Configuration

Environment Variables

  • 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

Calculator Configuration

Edit .fz/calculators/localhost_Cristal.json to customize:

{
    "uri": "sh://",
    "models": {
        "Cristal-SnKeff": "bash .fz/calculators/Cristal.sh",
        ...
    }
}

Examples

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 Carlo
  • examples/godiva_model.xml - XML-based model

Remote Execution

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"
)

Running Tests

python tests/test_plugin.py

License

BSD 3-Clause License. See LICENSE file.

Related Links

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •