Line data Source code
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 "CoupledBEKinetic.h" 11 : 12 : registerMooseObject("ChemicalReactionsApp", CoupledBEKinetic); 13 : 14 : InputParameters 15 935 : CoupledBEKinetic::validParams() 16 : { 17 935 : InputParameters params = TimeDerivative::validParams(); 18 1870 : params.addRequiredParam<std::vector<Real>>("weight", 19 : "The weight of kinetic species concentration"); 20 1870 : params.addCoupledVar("v", "List of kinetic species being coupled by concentration"); 21 935 : params.addClassDescription("Derivative of kinetic species concentration wrt time"); 22 935 : return params; 23 0 : } 24 : 25 503 : CoupledBEKinetic::CoupledBEKinetic(const InputParameters & parameters) 26 : : TimeDerivative(parameters), 27 503 : _porosity(getMaterialProperty<Real>("porosity")), 28 1006 : _weight(getParam<std::vector<Real>>("weight")), 29 503 : _vals(coupledValues("v")), 30 1006 : _vals_old(coupledValuesOld("v")) 31 : { 32 503 : } 33 : 34 : Real 35 5209376 : CoupledBEKinetic::computeQpResidual() 36 : { 37 : Real assemble_conc = 0.0; 38 : 39 10452672 : for (MooseIndex(_vals) i = 0; i < _vals.size(); ++i) 40 5243296 : assemble_conc += _weight[i] * ((*_vals[i])[_qp] - (*_vals_old[i])[_qp]) / _dt; 41 : 42 5209376 : return _porosity[_qp] * _test[_i][_qp] * assemble_conc; 43 : }