https://mooseframework.inl.gov
TwoPhaseNCGPartialPressureFluidProperties.C
Go to the documentation of this file.
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 
13 
15 
18 {
20 
21  params.addClassDescription(
22  "Two-phase fluid with single NCG using partial pressure mixture model");
23 
24  params.addRequiredParam<UserObjectName>("fp_ncg", "NCG fluid properties object");
25 
26  return params;
27 }
28 
30  const InputParameters & parameters)
31  : TwoPhaseNCGFluidProperties(parameters),
32 
33  _fp_ncg(getUserObject<SinglePhaseFluidProperties>("fp_ncg"))
34 {
37 
38  // create vapor mixture fluid properties
39  if (_tid == 0)
40  {
41  const std::string class_name = "IdealGasMixtureFluidProperties";
42  InputParameters params = _app.getFactory().getValidParams(class_name);
43  params.set<std::vector<UserObjectName>>("component_fluid_properties") = {
44  getVaporName(), getParam<UserObjectName>("fp_ncg")};
45  _fe_problem.addUserObject(class_name, _vapor_mixture_name, params);
46  }
48 
50 }
51 
52 Real
54 {
55  const auto molar_fraction_ncg = (p - _fp_2phase->p_sat(T)) / p;
56  const std::vector<Real> molar_fractions = {1.0 - molar_fraction_ncg, molar_fraction_ncg};
57  const auto mass_fractions =
59  return mass_fractions[1];
60 }
std::vector< Real > _molar_masses
Molar masses for each vapor in mixture.
Base class for fluid properties of vapor mixtures.
const UserObjectName _2phase_name
Two-phase fluid properties user object name.
T & getUserObject(const std::string &name, unsigned int tid=0) const
registerMooseObject("FluidPropertiesApp", TwoPhaseNCGPartialPressureFluidProperties)
const SinglePhaseFluidProperties & _fp_ncg
NCG fluid properties.
Two-phase fluid with single NCG using partial pressure mixture model.
TwoPhaseNCGPartialPressureFluidProperties(const InputParameters &parameters)
Base class for fluid properties used with 2-phase flow with non-condensable gases (NCGs) present...
T & set(const std::string &name, bool quiet_mode=false)
Real x_sat_ncg_from_p_T(Real p, Real T) const
Computes the NCG mass fraction with the CG saturated at the given temperature.
virtual Real molarMass() const
Molar mass [kg/mol].
InputParameters getValidParams(const std::string &name) const
const UserObjectName & getVaporName() const override
Returns the name of the vapor single-phase fluid properties object.
void addRequiredParam(const std::string &name, const std::string &doc_string)
Factory & getFactory()
static InputParameters validParams()
Base class for fluid properties used with two-phase flow.
Common class for single phase fluid properties.
virtual Real p_sat(Real T) const =0
Computes the saturation pressure at a temperature.
const SinglePhaseFluidProperties * _fp_vapor_primary
Primary vapor fluid properties.
std::vector< Real > massFractionsFromMolarFractions(const std::vector< Real > &molar_fractions, const std::vector< Real > &molar_masses) const
Computes the mass fractions for given molar fractions and molar masses.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
const VaporMixtureFluidProperties * _fp_vapor_mixture
Vapor mixture fluid properties user object.
const TwoPhaseFluidProperties * _fp_2phase
Two-phase fluid properties user object.
void addClassDescription(const std::string &doc_string)
const UserObjectName _vapor_mixture_name
Vapor mixture fluid properties user object name.