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 "BoundaryFluxGasMixBC.h" 11 : #include "THMNames.h" 12 : #include "THMIndicesGasMix.h" 13 : 14 : registerMooseObject("ThermalHydraulicsApp", BoundaryFluxGasMixBC); 15 : 16 : InputParameters 17 214 : BoundaryFluxGasMixBC::validParams() 18 : { 19 214 : InputParameters params = ADBoundaryFlux3EqnBC::validParams(); 20 : 21 214 : params.addClassDescription( 22 : "Boundary conditions for a FlowChannelGasMix using a boundary flux object."); 23 : 24 428 : params.addRequiredCoupledVar("xirhoA", "Conserved variable: x*rho*A"); 25 : 26 214 : return params; 27 0 : } 28 : 29 176 : BoundaryFluxGasMixBC::BoundaryFluxGasMixBC(const InputParameters & parameters) 30 : : ADBoundaryFlux3EqnBC(parameters), 31 352 : _xirhoA(getADMaterialProperty<Real>(THM::XIRHOA)), 32 176 : _xirhoA_var(coupled("xirhoA")) 33 : { 34 176 : } 35 : 36 : std::vector<ADReal> 37 1840 : BoundaryFluxGasMixBC::fluxInputVector() const 38 : { 39 1840 : std::vector<ADReal> U(THMGasMix1D::N_FLUX_INPUTS, 0); 40 1840 : U[THMGasMix1D::XIRHOA] = _xirhoA[_qp]; 41 1840 : U[THMGasMix1D::RHOA] = _rhoA[_qp]; 42 1840 : U[THMGasMix1D::RHOUA] = _rhouA[_qp]; 43 1840 : U[THMGasMix1D::RHOEA] = _rhoEA[_qp]; 44 1840 : U[THMGasMix1D::AREA] = _A_linear[_qp]; 45 : 46 1840 : return U; 47 : } 48 : 49 : std::map<unsigned int, unsigned int> 50 176 : BoundaryFluxGasMixBC::getIndexMapping() const 51 : { 52 : std::map<unsigned int, unsigned int> jmap; 53 176 : jmap.insert(std::pair<unsigned int, unsigned int>(_xirhoA_var, THMGasMix1D::SPECIES)); 54 176 : jmap.insert(std::pair<unsigned int, unsigned int>(_rhoA_var, THMGasMix1D::MASS)); 55 176 : jmap.insert(std::pair<unsigned int, unsigned int>(_rhouA_var, THMGasMix1D::MOMENTUM)); 56 176 : jmap.insert(std::pair<unsigned int, unsigned int>(_rhoEA_var, THMGasMix1D::ENERGY)); 57 : 58 176 : return jmap; 59 : }