https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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")};
46 }
48
50}
51
52Real
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}
const Real p
const double T
registerMooseObject("FluidPropertiesApp", TwoPhaseNCGPartialPressureFluidProperties)
T & getUserObject(const std::string &name, unsigned int tid=0) const
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
InputParameters getValidParams(const std::string &name) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
Factory & getFactory()
Common class for single phase fluid properties.
virtual Real molarMass() const
Molar mass [kg/mol].
Base class for fluid properties used with two-phase flow.
virtual Real p_sat(Real T) const =0
Computes the saturation pressure at a temperature.
Base class for fluid properties used with 2-phase flow with non-condensable gases (NCGs) present.
const VaporMixtureFluidProperties * _fp_vapor_mixture
Vapor mixture fluid properties user object.
static InputParameters validParams()
const UserObjectName _2phase_name
Two-phase fluid properties user object name.
const UserObjectName & getVaporName() const override
Returns the name of the vapor single-phase fluid properties object.
const TwoPhaseFluidProperties * _fp_2phase
Two-phase fluid properties user object.
const UserObjectName _vapor_mixture_name
Vapor mixture fluid properties user object name.
Two-phase fluid with single NCG using partial pressure mixture model.
const SinglePhaseFluidProperties * _fp_vapor_primary
Primary vapor fluid properties.
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.
const SinglePhaseFluidProperties & _fp_ncg
NCG fluid properties.
std::vector< Real > _molar_masses
Molar masses for each vapor in mixture.
TwoPhaseNCGPartialPressureFluidProperties(const InputParameters &parameters)
FEProblemBase & _fe_problem
Base class for fluid properties of vapor mixtures.
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.