Skip to content

deOliveira-R/pyChannelJFNK

Repository files navigation

pyChannelJFNK

A coupled neutronics, thermal-hydraulics, and pin heat transfer solver for a single fuel channel in a sodium-cooled fast reactor (SFR), using the Jacobian-Free Newton-Krylov (JFNK) method.

Overview

pyChannelJFNK solves the steady-state coupled multiphysics problem for a representative fuel channel by simultaneously resolving:

  • Multi-group neutron diffusion -- axial diffusion with temperature-dependent cross-sections and eigenvalue (k-eff) calculation
  • Thermal-hydraulics -- mass and energy conservation for liquid sodium coolant with friction, acceleration, and gravity pressure drops
  • Pin heat transfer -- 1D radial heat conduction through the fuel pellet, gap, and cladding with convection to the coolant

The three physics are tightly coupled through a JFNK solver that uses GMRES as the inner Krylov iteration, avoiding the need to explicitly form or store the Jacobian matrix.

Project Structure

pyChannelJFNK/
├── channel_solver.py          # Main entry point
├── JFNK.py                   # JFNK solver (Newton + GMRES)
├── initialize.py              # Input parsing and domain discretization
├── res_coupled.py             # Coupled residual assembly
├── res_nk_rel.py              # Neutron diffusion residuals
├── res_th_rel.py              # Thermal-hydraulics residuals
├── res_pin_rel.py             # Pin heat transfer residuals
├── XS_parametrization.py      # Cross-section library interface (HDF5)
├── thermo_Na.py               # Sodium thermophysical properties
├── matpro.py                  # Fuel and cladding material properties
├── correlations.py            # Heat transfer and friction correlations
├── input.yml                  # Case input parameters
├── dump.yml                   # Output dump configuration
├── XS_data.hdf5               # Multi-group cross-section library
└── LICENSE                    # GPLv3

Installation

Python 3.8+ is required. Install the dependencies with:

pip install -r requirements.txt

Usage

Configure the problem in input.yml, then run:

python channel_solver.py

Input Parameters (input.yml)

Section Parameter Description Default
boundary_conditions T_in Inlet coolant temperature [K] 673
v_in Inlet velocity [m/s] 7.5
p_out Outlet pressure [Pa] 1.5
qp_ave Average linear power [W/m] 3.0e4
geometry H Channel height [m] 1.6
Rfo Fuel outer radius [m] 3.57e-3
Rci Cladding inner radius [m] 3.685e-3
clad_thickness Cladding thickness [m] 5.65e-4
pin_pitch Pin pitch (triangular lattice) [m] 9.8e-3
discretization axial_nodes Number of axial nodes 25
radial_nodes_pin Radial nodes in fuel pellet 5
numerics tol_newton Newton iteration tolerance 1.0e-8
tol_krylov GMRES (Krylov) tolerance 1.0e-7

Output

The solver prints the converged solution split into three vectors:

  • sol_nk -- Neutron group fluxes and eigenvalue
  • sol_th -- Coolant temperatures and velocities along the channel
  • sol_pin -- Radial temperature distribution in the fuel pin at each axial level

Method

The JFNK approach works as follows:

  1. Outer loop (Newton): Linearizes the coupled nonlinear residual system around the current iterate
  2. Inner loop (GMRES): Solves the linear system using Krylov subspace iterations, where Jacobian-vector products are approximated via finite differences:

$$Jv \approx \frac{F(x + \epsilon v) - F(x)}{\epsilon}$$

This avoids forming the full Jacobian while retaining Newton-level convergence.

Material and Correlation Models

  • Sodium properties -- density, specific heat, thermal conductivity, dynamic viscosity, and enthalpy from Sobolev correlations (SCK-CEN)
  • Fuel conductivity -- ORNL MOX/UO2 model accounting for burnup and porosity
  • Cladding conductivity -- AISI 316 stainless steel
  • Friction factor -- Engel correlation for wire-wrapped bundles
  • Gap conductance -- Pellet-cladding gap heat transfer model
  • Cross-sections -- Temperature-parametrized multi-group data from HDF5 library

License

This project is licensed under the GNU General Public License v3.0.

About

Python implementation of a neutronics, thermal-hydraulics and pin heat transfer for a single channel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages