LCOV - code coverage report
Current view: top level - src/mfem/bcs - MFEMConvectiveHeatFluxBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 19 20 95.0 %
Date: 2025-07-17 01:28:37 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #ifdef MFEM_ENABLED
      11             : 
      12             : #include "MFEMConvectiveHeatFluxBC.h"
      13             : #include "MFEMProblem.h"
      14             : 
      15             : registerMooseObject("MooseApp", MFEMConvectiveHeatFluxBC);
      16             : 
      17             : InputParameters
      18        8640 : MFEMConvectiveHeatFluxBC::validParams()
      19             : {
      20        8640 :   InputParameters params = MFEMIntegratedBC::validParams();
      21             :   // FIXME: Should these really be specified via properties? T_infinity in particular? Use functions
      22             :   // instead?
      23        8640 :   params.addClassDescription(
      24             :       "Convective heat transfer boundary condition with temperature and heat "
      25             :       "transfer coefficent given by material properties to add to MFEM problems.");
      26        8640 :   params.addParam<MFEMScalarCoefficientName>(
      27             :       "T_infinity", "0.", "Name of a coefficient specifying the far-field temperature");
      28        8640 :   params.addParam<MFEMScalarCoefficientName>(
      29             :       "heat_transfer_coefficient",
      30             :       "1.",
      31             :       "Name of the coefficient specifying the heat transfer coefficient");
      32        8640 :   return params;
      33           0 : }
      34             : 
      35           5 : MFEMConvectiveHeatFluxBC::MFEMConvectiveHeatFluxBC(const InputParameters & parameters)
      36             :   : MFEMIntegratedBC(parameters),
      37           5 :     _heat_transfer_coef(
      38           5 :         getScalarCoefficient(getParam<MFEMScalarCoefficientName>("heat_transfer_coefficient"))),
      39           5 :     _T_inf_coef(getScalarCoefficient(getParam<MFEMScalarCoefficientName>("T_infinity"))),
      40           5 :     _external_heat_flux_coef(
      41          10 :         getMFEMProblem().getCoefficients().declareScalar<mfem::ProductCoefficient>(
      42          10 :             "__ConvectiveHeatFluxBC_" + parameters.get<std::string>("_unique_name"),
      43             :             _heat_transfer_coef,
      44           5 :             _T_inf_coef))
      45             : {
      46           5 : }
      47             : 
      48             : // Create a new MFEM integrator to apply to the RHS of the weak form. Ownership managed by the
      49             : // caller.
      50             : mfem::LinearFormIntegrator *
      51          17 : MFEMConvectiveHeatFluxBC::createLFIntegrator()
      52             : {
      53          17 :   return new mfem::BoundaryLFIntegrator(_external_heat_flux_coef);
      54             : }
      55             : 
      56             : // Create a new MFEM integrator to apply to LHS of the weak form. Ownership managed by the caller.
      57             : mfem::BilinearFormIntegrator *
      58          33 : MFEMConvectiveHeatFluxBC::createBFIntegrator()
      59             : {
      60          33 :   return new mfem::BoundaryMassIntegrator(_heat_transfer_coef);
      61             : }
      62             : 
      63             : #endif

Generated by: LCOV version 1.14