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 8488 : 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 6366 : params.addParam<MFEMScalarCoefficientName>( 37 : "d_T_infinity_dT_coefficient", 38 : "0.", 39 : "Name of the coefficient specifying the derivative of the far-field temperature with " 40 : "respect to temperature"); 41 2122 : return params; 42 0 : } 43 : 44 12 : MFEMNLConvectiveHeatFluxBC::MFEMNLConvectiveHeatFluxBC(const InputParameters & parameters) 45 : : MFEMIntegratedBC(parameters), 46 12 : _heat_transfer_coef(getScalarCoefficient("heat_transfer_coefficient")), 47 24 : _d_heat_transfer_dT_coef(getScalarCoefficient("d_heat_transfer_dT_coefficient")), 48 24 : _T_inf_coef(getScalarCoefficient("T_infinity")), 49 24 : _d_T_inf_dT_coef(getScalarCoefficient("d_T_infinity_dT_coefficient")), 50 24 : _T_coef(getScalarCoefficientByName((getTrialVariableName()))) 51 : { 52 12 : } 53 : 54 : // Create a new MFEM integrator to apply to LHS of the weak form. Ownership managed by the caller. 55 : mfem::NonlinearFormIntegrator * 56 36 : MFEMNLConvectiveHeatFluxBC::createNLIntegrator() 57 : { 58 : return new Moose::MFEM::NLBoundaryConvectiveHeatFluxIntegrator( 59 36 : _heat_transfer_coef, _d_heat_transfer_dT_coef, _d_T_inf_dT_coef, _T_inf_coef, _T_coef); 60 : } 61 : 62 : #endif