www.mooseframework.org
Advection.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 
8 #include "Advection.h"
9 #include "Function.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<INSBase>();
16 
17  params.addClassDescription("This class solves the scalar advection equation, "
18  "$\\vec{a}\\cdot\\nabla u = f$ with SUPG stabilization.");
19  params.addParam<FunctionName>("forcing_func", 0, "The forcing function, typically used for MMS.");
20  MooseEnum tau_type("opt mod");
21  params.addRequiredParam<MooseEnum>(
22  "tau_type", tau_type, "The type of stabilization parameter to use.");
23  return params;
24 }
25 
26 Advection::Advection(const InputParameters & parameters)
27  : INSBase(parameters),
28  _ffn(getFunction("forcing_func")),
29  _tau_type(getParam<MooseEnum>("tau_type"))
30 {
31 }
32 
33 Real
35 {
36  Real tau_val = (_tau_type == "opt" ? tauNodal() : tau());
37  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
38  return (_test[_i][_qp] + tau_val * (U * _grad_test[_i][_qp])) *
39  (U * _grad_u[_qp] - _ffn.value(_t, _q_point[_qp]));
40 }
41 
42 Real
44 {
45  Real tau_val = (_tau_type == "opt" ? tauNodal() : tau());
46  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
47  return (_test[_i][_qp] + tau_val * (U * _grad_test[_i][_qp])) * (U * _grad_phi[_j][_qp]);
48 }
virtual Real tau()
Definition: INSBase.C:268
virtual Real tauNodal()
Provides tau which yields superconvergence for 1D advection-diffusion.
Definition: INSBase.C:279
This class computes strong and weak components of the INS governing equations.
Definition: INSBase.h:22
const VariableValue & _u_vel
Definition: INSBase.h:67
MooseEnum _tau_type
Definition: Advection.h:34
const VariableValue & _w_vel
Definition: INSBase.h:69
Function & _ffn
Definition: Advection.h:33
virtual Real computeQpResidual()
Definition: Advection.C:34
InputParameters validParams< Advection >()
Definition: Advection.C:13
virtual Real computeQpJacobian()
Definition: Advection.C:43
Advection(const InputParameters &parameters)
Definition: Advection.C:26
InputParameters validParams< INSBase >()
Definition: INSBase.C:13
const VariableValue & _v_vel
Definition: INSBase.h:68