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 "LayeredSideDiffusiveFluxAverage.h" 11 : 12 : registerMooseObject("MooseApp", LayeredSideDiffusiveFluxAverage); 13 : registerMooseObjectRenamed("MooseApp", 14 : LayeredSideFluxAverage, 15 : "06/30/2021 24:00", 16 : LayeredSideDiffusiveFluxAverage); 17 : 18 : InputParameters 19 57239 : LayeredSideDiffusiveFluxAverage::validParams() 20 : { 21 57239 : InputParameters params = LayeredSideAverage::validParams(); 22 57239 : params.addClassDescription("Computes the diffusive flux of a variable on layers alongside " 23 : "a boundary."); 24 57239 : params.addRequiredParam<std::string>( 25 : "diffusivity", 26 : "The name of the diffusivity material property that will be used in the flux computation."); 27 57239 : return params; 28 0 : } 29 : 30 78 : LayeredSideDiffusiveFluxAverage::LayeredSideDiffusiveFluxAverage(const InputParameters & parameters) 31 : : LayeredSideAverage(parameters), 32 78 : _diffusivity(parameters.get<std::string>("diffusivity")), 33 156 : _diffusion_coef(getMaterialProperty<Real>(_diffusivity)) 34 : { 35 78 : } 36 : 37 : Real 38 36208 : LayeredSideDiffusiveFluxAverage::computeQpIntegral() 39 : { 40 36208 : if (_fv) 41 : { 42 : // Get the face info 43 1152 : const FaceInfo * const fi = _mesh.faceInfo(_current_elem, _current_side); 44 : mooseAssert(fi, "We should have a face info"); 45 : 46 : // Get the gradient of the variable on the face 47 1152 : const auto & grad_u = _fv_variable->adGradSln(*fi, determineState()); 48 : 49 : // FIXME Get the diffusion coefficient on the face, see #16809 50 1152 : return -MetaPhysicL::raw_value(_diffusion_coef[_qp] * grad_u * _normals[_qp]); 51 1152 : } 52 : else 53 35056 : return -_diffusion_coef[_qp] * _grad_u[_qp] * _normals[_qp]; 54 : }