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 "CoupledForceLM.h" 11 : 12 : registerMooseObject("ScalarTransportApp", CoupledForceLM); 13 : 14 : InputParameters 15 60 : CoupledForceLM::validParams() 16 : { 17 60 : auto params = LMKernel::validParams(); 18 120 : params.addRequiredCoupledVar("v", "The coupled variable which provides the force"); 19 120 : params.addParam<Real>( 20 120 : "coef", 1.0, "Coefficent ($\\sigma$) multiplier for the coupled force term."); 21 60 : params.addClassDescription( 22 : "Adds a coupled force term to a Lagrange multiplier constrained primal equation"); 23 60 : return params; 24 0 : } 25 : 26 33 : CoupledForceLM::CoupledForceLM(const InputParameters & parameters) 27 : : LMKernel(parameters), 28 33 : _v_var(coupled("v")), 29 33 : _v(adCoupledValue("v")), 30 99 : _coef(getParam<Real>("coef")) 31 : { 32 33 : } 33 : 34 : ADReal 35 397350 : CoupledForceLM::precomputeQpResidual() 36 : { 37 397350 : return -_coef * _v[_qp]; 38 : }