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