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