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 MOOSE_MFEM_ENABLED 11 : 12 : #include "MFEMNLConvectiveHeatFluxBC.h" 13 : #include "NLBoundaryConvectiveHeatFluxIntegrator.h" 14 : #include "MFEMProblem.h" 15 : 16 : registerMooseObject("MooseApp", MFEMNLConvectiveHeatFluxBC); 17 : 18 : InputParameters 19 2122 : MFEMNLConvectiveHeatFluxBC::validParams() 20 : { 21 2122 : InputParameters params = MFEMIntegratedBC::validParams(); 22 4244 : params.addClassDescription( 23 : "Convective heat transfer boundary condition with temperature and heat " 24 : "transfer coefficent given by material properties to add to MFEM problems."); 25 8488 : params.addParam<MFEMScalarCoefficientName>( 26 : "T_infinity", "0.", "Name of a coefficient specifying the far-field temperature"); 27 8488 : params.addParam<MFEMScalarCoefficientName>( 28 : "heat_transfer_coefficient", 29 : "1.", 30 : "Name of the coefficient specifying the heat transfer coefficient"); 31 6366 : params.addParam<MFEMScalarCoefficientName>( 32 : "d_heat_transfer_dT_coefficient", 33 : "0.", 34 : "Name of the coefficient specifying the derivative of the heat transfer coefficient with " 35 : "respect to temperature"); 36 2122 : return params; 37 0 : } 38 : 39 12 : MFEMNLConvectiveHeatFluxBC::MFEMNLConvectiveHeatFluxBC(const InputParameters & parameters) 40 : : MFEMIntegratedBC(parameters), 41 12 : _heat_transfer_coef(getScalarCoefficient("heat_transfer_coefficient")), 42 24 : _d_heat_transfer_dT_coef(getScalarCoefficient("d_heat_transfer_dT_coefficient")), 43 24 : _T_inf_coef(getScalarCoefficient("T_infinity")), 44 24 : _T_coef(getScalarCoefficientByName((getTrialVariableName()))) 45 : { 46 12 : } 47 : 48 : // Create a new MFEM integrator to apply to LHS of the weak form. Ownership managed by the caller. 49 : mfem::NonlinearFormIntegrator * 50 36 : MFEMNLConvectiveHeatFluxBC::createNLIntegrator() 51 : { 52 : return new Moose::MFEM::NLBoundaryConvectiveHeatFluxIntegrator( 53 36 : _heat_transfer_coef, _d_heat_transfer_dT_coef, _T_inf_coef, _T_coef); 54 : } 55 : 56 : #endif