https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LinearFVAdvectionDiffusionFunctorRobinBC.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
13
16{
19 "Adds a Robin BC of the form \\alpha * \\nabla \\phi*n + \\beta * \\phi = \\gamma, "
20 "which can be used for the assembly of linear "
21 "finite volume system and whose face values are determined using "
22 "three functors. This kernel is "
23 "only designed to work with advection-diffusion problems.");
24 params.addParam<MooseFunctorName>(
25 "alpha", 1.0, "Functor for the coefficient of the normal gradient term.");
26 params.addParam<MooseFunctorName>("beta", 1.0, "Functor for the coefficient of the scalar term.");
27 params.addParam<MooseFunctorName>(
28 "gamma", 1.0, "Functor for the constant term on the RHS of the Robin BC.");
29 return params;
30}
31
33 const InputParameters & parameters)
35 _alpha(getFunctor<Real>("alpha")),
36 _beta(getFunctor<Real>("beta")),
37 _gamma(getFunctor<Real>("gamma"))
38{
40
41 if (_alpha.isConstant())
42 {
43 // We check if we can parse the value to a number and if yes, we throw an error if it is 0
44 std::istringstream ss(getParam<MooseFunctorName>("alpha"));
45 Real real_value;
46 if (ss >> real_value && ss.eof())
47 if (MooseUtils::isZero(real_value))
48 paramError("alpha",
49 "This value shall not be 0. Use a Dirichlet boundary condition instead!");
50 }
51}
52
53Real
58
59Real
64
65Real
registerMooseObject("MooseApp", LinearFVAdvectionDiffusionFunctorRobinBC)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
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.
Class implementing the base for the Robin boundary condition for linear finite volume variables.
Class implementing a Robin boundary condition for linear finite volume variables.
const Moose::Functor< Real > & _gamma
Functor giving the gamma coefficient (on right hand side, treated explicitly)
const Moose::Functor< Real > & _alpha
Functor giving the alpha coefficient (multiplying normal gradient)
LinearFVAdvectionDiffusionFunctorRobinBC(const InputParameters &parameters)
Class constructor.
virtual Real getAlpha(Moose::FaceArg face, Moose::StateArg state) const override
Getter functions (consistent entry point for all derived classes)
const Moose::Functor< Real > & _beta
Functor giving the beta coefficient (multiplying value)
virtual Real getGamma(Moose::FaceArg face, Moose::StateArg state) const override
virtual Real getBeta(Moose::FaceArg face, Moose::StateArg state) const override
MooseLinearVariableFV< Real > & _var
Reference to the linear finite volume variable object.
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition MooseBase.h:457
void computeCellGradients()
Switch to request cell gradient computations.
A structure defining a "face" evaluation calling argument for Moose functors.
State argument for evaluating functors.