www.mooseframework.org
LangevinNoise.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "LangevinNoise.h"
8 #include "MooseRandom.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Kernel>();
15  params.addClassDescription("Source term for non-conserved Langevin noise");
16  params.addRequiredParam<Real>("amplitude", "Amplitude"); // per sqrt(time)");
17  params.addParam<MaterialPropertyName>(
18  "multiplier",
19  1.0,
20  "Material property to multiply the random numbers with (defaults to 1.0 if omitted)");
21  return params;
22 }
23 LangevinNoise::LangevinNoise(const InputParameters & parameters)
24  : Kernel(parameters),
25  _amplitude(getParam<Real>("amplitude")),
26  _multiplier_prop(getMaterialProperty<Real>("multiplier"))
27 {
28 }
29 
30 void
32 {
33  unsigned int rseed = _t_step;
34  MooseRandom::seed(rseed);
35 }
36 
37 Real
39 {
40  return -_test[_i][_qp] * (2.0 * MooseRandom::rand() - 1.0) * _amplitude * _multiplier_prop[_qp];
41 }
const Real _amplitude
Definition: LangevinNoise.h:27
virtual Real computeQpResidual()
Definition: LangevinNoise.C:38
virtual void residualSetup()
Definition: LangevinNoise.C:31
LangevinNoise(const InputParameters &parameters)
Definition: LangevinNoise.C:23
const MaterialProperty< Real > & _multiplier_prop
Definition: LangevinNoise.h:28
InputParameters validParams< LangevinNoise >()
Definition: LangevinNoise.C:12