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 "PINSFVScalarFieldAdvection.h" 11 : #include "NS.h" 12 : 13 : registerMooseObject("NavierStokesApp", PINSFVScalarFieldAdvection); 14 : 15 : InputParameters 16 41 : PINSFVScalarFieldAdvection::validParams() 17 : { 18 41 : auto params = INSFVScalarFieldAdvection::validParams(); 19 41 : params.addClassDescription( 20 : "Advects an arbitrary quantity, the associated nonlinear 'variable' in porous medium."); 21 41 : params.addRequiredParam<MooseFunctorName>(NS::porosity, 22 : "The name of the functor giving the local porosity"); 23 : 24 41 : return params; 25 0 : } 26 : 27 22 : PINSFVScalarFieldAdvection::PINSFVScalarFieldAdvection(const InputParameters & params) 28 22 : : INSFVScalarFieldAdvection(params), _eps(getFunctor<ADReal>(NS::porosity)) 29 : 30 : { 31 22 : if (_add_slip_model) 32 0 : mooseError("Slip model and porous medium treatment is not currently supported"); 33 22 : } 34 : 35 : ADReal 36 24570 : PINSFVScalarFieldAdvection::computeQpResidual() 37 : { 38 24570 : const auto state = determineState(); 39 : // Note that we do not use the advected quantity interpolation because we expect to use this 40 : // with a functor material that does not support upwinding 41 24570 : const auto eps_face = _eps(makeCDFace(*_face_info, false), state); 42 : 43 24570 : return INSFVScalarFieldAdvection::computeQpResidual() / eps_face; 44 : }