How to run with CMFD in python scripts

Hello

I want to use CMFD to accelerate fission source convergence. but i don’t konw how to write it in python scripts. could anybody provide a example about it? and another question is what the difference betwen openmc.run()and openmc.cmfd.CMFDRun.run(), should I write they both in a python script?

Best regards
Lei

Hi @lei. When you call openmc.run(), this is equivalent to going to a command line and running the openmc executable. For CMFD (and depletion), OpenMC is run through the C/C++ API, so it is loading the OpenMC shared library and then making calls to functions like openmc_init and openmc_run. This means that when you’re running CMFD, you don’t need to separately call openmc.run(). To see some examples, you can check our the regression tests we have in the tests/regression_tests/cmfd_* directories in the repository. Just look at the test.py file for each directory and you’ll see some examples of how the CMFD classes are used.