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 "FlowModelGasMixUtils.h" 11 : #include "VaporMixtureFluidProperties.h" 12 : #include "SinglePhaseFluidProperties.h" 13 : 14 : namespace FlowModelGasMixUtils 15 : { 16 : 17 : ADReal 18 0 : computeSecondaryMoleFraction(const ADReal & xi_secondary, const VaporMixtureFluidProperties & fp) 19 : { 20 : mooseAssert(fp.getNumberOfSecondaryVapors() == 1, 21 : "This function assumes there is a single secondary fluid."); 22 0 : const SinglePhaseFluidProperties & fp_primary = fp.getPrimaryFluidProperties(); 23 0 : const SinglePhaseFluidProperties & fp_secondary = fp.getSecondaryFluidProperties(); 24 : 25 0 : const ADReal xi_primary = 1 - xi_secondary; 26 : 27 0 : const ADReal moles_primary = xi_primary / fp_primary.molarMass(); 28 0 : const ADReal moles_secondary = xi_secondary / fp_secondary.molarMass(); 29 : 30 0 : return moles_secondary / (moles_primary + moles_secondary); 31 : } 32 : 33 : }