LCOV - code coverage report
Current view: top level - src/bcs - PorousFlowPiecewiseLinearSink.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 14 15 93.3 %
Date: 2025-09-04 07:55:56 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 "PorousFlowPiecewiseLinearSink.h"
      11             : 
      12             : registerMooseObject("PorousFlowApp", PorousFlowPiecewiseLinearSink);
      13             : 
      14             : InputParameters
      15        2460 : PorousFlowPiecewiseLinearSink::validParams()
      16             : {
      17        2460 :   InputParameters params = PorousFlowSinkPTDefiner::validParams();
      18        4920 :   params.addRequiredParam<std::vector<Real>>(
      19             :       "pt_vals",
      20             :       "Tuple of pressure values (for the fluid_phase specified).  Must be monotonically "
      21             :       "increasing.  For heat fluxes that don't involve fluids, these are temperature "
      22             :       "values");
      23        4920 :   params.addRequiredParam<std::vector<Real>>(
      24             :       "multipliers", "Tuple of multiplying values.  The flux values are multiplied by these.");
      25        2460 :   params.addClassDescription("Applies a flux sink to a boundary. The base flux defined by "
      26             :                              "PorousFlowSink is multiplied by a piecewise linear function.");
      27        2460 :   return params;
      28           0 : }
      29             : 
      30        1397 : PorousFlowPiecewiseLinearSink::PorousFlowPiecewiseLinearSink(const InputParameters & parameters)
      31             :   : PorousFlowSinkPTDefiner(parameters),
      32        5588 :     _sink_func(getParam<std::vector<Real>>("pt_vals"), getParam<std::vector<Real>>("multipliers"))
      33             : {
      34        1397 : }
      35             : 
      36             : Real
      37     1335344 : PorousFlowPiecewiseLinearSink::multiplier() const
      38             : {
      39     1335344 :   return PorousFlowSink::multiplier() * _sink_func.sample(ptVar());
      40             : }
      41             : 
      42             : Real
      43      175134 : PorousFlowPiecewiseLinearSink::dmultiplier_dvar(unsigned int pvar) const
      44             : {
      45      175134 :   return PorousFlowSink::dmultiplier_dvar(pvar) * _sink_func.sample(ptVar()) +
      46      175134 :          PorousFlowSink::multiplier() * _sink_func.sampleDerivative(ptVar()) * dptVar(pvar);
      47             : }

Generated by: LCOV version 1.14