# Candu Reactor compared k\_eff values with Serpent

**URL:** https://openmc.discourse.group/t/candu-reactor-compared-k-eff-values-with-serpent/3761
**Category:** User Support
**Created:** [December 19, 2023, 12:36pm UTC](https://openmc.discourse.group/t/candu-reactor-compared-k-eff-values-with-serpent/3761 "2023-12-19T12:36:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pfproton](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pfproton](https://openmc.discourse.group/u/pfproton)
#### Post date: [December 19, 2023, 12:36pm UTC](https://openmc.discourse.group/t/candu-reactor-compared-k-eff-values-with-serpent/3761/1 "2023-12-19T12:36:48Z")

</div>

Dear experts, I am trying to set the Serpent input file for the candu reactor in Openmc accordingly. But in the output section, Serpent k\_eff values are around 0.9, while Openmc shows 0.42. How can I solve this problem or what are the errors in the files I added below that cause this difference?  
[canduopenmc.py](https://openmc.discourse.group/uploads/short-url/lzpl5V1o5hmsiwnZ4Wg5C9cD0Yo.py) (5.0 KB)  
[canduserpent.py](https://openmc.discourse.group/uploads/short-url/AlptzUG3ZAnFQsXHwDUsP9gHf3Y.py) (2.6 KB)

---

<div class="post-metadata">

### Author: ![emilmammadzada](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@emilmammadzada](https://openmc.discourse.group/u/emilmammadzada)
#### Post date: [December 20, 2023, 8:41pm UTC](https://openmc.discourse.group/t/candu-reactor-compared-k-eff-values-with-serpent/3761/2 "2023-12-20T20:41:30Z")

</div>

This expert @sourena can help you on this matter

---

<div class="post-metadata">

### Author: ![sourena](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/sourena/32/1249_2.png) [@sourena](https://openmc.discourse.group/u/sourena)
#### Post date: [December 20, 2023, 9:03pm UTC](https://openmc.discourse.group/t/candu-reactor-compared-k-eff-values-with-serpent/3761/3 "2023-12-20T21:03:34Z")

</div>

Your OpenMC model doesn’t have any moderator, it ends at the edge of the calandria tube. You need to add a `rectangular_prism` region (similar to surface 5 in the Serpent model) with `boundary_type='reflective'` outside of the calandria tube and fill it with moderator (`heavy_water`). Don’t forget to take off the reflective BC from the `calendria_outer` surface too.

---

<div class="post-metadata">

### Author: ![pfproton](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pfproton](https://openmc.discourse.group/u/pfproton)
#### Post date: [December 20, 2023, 11:25pm UTC](https://openmc.discourse.group/t/candu-reactor-compared-k-eff-values-with-serpent/3761/4 "2023-12-20T23:25:11Z")

</div>

Dear Expert @sourena ,I added the rectangular prism you mentioned and set the serpent size but I get the following error message

```auto
 Maximum neutron transport energy: 20000000 eV for H1
 Initializing source particles...

 ====================> K EIGENVALUE SIMULATION <====================

  Bat./Gen. k Average k
  ========= ======== ====================
 WARNING: After particle 126 crossed surface 92 it could not be located in any
 WARNING: After particle 251 crossed surface 92 it could not be located in any
           WARNING: cell and it did not leak. WARNING: After particle 1 crossed surface 92 it could not be located in any
          After particle 376 crossed surface 92 it could not be located in any
          cell and it did not leak.
cell and it did not leak.    
  cell and it did not leak.

```

```auto
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[2], line 129
    127 settings.source = openmc.Source(space=openmc.stats.Point())
    128 settings.export_to_xml()
--> 129 openmc.run()

File ~/.local/lib/python3.10/site-packages/openmc/executor.py:314, in run(particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based, path_input)
    261 """Run an OpenMC simulation.
    262 
    263 Parameters
   (...)
    305 
    306 """
    308 args = _process_CLI_arguments(
    309 volume=False, geometry_debug=geometry_debug, particles=particles,
    310 restart_file=restart_file, threads=threads, tracks=tracks,
    311 event_based=event_based, openmc_exec=openmc_exec, mpi_args=mpi_args,
    312 path_input=path_input)
--> 314 _run(args, output, cwd)

File ~/.local/lib/python3.10/site-packages/openmc/executor.py:125, in _run(args, output, cwd)
    122 error_msg = 'OpenMC aborted unexpectedly.'
    123 error_msg = ' '.join(error_msg.split())
--> 125 raise RuntimeError(error_msg)

RuntimeError: Maximum number of lost particles has been reached. ERROR: Maximum number of lost particles has been reached. HDF5-DIAG: Error detected in HDF5 (1.10.7)

```

[candu\_openmc.py.py](https://openmc.discourse.group/uploads/short-url/hk9j6U62Ew2JKMU8FT85qk0hPPi.py) (4.9 KB)

---

<div class="post-metadata">

### Author: ![AlexandreTrottier](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/alexandretrottier/32/1357_2.png) [@AlexandreTrottier](https://openmc.discourse.group/u/AlexandreTrottier)
#### Post date: [December 22, 2023, 6:38pm UTC](https://openmc.discourse.group/t/candu-reactor-compared-k-eff-values-with-serpent/3761/5 "2023-12-22T18:38:21Z")

</div>

Not sure of the origin of this issue, but the lattice pitch of a CANDU lattice cell is 28.575cm, so your moderator bounding box should have sides of that length.

---

<div class="post-metadata">

### Author: ![pfproton](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pfproton](https://openmc.discourse.group/u/pfproton)
#### Post date: [December 22, 2023, 9:17pm UTC](https://openmc.discourse.group/t/candu-reactor-compared-k-eff-values-with-serpent/3761/6 "2023-12-22T21:17:53Z")

</div>

Thank you very much for your understandable answers, Dear Experts. Yes, I solved the problem with the dimensions of the rectangular prism and it started to get k\_eff values close to reality.
