IdealGasMixtureFluidProperties
This is a VaporMixtureFluidProperties where each of the components are assumed to be ideal gases, such as IdealGasFluidProperties or NASA7IdealGasFluidProperties. A fluid properties class can be a component if it implements IdealGasMixtureInterface, which tells the mixture whether its specific heats are constant and at which temperature Newton's method should start.
commentnote
Components can have different references for the internal energy. For example, that of IdealGasFluidProperties is plus a user-supplied reference value, whereas that of NASA7IdealGasFluidProperties includes the enthalpy of formation. Only a reference that includes the enthalpy of formation accounts for the heat of reaction when the composition changes by reaction.
First note the following definitions and relations:
where
is the mass of component ,
is the mixture mass,
is the number of moles of component ,
is the mixture number of moles,
is the molar mass of component , and
is the mixture molar mass.
Due to Dalton's law of partial pressures,
where is the partial pressure of component and is the mixture pressure.
Mixture mass-specific properties, such as specific volume and specific internal energy are computed as mass-fraction-weighted sums of the component properties evaluated at the mixture temperature and pressure:
Mixture entropy is an exception to this rule, as the component entropies must be evaluated at their partial pressures, rather than the mixture pressure, in accordance with the Gibbs' theorem, which accounts for the entropy of mixing (Çengel and Boles, 2008):
The temperature is computed from the specific volume and the specific internal energy by solving
for ; the internal energy of an ideal gas does not depend on pressure. When all components have constant specific heats, the internal energy is linear in temperature and follows explicitly. Otherwise, is found with the 1D Newton solver of the fluid properties utilities, starting at the lowest of the start temperatures of the components whose specific heats are not constant. For NASA 7-coefficient components, these are the upper ends of the temperature ranges of their data, above the solution, for the reasons given in NASA7IdealGasFluidProperties. The equation is offset by a constant that makes both of its sides close to , where is the mixture isochoric specific heat, so that the convergence test of the solver bounds the relative error in temperature even where the internal energy is close to zero. The pressure then follows from the ideal gas law, , where is the universal gas constant.
Transport properties such as dynamic viscosity and thermal conductivity are computed as molar-fraction-weighted sums of the component properties evaluated at the mixture temperature and pressure:
NASA7IdealGasFluidProperties does not yet provide viscosity or thermal conductivity, so these properties are not yet available for mixtures with its components, and neither are flow models that need them, such as the gas-mixture flow channels of the thermal hydraulics module.
(modules/fluid_properties/test/tests/fluid_properties/ideal_gas_mixture/ideal_gas_mixture.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FluidProperties]
[fp1]
type = IdealGasFluidProperties
[]
[fp2]
type = StiffenedGasFluidProperties
gamma = 1.4
cv = 1000
p_inf = 0
q = 0
[]
[fpmix]
type = IdealGasMixtureFluidProperties
component_fluid_properties = 'fp1 fp2'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
(modules/thermal_hydraulics/test/tests/auxkernels/flow_model_gas_mix_aux/flow_model_gas_mix_aux.i)
mass_fraction = 0.4
vel = 10
area = 0.2
# computed at p = 1e5 Pa, T = 300 K:
rho = 1.30632939267729
e_value = 1.789042384551724e+05
E = ${fparse e_value + 0.5 * vel * vel}
rhoA = ${fparse rho * area}
xirhoA = ${fparse mass_fraction * rhoA}
rhouA = ${fparse rhoA * vel}
rhoEA = ${fparse rhoA * E}
[GlobalParams]
fluid_properties = mixture_fp
xirhoA = xirhoA
rhoA = rhoA
rhouA = rhouA
rhoEA = rhoEA
area = A
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 5
[]
[FluidProperties]
[fp1]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.029
[]
[fp2]
type = IdealGasFluidProperties
gamma = 1.5
molar_mass = 0.04
[]
[mixture_fp]
type = IdealGasMixtureFluidProperties
component_fluid_properties = 'fp1 fp2'
[]
[]
[AuxVariables]
[A]
initial_condition = ${area}
[]
[xirhoA]
initial_condition = ${xirhoA}
[]
[rhoA]
initial_condition = ${rhoA}
[]
[rhouA]
initial_condition = ${rhouA}
[]
[rhoEA]
initial_condition = ${rhoEA}
[]
[p]
[]
[T]
[]
[]
[AuxKernels]
[p_aux]
type = FlowModelGasMixAux
variable = p
quantity = p
execute_on = 'INITIAL'
[]
[T_aux]
type = FlowModelGasMixAux
variable = T
quantity = T
execute_on = 'INITIAL'
[]
[]
[Postprocessors]
[p]
type = AverageNodalVariableValue
variable = p
execute_on = 'INITIAL'
[]
[T]
type = AverageNodalVariableValue
variable = T
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/thermal_hydraulics/test/tests/materials/binary_diffusion_coef/binary_diffusion_coef.i)
p = 1e5
T = 300
collision_diam = 0.3e-9
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FluidProperties]
[fp1]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.029
[]
[fp2]
type = IdealGasFluidProperties
gamma = 1.5
molar_mass = 0.04
[]
[mixture_fp]
type = IdealGasMixtureFluidProperties
component_fluid_properties = 'fp1 fp2'
[]
[]
[Materials]
[pT_mat]
type = ADGenericConstantMaterial
prop_names = 'p T'
prop_values = '${p} ${T}'
[]
[test_mat]
type = BinaryDiffusionCoefMaterial
primary_collision_diameter = ${collision_diam}
secondary_collision_diameter = ${collision_diam}
vapor_mixture_fp = mixture_fp
[]
[]
[Postprocessors]
[diffcoef]
type = ADElementAverageMaterialProperty
mat_prop = mass_diffusion_coefficient
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/thermal_hydraulics/test/tests/materials/fluid_properties_gas_mix_material/fluid_properties_gas_mix_material.i)
mass_fraction = 0.4
vel = 10
area = 0.2
# computed at p = 1e5 Pa, T = 300 K:
rho = 1.30632939267729
e_value = 1.789042384551724e+05
E = ${fparse e_value + 0.5 * vel * vel}
rhoA = ${fparse rho * area}
xirhoA = ${fparse mass_fraction * rhoA}
rhouA = ${fparse rhoA * vel}
rhoEA = ${fparse rhoA * E}
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FluidProperties]
[fp1]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.029
[]
[fp2]
type = IdealGasFluidProperties
gamma = 1.5
molar_mass = 0.04
[]
[mixture_fp]
type = IdealGasMixtureFluidProperties
component_fluid_properties = 'fp1 fp2'
[]
[]
[Materials]
[fp_mat]
type = FluidPropertiesGasMixMaterial
xirhoA = xirhoA
rhoA = rhoA
rhouA = rhouA
rhoEA = rhoEA
area = A
fluid_properties = mixture_fp
[]
[]
[AuxVariables]
[A]
initial_condition = ${area}
[]
[xirhoA]
initial_condition = ${xirhoA}
[]
[rhoA]
initial_condition = ${rhoA}
[]
[rhouA]
initial_condition = ${rhouA}
[]
[rhoEA]
initial_condition = ${rhoEA}
[]
[mass_fraction]
family = MONOMIAL
order = CONSTANT
[]
[rho]
family = MONOMIAL
order = CONSTANT
[]
[v]
family = MONOMIAL
order = CONSTANT
[]
[vel]
family = MONOMIAL
order = CONSTANT
[]
[e]
family = MONOMIAL
order = CONSTANT
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[T]
family = MONOMIAL
order = CONSTANT
[]
[h]
family = MONOMIAL
order = CONSTANT
[]
[H]
family = MONOMIAL
order = CONSTANT
[]
[c]
family = MONOMIAL
order = CONSTANT
[]
[cp]
family = MONOMIAL
order = CONSTANT
[]
[cv]
family = MONOMIAL
order = CONSTANT
[]
[k]
family = MONOMIAL
order = CONSTANT
[]
[mu]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mass_fraction_aux]
type = ADMaterialRealAux
variable = mass_fraction
property = mass_fraction
execute_on = 'INITIAL'
[]
[rho_aux]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'INITIAL'
[]
[v_aux]
type = ADMaterialRealAux
variable = v
property = v
execute_on = 'INITIAL'
[]
[vel_aux]
type = ADMaterialRealAux
variable = vel
property = vel
execute_on = 'INITIAL'
[]
[e_aux]
type = ADMaterialRealAux
variable = e
property = e
execute_on = 'INITIAL'
[]
[p_aux]
type = ADMaterialRealAux
variable = p
property = p
execute_on = 'INITIAL'
[]
[T_aux]
type = ADMaterialRealAux
variable = T
property = T
execute_on = 'INITIAL'
[]
[h_aux]
type = ADMaterialRealAux
variable = h
property = h
execute_on = 'INITIAL'
[]
[H_aux]
type = ADMaterialRealAux
variable = H
property = H
execute_on = 'INITIAL'
[]
[c_aux]
type = ADMaterialRealAux
variable = c
property = c
execute_on = 'INITIAL'
[]
[cp_aux]
type = ADMaterialRealAux
variable = cp
property = cp
execute_on = 'INITIAL'
[]
[cv_aux]
type = ADMaterialRealAux
variable = cv
property = cv
execute_on = 'INITIAL'
[]
[k_aux]
type = ADMaterialRealAux
variable = k
property = k
execute_on = 'INITIAL'
[]
[mu_aux]
type = ADMaterialRealAux
variable = mu
property = mu
execute_on = 'INITIAL'
[]
[]
[Postprocessors]
[mass_fraction]
type = ElementAverageValue
variable = mass_fraction
execute_on = 'INITIAL'
[]
[rho]
type = ElementAverageValue
variable = rho
execute_on = 'INITIAL'
[]
[v]
type = ElementAverageValue
variable = v
execute_on = 'INITIAL'
[]
[vel]
type = ElementAverageValue
variable = vel
execute_on = 'INITIAL'
[]
[e]
type = ElementAverageValue
variable = e
execute_on = 'INITIAL'
[]
[p]
type = ElementAverageValue
variable = p
execute_on = 'INITIAL'
[]
[T]
type = ElementAverageValue
variable = T
execute_on = 'INITIAL'
[]
[h]
type = ElementAverageValue
variable = h
execute_on = 'INITIAL'
[]
[H]
type = ElementAverageValue
variable = H
execute_on = 'INITIAL'
[]
[c]
type = ElementAverageValue
variable = c
execute_on = 'INITIAL'
[]
[cp]
type = ElementAverageValue
variable = cp
execute_on = 'INITIAL'
[]
[cv]
type = ElementAverageValue
variable = cv
execute_on = 'INITIAL'
[]
[k]
type = ElementAverageValue
variable = k
execute_on = 'INITIAL'
[]
[mu]
type = ElementAverageValue
variable = mu
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/thermal_hydraulics/test/tests/ics/flow_model_gas_mix_ic/flow_model_gas_mix_ic.i)
mass_fraction = 0.4
pressure = 1e5
temperature = 300
velocity = 10
area = 0.2
[GlobalParams]
fluid_properties = mixture_fp
mass_fraction = mass_frac_fn
pressure = pressure_fn
temperature = temperature_fn
velocity = velocity_fn
area = A
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 5
[]
[FluidProperties]
[fp1]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.029
[]
[fp2]
type = IdealGasFluidProperties
gamma = 1.5
molar_mass = 0.04
[]
[mixture_fp]
type = IdealGasMixtureFluidProperties
component_fluid_properties = 'fp1 fp2'
[]
[]
[Functions]
[mass_frac_fn]
type = ConstantFunction
value = ${mass_fraction}
[]
[pressure_fn]
type = ConstantFunction
value = ${pressure}
[]
[temperature_fn]
type = ConstantFunction
value = ${temperature}
[]
[velocity_fn]
type = ConstantFunction
value = ${velocity}
[]
[]
[AuxVariables]
[A]
initial_condition = ${area}
[]
[rho]
[]
[rhoEA]
[]
[]
[ICs]
[rho_ic]
type = FlowModelGasMixIC
variable = rho
quantity = rho
[]
[rhoEA_ic]
type = FlowModelGasMixIC
variable = rhoEA
quantity = rhoEA
[]
[]
[Postprocessors]
[rho]
type = AverageNodalVariableValue
variable = rho
execute_on = 'INITIAL'
[]
[rhoEA]
type = AverageNodalVariableValue
variable = rhoEA
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/thermal_hydraulics/test/tests/components/flow_channel_gasmix/flow_channel_gasmix.i)
initial_p = 1e5
initial_T = 500
[FluidProperties]
[fp1]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.029
[]
[fp2]
type = IdealGasFluidProperties
gamma = 1.5
molar_mass = 0.04
[]
[fp_mix]
type = IdealGasMixtureFluidProperties
component_fluid_properties = 'fp1 fp2'
[]
[]
[Closures]
[closures]
type = FunctorClosures
properties = 'f_D mass_diffusion_coefficient'
functors = '0 0.26e-4'
[]
[]
[Functions]
[initial_mass_fraction_fn]
type = PiecewiseConstant
axis = x
x = '0 5.0'
y = '0.2 0.4'
[]
[]
[Components]
[pipe]
type = FlowChannelGasMix
position = '0 0 0'
orientation = '1 0 0'
length = 10.0
n_elems = 50
A = 0.2
initial_mass_fraction = initial_mass_fraction_fn
initial_p = ${initial_p}
initial_T = ${initial_T}
initial_vel = 0
fp = fp_mix
closures = 'closures'
scaling_factor_rhoEA = 1e-5
[]
[inlet]
type = SolidWallGasMix
input = 'pipe:in'
[]
[outlet]
type = SolidWallGasMix
input = 'pipe:out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 1000
num_steps = 5
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
[]
[Outputs]
[exodus]
type = Exodus
file_base = flow_channel_gasmix
show = 'mass_fraction p T'
[]
[]