www.mooseframework.org
INSStressComponentAux.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 "INSStressComponentAux.h"
11 #include "MooseMesh.h"
12 #include "NS.h"
13 
14 registerMooseObject("NavierStokesApp", INSStressComponentAux);
15 
18 {
20 
21  params.addClassDescription("This class computes the stress component based on "
22  "pressure and velocity for incompressible Navier-Stokes");
23  params.addCoupledVar("velocity", "The velocity component");
24  params.addCoupledVar(NS::pressure, 0, "The pressure");
25  params.addRangeCheckedParam<unsigned int>("comp", 0, "0<=comp<=2", "The component");
26  params.addParam<MaterialPropertyName>("mu_name", "mu", "The viscosity");
27 
28  return params;
29 }
30 
32  : AuxKernel(parameters),
33  _grad_velocity(isCoupled("velocity") ? coupledGradient("velocity") : _grad_zero),
34  _pressure(coupledValue(NS::pressure)),
35  _comp(getParam<unsigned>("comp")),
36  _mu(getMaterialProperty<Real>("mu_name"))
37 {
38 }
39 
40 Real
42 {
43  return _pressure[_qp] - _mu[_qp] * _grad_velocity[_qp](_comp);
44 }
const VariableGradient & _grad_velocity
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("NavierStokesApp", INSStressComponentAux)
Computes h_min / |u|.
INSStressComponentAux(const InputParameters &parameters)
void addCoupledVar(const std::string &name, const std::string &doc_string)
const MaterialProperty< Real > & _mu
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:56
const VariableValue & _pressure
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()