https://mooseframework.inl.gov
PNSFVPGradEpsilon.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 "PNSFVPGradEpsilon.h"
11 #include "NS.h"
12 #include "Function.h"
13 
14 registerMooseObject("NavierStokesApp", PNSFVPGradEpsilon);
15 
18 {
20  params.addClassDescription("Introduces a -p * grad_eps term.");
21  MooseEnum momentum_component("x=0 y=1 z=2");
23  "momentum_component",
24  momentum_component,
25  "The component of the momentum equation that this kernel applies to.");
26  params.addRequiredParam<FunctionName>("epsilon_function", "A function describing the porosity");
27  return params;
28 }
29 
30 PNSFVPGradEpsilon::PNSFVPGradEpsilon(const InputParameters & params)
31  : FVElementalKernel(params),
32  _pressure(getADMaterialProperty<Real>(NS::pressure)),
33  _eps_function(getFunction("epsilon_function")),
34  _index(getParam<MooseEnum>("momentum_component"))
35 {
36 }
37 
38 ADReal
39 PNSFVPGradEpsilon::computeQpResidual()
40 {
41  return -_pressure[_qp] * _eps_function.gradient(_t, _q_point[_qp])(_index);
42 }
registerMooseObject("NavierStokesApp", PNSFVPGradEpsilon)
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters validParams()
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual const OutputTools< Real >::VariableGradient & gradient()
static const std::string pressure
Definition: NS.h:56
void addClassDescription(const std::string &doc_string)