https://mooseframework.inl.gov
GasLiquidMassTransfer.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 
10 #include "GasLiquidMassTransfer.h"
11 #include "MathUtils.h"
13 
14 registerMooseObject("ScalarTransportApp", GasLiquidMassTransfer);
15 
18 {
20  // Required params
21  params.addRequiredParam<Real>("d", "Pipe diameter [m]");
22  params.addRequiredParam<UserObjectName>(
23  "fp", "The name of the user object for liquid side fluid properties");
24  MooseEnum equation_list("StokesEinstein WilkeChang");
26  "equation", equation_list, "The equation to use for mass transfer calculation");
27  // Required for Stokes-Einstein
28  params.addParam<Real>("radius", "Particle radius [m]");
29  // Required for Wilke-Chang
30  params.addParam<Real>("molar_weight", "molar weight solvent [kg/mol]");
31  // Optional
32  // Wilke-Change gives a phi value of 1.0 for nonassociated solvents and 2.6 for water.
33  params.addParam<Real>("phi", 1.0, "The association parameter for the solute (see Wilke-Chang)");
34  params.addParam<Real>("wc", 7.4e-8, "WilkeChang constant");
35  params.addParam<Real>("db", 0.023, "Dittus-Boelter equation constant");
36  params.addClassDescription("Calculates overall liquid mass transfer coefficient `[m/s]`.");
37  return params;
38 }
39 
41  : GeneralUserObject(parameters),
42  _diameter(getParam<Real>("d")),
43  _fp(getUserObject<SinglePhaseFluidProperties>("fp")),
44  _equation_list(getParam<MooseEnum>("equation").getEnum<Equationlist>()),
45  _radius(isParamValid("radius") ? getParam<Real>("radius") : 0.0),
46  _mw(isParamValid("molar_weight") ? getParam<Real>("molar_weight") : 0.0),
47  _phi(getParam<Real>("phi")),
48  _wc(getParam<Real>("wc")),
49  _db(getParam<Real>("db"))
50 {
51  switch (_equation_list)
52  {
54  {
55  if (!isParamSetByUser("molar_weight"))
56  paramError("molar_weight",
57  "Must set the molecular weight of the gas when using WilkeChang");
58  break;
59  }
61  {
62  if (!isParamSetByUser("radius"))
63  paramError("radius", "Must set particle radius when using StokesEinstein");
64  break;
65  }
66  }
67 }
68 
69 Real
70 GasLiquidMassTransfer::mtc(Real pressure, Real temperature, Real fluid_velocity) const
71 {
72  Real mu = _fp.mu_from_p_T(pressure, temperature);
73  Real rho = _fp.rho_from_p_T(pressure, temperature);
74  Real Diffusivity = 0.0;
75  switch (_equation_list)
76  {
78  Diffusivity = _kB * temperature / (6.0 * libMesh::pi * mu * _radius);
79  break;
80 
82  // Equation 5 of:
83  // C.R. Wilke, P. Chang, Correlation of diffusion coefficients in dilute solutions, AICHE J.,
84  // 1955, 1(2) 264-270 Units of Wilke Chang are g-cm-s
85  Real kg_to_g = 1000.0;
86  Real m_to_cm = 100.0;
87  Real cm_to_m = 1. / m_to_cm;
88  Real mu_cgs = mu * kg_to_g / m_to_cm; // g/cm/s = Poise
89  Real poise_to_centipoise = 100;
90  mu_cgs = mu_cgs * poise_to_centipoise; // cP
91  Real molar_volume = _mw / rho * Utility::pow<3>(m_to_cm); // cm3/mol
92  Real molar_weight = _mw * kg_to_g; // g/mol
93  Diffusivity = _wc * temperature * std::sqrt(_phi * molar_weight) /
94  (mu_cgs * std::pow(molar_volume, 0.6));
95  Diffusivity = Diffusivity * Utility::pow<2>(cm_to_m);
96  break;
97  }
98 
99  Real re = rho * abs(fluid_velocity) * _diameter / mu;
100  Real sc = mu / (rho * Diffusivity);
101  Real mtc = _db * std::pow(re, 0.8) * std::pow(sc, 0.4) * Diffusivity / _diameter;
102  return mtc;
103 }
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
registerMooseObject("ScalarTransportApp", GasLiquidMassTransfer)
const Real _radius
Particle radius [m].
void paramError(const std::string &param, Args... args) const
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const Real _diameter
Diameter of the flow channel [m].
static InputParameters validParams()
Computes the mass transfer coefficient of a gas/liquid interface.
static const std::string temperature
Definition: NS.h:60
const Real _wc
Constant in the Wilke-Chang model.
void addRequiredParam(const std::string &name, const std::string &doc_string)
static constexpr Real _kB
Boltzman constant [J/K].
GasLiquidMassTransfer(const InputParameters &parameters)
const double rho
const SinglePhaseFluidProperties & _fp
fluid properties user object
Common class for single phase fluid properties.
const Real _db
Dittus-Boelter leading coefficient.
const Real _phi
Association parameter for Wilke-Chang model.
Equationlist
Enum used to select the type.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
const Real _mw
Molecular weight of fluid [kg/mol].
enum GasLiquidMassTransfer::Equationlist _equation_list
void addClassDescription(const std::string &doc_string)
virtual Real mtc(Real pressure, Real temperature, Real fluid_velocity) const
const double mu
bool isParamSetByUser(const std::string &name) const
MooseUnits pow(const MooseUnits &, int)
const Real pi