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 "FVIntegralValueConstraint.h" 11 : 12 : #include "MooseVariableScalar.h" 13 : #include "MooseVariableFV.h" 14 : #include "Assembly.h" 15 : 16 : registerMooseObject("MooseApp", FVIntegralValueConstraint); 17 : registerMooseObjectRenamed("MooseApp", 18 : FVScalarLagrangeMultiplier, 19 : "06/30/2022 24:00", 20 : FVIntegralValueConstraint); 21 : 22 : InputParameters 23 28726 : FVIntegralValueConstraint::validParams() 24 : { 25 28726 : InputParameters params = FVScalarLagrangeMultiplierConstraint::validParams(); 26 28726 : params.addClassDescription("This class is used to enforce integral of phi = volume * phi_0 " 27 : "with a Lagrange multiplier approach."); 28 28726 : params.setDocString("phi0", "What we want the average value of the primal variable to be."); 29 28726 : return params; 30 0 : } 31 : 32 100 : FVIntegralValueConstraint::FVIntegralValueConstraint(const InputParameters & parameters) 33 100 : : FVScalarLagrangeMultiplierConstraint(parameters) 34 : { 35 100 : } 36 : 37 : ADReal 38 15606 : FVIntegralValueConstraint::computeQpResidual() 39 : { 40 31212 : return _var(makeElemArg(_current_elem), determineState()) - _phi0; 41 : }