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 "FlowModelGasMixAux.h" 11 : #include "FlowModelGasMixUtils.h" 12 : #include "THMIndicesGasMix.h" 13 : 14 : registerMooseObject("ThermalHydraulicsApp", FlowModelGasMixAux); 15 : 16 : InputParameters 17 164 : FlowModelGasMixAux::validParams() 18 : { 19 164 : InputParameters params = AuxKernel::validParams(); 20 : 21 328 : MooseEnum quantity("p T"); 22 328 : params.addRequiredParam<MooseEnum>("quantity", quantity, "Quantity to compute"); 23 : 24 328 : params.addRequiredCoupledVar("xirhoA", "xi*rho*A variable"); 25 328 : params.addRequiredCoupledVar("rhoA", "rho*A variable"); 26 328 : params.addRequiredCoupledVar("rhouA", "rho*u*A variable"); 27 328 : params.addRequiredCoupledVar("rhoEA", "rho*E*A variable"); 28 328 : params.addRequiredCoupledVar("area", "Cross-sectional area variable"); 29 : 30 328 : params.addRequiredParam<UserObjectName>("fluid_properties", 31 : "The VaporMixtureFluidProperties object"); 32 : 33 164 : params.addClassDescription("Computes various quantities for FlowModelGasMix."); 34 : 35 164 : return params; 36 164 : } 37 : 38 88 : FlowModelGasMixAux::FlowModelGasMixAux(const InputParameters & parameters) 39 : : AuxKernel(parameters), 40 88 : _quantity(getParam<MooseEnum>("quantity").getEnum<Quantity>()), 41 88 : _xirhoA(coupledValue("xirhoA")), 42 88 : _rhoA(coupledValue("rhoA")), 43 88 : _rhouA(coupledValue("rhouA")), 44 88 : _rhoEA(coupledValue("rhoEA")), 45 88 : _area(coupledValue("area")), 46 176 : _fp(getUserObject<VaporMixtureFluidProperties>("fluid_properties")) 47 : { 48 88 : } 49 : 50 : Real 51 5608 : FlowModelGasMixAux::computeValue() 52 : { 53 5608 : std::vector<Real> U(THMGasMix1D::N_FLUX_INPUTS); 54 5608 : U[THMGasMix1D::XIRHOA] = _xirhoA[_qp]; 55 5608 : U[THMGasMix1D::RHOA] = _rhoA[_qp]; 56 5608 : U[THMGasMix1D::RHOUA] = _rhouA[_qp]; 57 5608 : U[THMGasMix1D::RHOEA] = _rhoEA[_qp]; 58 5608 : U[THMGasMix1D::AREA] = _area[_qp]; 59 : 60 5608 : const auto W = FlowModelGasMixUtils::computePrimitiveSolution<false>(U, _fp); 61 : 62 5608 : switch (_quantity) 63 : { 64 : case Quantity::PRESSURE: 65 : { 66 2804 : return W[THMGasMix1D::PRESSURE]; 67 : break; 68 : } 69 : case Quantity::TEMPERATURE: 70 : { 71 2804 : return W[THMGasMix1D::TEMPERATURE]; 72 : break; 73 : } 74 : default: 75 : mooseAssert(false, "Invalid 'quantity' parameter."); 76 : return 0; 77 : } 78 : }