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 : #pragma once 11 : 12 : #include "FVFluxBC.h" 13 : 14 : /** 15 : * Base class for implementing constraints on boundaries for finite volume variables using scalar 16 : * Lagrange multipliers 17 : */ 18 : class FVBoundaryScalarLagrangeMultiplierConstraint : public FVFluxBC 19 : { 20 : public: 21 : static InputParameters validParams(); 22 : 23 : FVBoundaryScalarLagrangeMultiplierConstraint(const InputParameters & parameters); 24 : 25 13 : const MooseVariableScalar & lambdaVariable() const { return _lambda_var; } 26 : 27 : protected: 28 : /// The value that we want the average/point-value/etc. of the primal variable to be equal to 29 : const PostprocessorValue & _phi0; 30 : 31 : private: 32 : void computeResidual(const FaceInfo & fi) override final; 33 : void computeJacobian(const FaceInfo & fi) override final; 34 : 35 : /// The Lagrange Multiplier variable 36 : const MooseVariableScalar & _lambda_var; 37 : 38 : /// The Lagrange Multiplier value 39 : const ADVariableValue & _lambda; 40 : };