https://mooseframework.inl.gov
ExponentialReaction.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 
10 #include "ExponentialReaction.h"
11 
12 registerMooseObject("StochasticToolsTestApp", ExponentialReaction);
13 
16 {
18  params.addClassDescription(
19  "Implements a simple reaction term with the following weak form "
20  "$(\\psi_i,\\frac{\\mu_1}{\\mu_2}\\left[e^{\\mu_2 u_h}-1\\right])$.");
21  params.addParam<Real>("mu1", 0.3, "First coefficient in the nonlinear term.");
22  params.addParam<Real>("mu2", 9, "Second coefficient in the nonlinear term.");
23  params.declareControllable("mu1");
24  params.declareControllable("mu2");
25  return params;
26 }
27 
29  :
30  Kernel(parameters),
31  _mu1(getParam<Real>("mu1")),
32  _mu2(getParam<Real>("mu2"))
33 {}
34 
35 Real
37 {
38  return _test[_i][_qp] * _mu1 / _mu2 * (exp(_mu2 * _u[_qp]) - 1);
39 }
40 
41 Real
43 {
44  return _test[_i][_qp] * _phi[_j][_qp] * _mu1 * exp(_mu2 * _u[_qp]);
45 }
virtual Real computeQpResidual() override
static InputParameters validParams()
auto exp(const T &)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
const VariableTestValue & _test
unsigned int _i
unsigned int _j
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
ExponentialReaction(const InputParameters &parameters)
virtual Real computeQpJacobian() override
registerMooseObject("StochasticToolsTestApp", ExponentialReaction)
const VariablePhiValue & _phi
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
const VariableValue & _u
unsigned int _qp