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

Generated by: LCOV version 1.14