/
VectorFlux.C
49 lines (43 loc) · 1.65 KB
/
VectorFlux.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
//
//* Engy-5310: Computational Continuum Transport Phenomena
//* UMass Lowell, Nuclear Chemical Engineering
//* https://github.com/dpploy/engy-5310
#include "VectorFlux.h"
registerMooseObject("Engy5310App-FIXME", VectorFlux);
InputParameters
VectorFlux::validParams()
{
InputParameters params = VectorAuxKernel::validParams();
params.addClassDescription("Computes the flux of a variable.");
// Add a "coupling parameter" to get a variable from the input file.
params.addRequiredCoupledVar("variableName", "The variable field.");
// Add add other parameters from input file
params.addRequiredParam<Real>("param1", "Parameter 1 meaning");
params.addRequiredParam<Real>("param2", "Parameter 2 meaning");
return params;
}
VectorFlux::VectorFlux(const InputParameters & parameters):
VectorAuxKernel(parameters),
// Initialize variable gradient
_gradVariableName(coupledGradient("variableName")),
// Initialize parameters
_param1(getParam<Real>("param1")),
_param2(getParam<Real>("param2"))
{
}
RealVectorValue
VectorFlux::computeValue()
{
// Access the gradient of the variable at this quadrature point, then pull out the
// "component" of it requested (x, y or z). Note, that getting a particular component
// of a gradient is done using the parenthesis operator.
FIXME return - _param1 * _param2 * _gradVariableName[_qp];
}