LCOV - code coverage report
Current view: top level - src/bcs - ConvectiveFluxBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 21 22 95.5 %
Date: 2026-05-29 20:35:17 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             : #include "ConvectiveFluxBC.h"
      11             : 
      12             : registerMooseObject("MooseApp", ConvectiveFluxBC);
      13             : 
      14             : InputParameters
      15        3086 : ConvectiveFluxBC::validParams()
      16             : {
      17        3086 :   InputParameters params = IntegratedBC::validParams();
      18        6172 :   params.set<Real>("rate") = 7500;
      19        6172 :   params.set<Real>("initial") = 500;
      20        6172 :   params.set<Real>("final") = 500;
      21        6172 :   params.set<Real>("duration") = 0.0;
      22        3086 :   params.addClassDescription(
      23             :       "Determines boundary values via the initial and final values, flux, and exposure duration");
      24        3086 :   return params;
      25           0 : }
      26             : 
      27          13 : ConvectiveFluxBC::ConvectiveFluxBC(const InputParameters & parameters)
      28             :   : IntegratedBC(parameters),
      29          13 :     _initial(getParam<Real>("initial")),
      30          26 :     _final(getParam<Real>("final")),
      31          26 :     _rate(getParam<Real>("rate")),
      32          39 :     _duration(getParam<Real>("duration"))
      33             : {
      34          13 : }
      35             : 
      36             : Real
      37      160960 : ConvectiveFluxBC::computeQpResidual()
      38             : {
      39             :   Real value;
      40             : 
      41      160960 :   if (_t < _duration)
      42      145040 :     value = _initial + (_final - _initial) * std::sin((0.5 / _duration) * libMesh::pi * _t);
      43             :   else
      44       15920 :     value = _final;
      45             : 
      46      160960 :   return -(_test[_i][_qp] * _rate * (value - _u[_qp]));
      47             : }
      48             : 
      49             : Real
      50       51840 : ConvectiveFluxBC::computeQpJacobian()
      51             : {
      52       51840 :   return -(_test[_i][_qp] * _rate * (-_phi[_j][_qp]));
      53             : }

Generated by: LCOV version 1.14