https://mooseframework.inl.gov
LangmuirMaterial.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 "LangmuirMaterial.h"
11 #include "libmesh/utility.h"
12 
13 registerMooseObject("ChemicalReactionsApp", LangmuirMaterial);
14 
17 {
19 
20  params.addRequiredCoupledVar(
21  "one_over_desorption_time_const",
22  "Time constant for Langmuir desorption (gas moving from matrix to porespace). Units [s]");
23  params.addRequiredCoupledVar(
24  "one_over_adsorption_time_const",
25  "Time constant for Langmuir adsorption (gas moving from porespace to matrix). Units [s].");
26  params.addRequiredParam<Real>("langmuir_density",
27  "This is (Langmuir volume)*(density of gas at standard temp and "
28  "pressure). Langmuir volume is measured in (gas volume)/(matrix "
29  "volume). (Methane density(101kPa, 20degC) = 0.655kg/m^3. "
30  "Methane density(101kPa, 0degC) = 0.715kg/m^3.) Units [kg/m^3]");
31  params.addRequiredParam<Real>("langmuir_pressure", "Langmuir pressure. Units Pa");
32  params.addRequiredCoupledVar("conc_var", "The concentration of gas variable");
33  params.addRequiredCoupledVar("pressure_var", "The gas porepressure variable");
34  params.addClassDescription("Material type that holds info regarding Langmuir desorption from "
35  "matrix to porespace and viceversa");
36  return params;
37 }
38 
40  : Material(parameters),
41  _one_over_de_time_const(coupledValue("one_over_desorption_time_const")),
42  _one_over_ad_time_const(coupledValue("one_over_adsorption_time_const")),
43 
44  _langmuir_dens(getParam<Real>("langmuir_density")),
45  _langmuir_p(getParam<Real>("langmuir_pressure")),
46 
47  _conc(coupledValue("conc_var")),
48  _pressure(coupledValue("pressure_var")),
49 
50  _mass_rate_from_matrix(declareProperty<Real>("mass_rate_from_matrix")),
51  _dmass_rate_from_matrix_dC(declareProperty<Real>("dmass_rate_from_matrix_dC")),
52  _dmass_rate_from_matrix_dp(declareProperty<Real>("dmass_rate_from_matrix_dp"))
53 {
54 }
55 
56 void
58 {
59  Real equilib_conc = _langmuir_dens * (_pressure[_qp]) / (_langmuir_p + _pressure[_qp]);
60  Real dequilib_conc_dp =
62  _langmuir_dens * (_pressure[_qp]) / Utility::pow<2>(_langmuir_p + _pressure[_qp]);
63 
64  // form the base rate and derivs without the appropriate time const
65  _mass_rate_from_matrix[_qp] = _conc[_qp] - equilib_conc;
67  _dmass_rate_from_matrix_dp[_qp] = -dequilib_conc_dp;
68 
69  // multiply by the appropriate time const
70  if (_conc[_qp] > equilib_conc)
71  {
75  }
76  else
77  {
81  }
82 }
const Real _langmuir_p
langmuir pressure
const VariableValue & _one_over_de_time_const
reciprocal of desorption time constant
LangmuirMaterial(const InputParameters &parameters)
const VariableValue & _pressure
porespace pressure (or partial pressure if multiphase flow scenario)
static InputParameters validParams()
MaterialProperty< Real > & _mass_rate_from_matrix
mass flow rate from the matrix = mass flow rate to the porespace
virtual void computeQpProperties() override
registerMooseObject("ChemicalReactionsApp", LangmuirMaterial)
const Real _langmuir_dens
langmuir density
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
const VariableValue & _conc
concentration of adsorbed fluid in matrix
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MaterialProperty< Real > & _dmass_rate_from_matrix_dp
derivative of mass flow rate wrt pressure
Holds Langmuir parameters associated with desorption Calculates mass-flow rates and derivatives there...
void addClassDescription(const std::string &doc_string)
MaterialProperty< Real > & _dmass_rate_from_matrix_dC
derivative of mass flow rate wrt concentration
const VariableValue & _one_over_ad_time_const
reciprocal of adsorption time constant