-
Notifications
You must be signed in to change notification settings - Fork 9
/
FluxComponent.C
56 lines (49 loc) · 1.93 KB
/
FluxComponent.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
50
51
52
53
54
55
56
//* 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
//
// https://github.com/dpploy/engy-5310
//
// Engy-5310: Computational Continuum Transport Phenomena
// UMass Lowell, Nuclear Chemical Engineering
// https://github.com/dpploy/engy-5310
#include "FluxComponent.h"
registerMooseObject("Engy5310App-FIXME", FluxComponent);
defineLegacyParams(FluxComponent);
InputParameters
FluxComponent::validParams()
{
InputParameters params = AuxKernel::validParams();
MooseEnum component("x y z");
params.addClassDescription("Compute one component of the flux of a field.");
params.addRequiredParam<MooseEnum>("component", component, "The desired component of flux.");
// Add a "coupling parameter" to get a variable from the input file.
params.addRequiredCoupledVar("field", "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;
}
FluxComponent::FluxComponent(const InputParameters & parameters):
AuxKernel(parameters),
_component(getParam<MooseEnum>("component")),
// Initialize variable gradient
_gradVariableName_component(coupledGradient("field")),
// Initialize parameters
_param1(getParam<Real>("param1")),
_param2(getParam<Real>("param2"))
{
}
Real
FluxComponent::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_component[_qp](_component);
}