LCOV - code coverage report
Current view: top level - src/components - FlowBoundary1Phase.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 36 37 97.3 %
Date: 2026-05-29 20:41:18 Functions: 5 5 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 "FlowBoundary1Phase.h"
      11             : #include "FlowChannel1Phase.h"
      12             : #include "FlowModelSinglePhase.h"
      13             : #include "THMNames.h"
      14             : 
      15             : InputParameters
      16        5344 : FlowBoundary1Phase::validParams()
      17             : {
      18        5344 :   InputParameters params = FlowBoundary1PhaseBase::validParams();
      19        5344 :   return params;
      20             : }
      21             : 
      22        2670 : FlowBoundary1Phase::FlowBoundary1Phase(const InputParameters & params)
      23        2670 :   : FlowBoundary1PhaseBase(params)
      24             : {
      25        2670 : }
      26             : 
      27             : void
      28        2645 : FlowBoundary1Phase::init()
      29             : {
      30        2645 :   FlowBoundary1PhaseBase::init();
      31             : 
      32        2645 :   if (hasComponentByName<FlowChannel1Phase>(_connected_component_name))
      33             :   {
      34        2639 :     auto flow_model_1phase = dynamic_cast<const FlowModelSinglePhase *>(_flow_model.get());
      35             :     mooseAssert(flow_model_1phase, "Incompatible flow model");
      36        2639 :     _passives_times_area = flow_model_1phase->passiveTransportSolutionVariableNames();
      37             :   }
      38        2645 : }
      39             : 
      40             : void
      41        2613 : FlowBoundary1Phase::check() const
      42             : {
      43        2613 :   FlowBoundary1PhaseBase::check();
      44             : 
      45        2613 :   checkComponentOfTypeExistsByName<FlowChannel1Phase>(_connected_component_name);
      46             : 
      47        2613 :   if (_passives_times_area.size() > 0 && !supportsPassiveTransport())
      48           0 :     logError("Passive transport has not been implemented for this Component type.");
      49        2613 : }
      50             : 
      51             : void
      52        2505 : FlowBoundary1Phase::addWeakBCs()
      53             : {
      54        2505 :   const std::string class_name = "ADBoundaryFlux3EqnBC";
      55        2505 :   InputParameters params = _factory.getValidParams(class_name);
      56        2505 :   params.set<std::vector<BoundaryName>>("boundary") = getBoundaryNames();
      57        2505 :   params.set<Real>("normal") = _normal;
      58        5010 :   params.set<UserObjectName>("boundary_flux") = _boundary_uo_name;
      59        7515 :   params.set<std::vector<VariableName>>("A_linear") = {THM::AREA_LINEAR};
      60        7515 :   params.set<std::vector<VariableName>>("rhoA") = {THM::RHOA};
      61        7515 :   params.set<std::vector<VariableName>>("rhouA") = {THM::RHOUA};
      62        7515 :   params.set<std::vector<VariableName>>("rhoEA") = {THM::RHOEA};
      63        2505 :   params.set<std::vector<VariableName>>("passives_times_area") = _passives_times_area;
      64        2505 :   params.set<bool>("implicit") = getTHMProblem().getImplicitTimeIntegrationFlag();
      65             : 
      66        2505 :   auto flow_model_1phase = dynamic_cast<const FlowModelSinglePhase *>(_flow_model.get());
      67       10056 :   for (const auto & var : flow_model_1phase->solutionVariableNames())
      68             :   {
      69       15102 :     params.set<NonlinearVariableName>("variable") = var;
      70       15102 :     getTHMProblem().addBoundaryCondition(
      71       15102 :         class_name, genName(name(), var, "bnd_flux_3eqn_bc"), params);
      72        2505 :   }
      73        5010 : }

Generated by: LCOV version 1.14