23 params.
addRequiredParam<MaterialPropertyName>(
"pressure",
"Mixture pressure material property");
25 "Mixture temperature material property");
26 params.
addRequiredParam<MaterialPropertyName>(
"velocity",
"Mixture velocity material property");
29 "The VaporMixtureFluidProperties object");
31 params.
addClassDescription(
"Adds mass diffusion to the energy equation for FlowChannelGasMix.");
40 _p_elem(getADMaterialProperty<
Real>(
"pressure")),
41 _p_neig(getNeighborADMaterialProperty<
Real>(
"pressure")),
42 _T_elem(getADMaterialProperty<
Real>(
"temperature")),
43 _T_neig(getNeighborADMaterialProperty<
Real>(
"temperature")),
44 _vel_elem(getADMaterialProperty<
Real>(
"velocity")),
45 _vel_neig(getNeighborADMaterialProperty<
Real>(
"velocity")),
48 _fp_primary(_fp.getPrimaryFluidProperties()),
49 _fp_secondary(_fp.getSecondaryFluidProperties())
51 if (!dynamic_cast<const IdealGasFluidProperties *>(&
_fp_primary) ||
52 !dynamic_cast<const IdealGasFluidProperties *>(&
_fp_secondary))
53 mooseError(
"This class requires gases to use IdealGasFluidProperties.");
66 const ADReal mass_flux_secondary = -rho * D * dxi_dx;
67 const ADReal mass_flux_primary = -mass_flux_secondary;
69 const ADReal xi_secondary =
71 const ADReal xi_primary = 1 - xi_secondary;
73 const ADReal phi_secondary =
74 FlowModelGasMixUtils::computeSecondaryMoleFraction<true>(xi_secondary,
_fp);
75 const ADReal phi_primary = 1 - phi_secondary;
78 const ADReal p_primary = phi_primary * p_mix;
79 const ADReal p_secondary = phi_secondary * p_mix;
86 : mass_flux_primary / (rho * xi_primary);
89 : mass_flux_secondary / (rho * xi_secondary);
90 const ADReal vel_primary = vel_mix + diffvel_primary;
91 const ADReal vel_secondary = vel_mix + diffvel_secondary;
97 return mass_flux_primary * H_primary + mass_flux_secondary * H_secondary;
107 const ADReal e =
fp.e_from_p_T(p, T);
108 const ADReal rho =
fp.rho_from_p_T(p, T);
114 return h + 0.5 * vel * vel;
const SinglePhaseFluidProperties & _fp_secondary
Base class for fluid properties of vapor mixtures.
static InputParameters validParams()
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
const SinglePhaseFluidProperties & _fp_primary
registerMooseObject("ThermalHydraulicsApp", MassDiffusionEnergyGasMixDGKernel)
ADReal computeGradient(const ADReal &y_elem, const ADReal &y_neig, Real dx) const
Computes the gradient of a quantity in the channel direction.
const ADMaterialProperty< Real > & _mass_fraction_elem
Mass fraction for current element.
ADReal computeComponentTotalEnthalpy(const ADReal &p, const ADReal &T, const ADReal &vel, const SinglePhaseFluidProperties &fp) const
Components the total enthalpy for a mixture component.
static const Real _R
Universal gas constant (J/mol/K)
const ADMaterialProperty< Real > & _vel_neig
Mixture velocity for neighbor element.
const ADMaterialProperty< Real > & _vel_elem
Mixture velocity for current element.
DualNumber< Real, DNDerivativeType, true > ADReal
const ADMaterialProperty< Real > & _T_neig
Temperature for neighbor element.
const ADMaterialProperty< Real > & _rho_elem
Density for current element.
const ADMaterialProperty< Real > & _mass_fraction_neig
Mass fraction for neighbor element.
Common class for single phase fluid properties.
const VaporMixtureFluidProperties & _fp
Fluid properties.
const ADMaterialProperty< Real > & _p_neig
Mixture pressure for neighbor element.
Adds mass diffusion for FlowChannelGasMix.
const ADMaterialProperty< Real > & _D_neig
Diffusion coefficient for neighbor element.
const ADMaterialProperty< Real > & _p_elem
Mixture pressure for current element.
const ADMaterialProperty< Real > & _T_elem
Temperature for current element.
Adds mass diffusion to the energy equation for FlowChannelGasMix.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MassDiffusionEnergyGasMixDGKernel(const InputParameters ¶meters)
ADReal linearlyInterpolate(const ADReal &y_elem, const ADReal &y_neig, Real dx, Real dx_side) const
Linearly interpolates a quantity to the side position.
virtual ADReal computeQpFlux() const override
Computes the flux that will be applied to both sides for a q-point.
void mooseError(Args &&... args) const
void computePositionChanges(Real &dx, Real &dx_side) const
Computes the changes in position between elements and side.
static InputParameters validParams()
const ADMaterialProperty< Real > & _rho_neig
Density for neighbor element.
const ADMaterialProperty< Real > & _D_elem
Diffusion coefficient for current element.