LCOV - code coverage report
Current view: top level - src/auxkernels - CellTemperatureAux.C (source / functions) Hit Total Coverage
Test: neams-th-coe/cardinal: faa471 Lines: 12 13 92.3 %
Date: 2026-08-05 13:00:46 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /********************************************************************/
       2             : /*                  SOFTWARE COPYRIGHT NOTIFICATION                 */
       3             : /*                             Cardinal                             */
       4             : /*                                                                  */
       5             : /*                  (c) 2021 UChicago Argonne, LLC                  */
       6             : /*                        ALL RIGHTS RESERVED                       */
       7             : /*                                                                  */
       8             : /*                 Prepared by UChicago Argonne, LLC                */
       9             : /*               Under Contract No. DE-AC02-06CH11357               */
      10             : /*                With the U. S. Department of Energy               */
      11             : /*                                                                  */
      12             : /*             Prepared by Battelle Energy Alliance, LLC            */
      13             : /*               Under Contract No. DE-AC07-05ID14517               */
      14             : /*                With the U. S. Department of Energy               */
      15             : /*                                                                  */
      16             : /*                 See LICENSE for full restrictions                */
      17             : /********************************************************************/
      18             : 
      19             : #ifdef ENABLE_OPENMC_COUPLING
      20             : 
      21             : #include "CellTemperatureAux.h"
      22             : 
      23             : registerMooseObject("CardinalApp", CellTemperatureAux);
      24             : 
      25             : InputParameters
      26         601 : CellTemperatureAux::validParams()
      27             : {
      28         601 :   InputParameters params = OpenMCAuxKernel::validParams();
      29         601 :   params.addClassDescription(
      30             :       "OpenMC cell temperature (K), mapped to each MOOSE element. For cells filled by universes or "
      31             :       "lattices, returns the temperature of the first-located material cell contained within.");
      32         601 :   return params;
      33           0 : }
      34             : 
      35         294 : CellTemperatureAux::CellTemperatureAux(const InputParameters & parameters)
      36         294 :   : OpenMCAuxKernel(parameters)
      37             : {
      38         294 : }
      39             : 
      40             : Real
      41     4431360 : CellTemperatureAux::computeValue()
      42             : {
      43             :   // if the element doesn't map to an OpenMC cell, return a temperature of -1; this is required
      44             :   // because otherwise OpenMC would throw an error for an invalid instance, index pair passed to the
      45             :   // C-API
      46     4431360 :   if (!mappedElement())
      47             :     return OpenMCCellAverageProblem::UNMAPPED;
      48             : 
      49             :   OpenMCCellAverageProblem::cellInfo cell_info =
      50     4087232 :       _openmc_problem->elemToCellInfo(_current_elem->id());
      51             : 
      52     4087232 :   if (!_openmc_problem->hasTemperatureFeedback(cell_info))
      53             :     return OpenMCCellAverageProblem::UNMAPPED;
      54             : 
      55     4082944 :   return _openmc_problem->cellTemperature(cell_info);
      56             : }
      57             : 
      58             : #endif

Generated by: LCOV version 1.14