https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FVBoundedValueConstraint.C
Go to the documentation of this file.
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
11
12#include "MooseVariableScalar.h"
13#include "MooseVariableFV.h"
14#include "Assembly.h"
15
17
20{
23 "This class is used to enforce a min or max value for a finite volume variable");
24 params.setDocString("phi0", "The min or max bound");
25 // Define the min/max enumeration
26 MooseEnum type_options("lower_than=0 higher_than=1");
28 "bound_type", type_options, "Whether a minimum or a maximum bound");
29 return params;
30}
31
33 : FVScalarLagrangeMultiplierConstraint(parameters), _bound_type(getParam<MooseEnum>("bound_type"))
34{
35}
36
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("MooseApp", FVBoundedValueConstraint)
This Kernel implements the residuals that enforce the constraint.
FVBoundedValueConstraint(const InputParameters &parameters)
static InputParameters validParams()
const MooseEnum _bound_type
What type of bound (min or max) this kernel intends to apply.
ADReal computeQpResidual() override final
This is the primary function that must be implemented for flux kernel terms.
MooseVariableFV< Real > & _var
const unsigned int _qp
const Elem *const & _current_elem
const ADVariableValue & _u
Base class for implementing constraints on finite volume variable elemental values using scalar Lagra...
const PostprocessorValue & _phi0
The value that we want the average of the primal variable to be equal to.
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
Helper method to create an elemental argument for a functor that includes whether to perform skewness...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void setDocString(const std::string &name, const std::string &doc)
Set the doc string of a parameter.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.