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 "ADBoundaryFlux3EqnBC.h" 11 : #include "MooseVariable.h" 12 : #include "THMIndicesVACE.h" 13 : 14 : registerMooseObject("ThermalHydraulicsApp", ADBoundaryFlux3EqnBC); 15 : 16 : InputParameters 17 11116 : ADBoundaryFlux3EqnBC::validParams() 18 : { 19 11116 : InputParameters params = BoundaryFlux1PhaseBaseBC::validParams(); 20 : 21 11116 : params.addClassDescription( 22 : "Boundary conditions for the 1-D, 1-phase, variable-area Euler equations"); 23 : 24 22232 : params.addRequiredCoupledVar("passives_times_area", "Passive transport solution variables"); 25 : 26 11116 : return params; 27 0 : } 28 : 29 8611 : ADBoundaryFlux3EqnBC::ADBoundaryFlux3EqnBC(const InputParameters & parameters) 30 : : BoundaryFlux1PhaseBaseBC(parameters), 31 : 32 8611 : _passives_times_area(getADMaterialProperty<std::vector<Real>>("passives_times_area")), 33 17222 : _n_passives(coupledComponents("passives_times_area")) 34 : { 35 8611 : } 36 : 37 : std::vector<ADReal> 38 342478 : ADBoundaryFlux3EqnBC::fluxInputVector() const 39 : { 40 342478 : std::vector<ADReal> U(THMVACE1D::N_FLUX_INPUTS + _n_passives, 0); 41 342478 : U[THMVACE1D::RHOA] = _rhoA[_qp]; 42 342478 : U[THMVACE1D::RHOUA] = _rhouA[_qp]; 43 342478 : U[THMVACE1D::RHOEA] = _rhoEA[_qp]; 44 342478 : U[THMVACE1D::AREA] = _A_linear[_qp]; 45 344418 : for (const auto i : make_range(_n_passives)) 46 1940 : U[THMVACE1D::N_FLUX_INPUTS + i] = _passives_times_area[_qp][i]; 47 : 48 342478 : return U; 49 : } 50 : 51 : std::map<unsigned int, unsigned int> 52 8335 : ADBoundaryFlux3EqnBC::getIndexMapping() const 53 : { 54 : std::map<unsigned int, unsigned int> jmap; 55 8335 : jmap.insert(std::pair<unsigned int, unsigned int>(_rhoA_var, THMVACE1D::MASS)); 56 8335 : jmap.insert(std::pair<unsigned int, unsigned int>(_rhouA_var, THMVACE1D::MOMENTUM)); 57 8335 : jmap.insert(std::pair<unsigned int, unsigned int>(_rhoEA_var, THMVACE1D::ENERGY)); 58 8535 : for (const auto i : make_range(_n_passives)) 59 400 : jmap.insert(std::pair<unsigned int, unsigned int>(coupled("passives_times_area", i), 60 200 : THMVACE1D::N_FLUX_OUTPUTS + i)); 61 : 62 8335 : return jmap; 63 : }