Skip to content

Build OpenMOC

wbinventor edited this page Feb 23, 2012 · 15 revisions

Build OpenMOC

It is relatively straightforward to build and run OpenMOC using the sample input files which are provided with any release of OpenMOC. If you are simply running OpenMOC with one of the sample input files, you can skip ahead to the bottom of this page to the section title Compile OpenMOC. If instead you are planning to run OpenMOC with your own input files, then you should read the Compiler Options section first.

##Compiler Options
There are a few options within OpenMOC which must be configured for your project before you can compile and run the code for your problem. Each of these options can be found in the src/configurations.h file as a C++ macro.

Number of polar angles
To change the number of polar angles to a certain value, adjust the number next to NUM_POLAR_ANGLES inside configurations.h. OpenMOC supports 2 or 3 polar angles. By default, it is set to be:

NUM_POLAR_ANGLES 3

Number of energy groups
To change the number of energy groups to a certain value, adjust the number next to NUM_ENERGY_GROUPS inside configurations.h. OpenMOC supports any number of energy groups, but this number MUST correspond to the number of values of each cross-section in your materials input file. To run the sample input files which come with OpenMOC this option is set to be:

NUM_ENERGY_GROUPS 7

Fixed source convergence threshold
To change the threshold for convergence of fixed source iteration to a certain value, adjust the number next to KEFF_CONVERG_THRESH inside configurations.h. Please note that setting this value too small may make it impossible for OpenMOC to converge for your problem. By default, it is set to be:

KEFF_CONVERG_THRESH 1E-4

Maximum number of fixed source iterations To change the maximum number of fixed source iterations to a certain value, adjust the number next to MAX_ITERATIONS inside configurations.h. Please not that setting this value to be too small may make it impossible for OpenMOC to converge for your problem. By default, it is set to be:

MAX_ITERATIONS 3E3

Memory saving feature
If your problem has a very large number of flat source regions, or your track spacing is very fine, then you may have trouble running OpenMOC on a machine with limited memory. This is due to the fact that each track segment within each flat source region stores a number of pre-computed values to improve the computational running time of the solver. For large problems, however, you may choose to not store these values and instead allow the solver to look up approximate values in a table. To do so, change STORE_PREFACTORS to false inside configurations.h. By default it is set as:

STORE_PREFACTORS true

If you choose to set STORE_PREFACTORS to false to use the table lookup feature, then you may also want to configure the table lookup to meet a certain level of accuracy. You can do so by changing FSR_HASHMAP_PRECISION inside configurations.h to any number of decimal places of accuracy. We recommend that you limit your accuracy to 5 decimal places at maximum. By default it is set as:

FSR_HASHMAP_PRECISION 3

Compile OpenMOC

To build OpenMOC, first navigate to the Release directory:

$ cd ~/OpenMOC/Release  

From here, you should be able to build the code with the following two commands:

$ make clean  
$ make  

If OpenMOC built correctly then you should see the following message at the bottom of your console:

Finished building target: openmoc  

You should be all set at this point to Run OpenMOC! If instead you received errors while compiling, it is probably because you have not correctly installed on or of the dependencies for OpenMOC. In this case, please refer to Install OpenMOC. If you continue to have trouble, please refer to Contact Us to forward your issue to one of our developers.

Clone this wiki locally