www.mooseframework.org
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
MollifiedLangmuirMaterial Class Reference

Holds Langmuir parameters associated with desorption Calculates mass-flow rates and derivatives thereof for use by kernels. More...

#include <MollifiedLangmuirMaterial.h>

Inheritance diagram for MollifiedLangmuirMaterial:
[legend]

Public Member Functions

 MollifiedLangmuirMaterial (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties () override
 

Private Attributes

const VariableValue * _one_over_de_time_const
 reciprocal of desorption time constant More...
 
const VariableValue * _one_over_ad_time_const
 reciprocal of adsorption time constant More...
 
const Real _langmuir_dens
 langmuir density More...
 
const Real _langmuir_p
 langmuir pressure More...
 
const VariableValue * _conc
 concentration of adsorbed fluid in matrix More...
 
const VariableValue * _pressure
 porespace pressure (or partial pressure if multiphase flow scenario) More...
 
const Real _mollifier
 mollifying parameter. More...
 
MaterialProperty< Real > & _mass_rate_from_matrix
 mass flow rate from the matrix = mass flow rate to the porespace More...
 
MaterialProperty< Real > & _dmass_rate_from_matrix_dC
 derivative of mass flow rate wrt concentration More...
 
MaterialProperty< Real > & _dmass_rate_from_matrix_dp
 derivative of mass flow rate wrt pressure More...
 

Detailed Description

Holds Langmuir parameters associated with desorption Calculates mass-flow rates and derivatives thereof for use by kernels.

Definition at line 22 of file MollifiedLangmuirMaterial.h.

Constructor & Destructor Documentation

MollifiedLangmuirMaterial::MollifiedLangmuirMaterial ( const InputParameters &  parameters)

Definition at line 43 of file MollifiedLangmuirMaterial.C.

44  : Material(parameters),
45  // coupledValue returns a reference (an alias) to a VariableValue, and the & turns it into a
46  // pointer
47  _one_over_de_time_const(&coupledValue("one_over_desorption_time_const")),
48  _one_over_ad_time_const(&coupledValue("one_over_adsorption_time_const")),
49 
50  _langmuir_dens(getParam<Real>("langmuir_density")),
51  _langmuir_p(getParam<Real>("langmuir_pressure")),
52 
53  _conc(&coupledValue("conc_var")),
54  _pressure(&coupledValue("pressure_var")),
55 
56  _mollifier(getParam<Real>("mollifier")),
57 
58  _mass_rate_from_matrix(declareProperty<Real>("mass_rate_from_matrix")),
59  _dmass_rate_from_matrix_dC(declareProperty<Real>("dmass_rate_from_matrix_dC")),
60  _dmass_rate_from_matrix_dp(declareProperty<Real>("dmass_rate_from_matrix_dp"))
61 {
62 }
const VariableValue * _conc
concentration of adsorbed fluid in matrix
const VariableValue * _one_over_ad_time_const
reciprocal of adsorption time constant
MaterialProperty< Real > & _dmass_rate_from_matrix_dC
derivative of mass flow rate wrt concentration
const Real _mollifier
mollifying parameter.
MaterialProperty< Real > & _dmass_rate_from_matrix_dp
derivative of mass flow rate wrt pressure
const Real _langmuir_p
langmuir pressure
const Real _langmuir_dens
langmuir density
const VariableValue * _one_over_de_time_const
reciprocal of desorption time constant
MaterialProperty< Real > & _mass_rate_from_matrix
mass flow rate from the matrix = mass flow rate to the porespace
const VariableValue * _pressure
porespace pressure (or partial pressure if multiphase flow scenario)

Member Function Documentation

void MollifiedLangmuirMaterial::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 65 of file MollifiedLangmuirMaterial.C.

66 {
67  Real equilib_conc = _langmuir_dens * ((*_pressure)[_qp]) / (_langmuir_p + (*_pressure)[_qp]);
68  Real dequilib_conc_dp =
69  _langmuir_dens / (_langmuir_p + (*_pressure)[_qp]) -
70  _langmuir_dens * ((*_pressure)[_qp]) / std::pow(_langmuir_p + (*_pressure)[_qp], 2);
71 
72  Real mol = std::tanh(std::abs((*_conc)[_qp] - equilib_conc) / (_mollifier * _langmuir_dens));
73  Real deriv_tanh =
74  1 - std::pow(std::tanh(((*_conc)[_qp] - equilib_conc) / (_mollifier * _langmuir_dens)), 2);
75  if ((*_conc)[_qp] < equilib_conc)
76  deriv_tanh *= -1;
77  Real dmol_dC = deriv_tanh / (_mollifier * _langmuir_dens);
78  Real dmol_dp = -dmol_dC * dequilib_conc_dp;
79 
80  /*
81  Real de_plus_ad = (*_one_over_de_time_const)[_qp] + (*_one_over_ad_time_const)[_qp];
82  Real de_minus_ad = (*_one_over_de_time_const)[_qp] - (*_one_over_ad_time_const)[_qp];
83 
84  Real one_over_tau = 0.5*de_plus_ad + 0.5*de_minus_ad*std::tanh( ((*_conc)[_qp] -
85  equilib_conc)/(_mollifier*_langmuir_dens));
86  Real deriv_tanh = 1 - std::pow(std::tanh(((*_conc)[_qp] -
87  equilib_conc)/(_mollifier*_langmuir_dens)), 2);
88  Real d_one_over_tau_dC = 0.5*de_minus_ad*deriv_tanh/(_mollifier*_langmuir_dens);
89  Real d_one_over_tau_dp = -0.5*de_minus_ad*dequilib_conc_dp*deriv_tanh/(_mollifier*_langmuir_dens);
90  */
91 
92  // form the base rate and derivs without the appropriate time const
93  _mass_rate_from_matrix[_qp] = ((*_conc)[_qp] - equilib_conc) * mol;
94  _dmass_rate_from_matrix_dC[_qp] = mol + ((*_conc)[_qp] - equilib_conc) * dmol_dC;
96  -dequilib_conc_dp * mol + ((*_conc)[_qp] - equilib_conc) * dmol_dp;
97 
98  // multiply by the appropriate time const
99  if ((*_conc)[_qp] > equilib_conc)
100  {
101  _mass_rate_from_matrix[_qp] *= (*_one_over_de_time_const)[_qp];
102  _dmass_rate_from_matrix_dC[_qp] *= (*_one_over_de_time_const)[_qp];
103  _dmass_rate_from_matrix_dp[_qp] *= (*_one_over_de_time_const)[_qp];
104  }
105  else
106  {
107  _mass_rate_from_matrix[_qp] *= (*_one_over_ad_time_const)[_qp];
108  _dmass_rate_from_matrix_dC[_qp] *= (*_one_over_ad_time_const)[_qp];
109  _dmass_rate_from_matrix_dp[_qp] *= (*_one_over_ad_time_const)[_qp];
110  }
111 }
const VariableValue * _conc
concentration of adsorbed fluid in matrix
MaterialProperty< Real > & _dmass_rate_from_matrix_dC
derivative of mass flow rate wrt concentration
const Real _mollifier
mollifying parameter.
MaterialProperty< Real > & _dmass_rate_from_matrix_dp
derivative of mass flow rate wrt pressure
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _langmuir_p
langmuir pressure
const Real _langmuir_dens
langmuir density
MaterialProperty< Real > & _mass_rate_from_matrix
mass flow rate from the matrix = mass flow rate to the porespace
const VariableValue * _pressure
porespace pressure (or partial pressure if multiphase flow scenario)

Member Data Documentation

const VariableValue* MollifiedLangmuirMaterial::_conc
private

concentration of adsorbed fluid in matrix

Definition at line 44 of file MollifiedLangmuirMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& MollifiedLangmuirMaterial::_dmass_rate_from_matrix_dC
private

derivative of mass flow rate wrt concentration

Definition at line 61 of file MollifiedLangmuirMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& MollifiedLangmuirMaterial::_dmass_rate_from_matrix_dp
private

derivative of mass flow rate wrt pressure

Definition at line 64 of file MollifiedLangmuirMaterial.h.

Referenced by computeQpProperties().

const Real MollifiedLangmuirMaterial::_langmuir_dens
private

langmuir density

Definition at line 38 of file MollifiedLangmuirMaterial.h.

Referenced by computeQpProperties().

const Real MollifiedLangmuirMaterial::_langmuir_p
private

langmuir pressure

Definition at line 41 of file MollifiedLangmuirMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& MollifiedLangmuirMaterial::_mass_rate_from_matrix
private

mass flow rate from the matrix = mass flow rate to the porespace

Definition at line 58 of file MollifiedLangmuirMaterial.h.

Referenced by computeQpProperties().

const Real MollifiedLangmuirMaterial::_mollifier
private

mollifying parameter.

the time constants are one_over_time_const * tanh( |_conc - equilib_conc|/(mollifier*_langmuir_dens) ) Here equilib_conc = langmuir_dens*_pressure/(_pressure + _langmuir_p) which is the langmuir expression

Definition at line 55 of file MollifiedLangmuirMaterial.h.

Referenced by computeQpProperties().

const VariableValue* MollifiedLangmuirMaterial::_one_over_ad_time_const
private

reciprocal of adsorption time constant

Definition at line 35 of file MollifiedLangmuirMaterial.h.

const VariableValue* MollifiedLangmuirMaterial::_one_over_de_time_const
private

reciprocal of desorption time constant

Definition at line 32 of file MollifiedLangmuirMaterial.h.

const VariableValue* MollifiedLangmuirMaterial::_pressure
private

porespace pressure (or partial pressure if multiphase flow scenario)

Definition at line 47 of file MollifiedLangmuirMaterial.h.

Referenced by computeQpProperties().


The documentation for this class was generated from the following files: