Line data Source code
1 : /****************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* BlackBear */ 4 : /* */ 5 : /* (c) 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /* */ 8 : /* Prepared by Battelle Energy Alliance, LLC */ 9 : /* Under Contract No. DE-AC07-05ID14517 */ 10 : /* With the U. S. Department of Energy */ 11 : /* */ 12 : /* See COPYRIGHT for full restrictions */ 13 : /****************************************************************/ 14 : 15 : #include "SpecifiedVaporPressureBC.h" 16 : 17 : registerMooseObject("BlackBearApp", SpecifiedVaporPressureBC); 18 : 19 : InputParameters 20 208 : SpecifiedVaporPressureBC::validParams() 21 : { 22 208 : InputParameters params = NodalBC::validParams(); 23 208 : params.set<Real>("duration") = 0.0; 24 416 : params.addRequiredParam<Real>("vapor_pressure", "Vapor pressure"); 25 416 : params.setDocUnit("vapor_pressure", "Pa"); 26 416 : params.addParam<Real>("T_ref", 20.0, "Initial temperature"); 27 416 : params.setDocUnit("T_ref", "degC"); 28 416 : params.addParam<Real>("rh_ref", 0.96, "Initial relative humidity"); 29 416 : params.setDocUnit("rh_ref", "unitless"); 30 416 : params.addCoupledVar("temperature", "Coupled temperature variable"); 31 416 : params.setDocUnit("temperature", "degC"); 32 208 : params.addClassDescription( 33 : "Prescribed vapor pressure boundary condition for moisture transport in concrete."); 34 208 : return params; 35 0 : } 36 : 37 104 : SpecifiedVaporPressureBC::SpecifiedVaporPressureBC(const InputParameters & parameters) 38 : : NodalBC(parameters), 39 104 : _duration(getParam<Real>("duration")), 40 208 : _vapor_pressure(getParam<Real>("vapor_pressure")), 41 208 : _T_ref(getParam<Real>("T_ref")), 42 208 : _rh_ref(getParam<Real>("rh_ref")), 43 : 44 104 : _has_temperature(isCoupled("temperature")), 45 208 : _temp(_has_temperature ? coupledValue("temperature") : _zero) 46 : { 47 104 : } 48 : 49 : Real 50 45738 : SpecifiedVaporPressureBC::computeQpResidual() 51 : { 52 45738 : Real T_ref_K = _T_ref + 273.15; 53 : 54 45738 : Real p_sat0 = 101325.0 * std::exp(4871.3 * (T_ref_K - 100.0) / 373.15 / T_ref_K); 55 45738 : _initial = _rh_ref * p_sat0; 56 45738 : _final = _vapor_pressure; 57 : 58 : // avoid sudden boundary jump conditions 59 : Real value; 60 45738 : if (_t < _duration) 61 0 : value = _initial + (_final - _initial) / _duration * _t; 62 : else 63 : value = _final; 64 : 65 : Real T = T_ref_K; 66 45738 : if (_has_temperature) 67 45738 : T = _temp[_qp] + 273.15; 68 : 69 45738 : Real p_sat = 101325.0 * std::exp(4871.3 * (T - 100.0) / 373.15 / T); 70 45738 : Real rh = value / p_sat; 71 : 72 45738 : return _u[_qp] - rh; 73 : }