https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
14registerMooseObject("NavierStokesApp", PNSFVPGradEpsilon);
15
17PNSFVPGradEpsilon::validParams()
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
30PNSFVPGradEpsilon::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
39PNSFVPGradEpsilon::computeQpResidual()
40{
41 return -_pressure[_qp] * _eps_function.gradient(_t, _q_point[_qp])(_index);
42}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", PNSFVPGradEpsilon)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual const OutputTools< Real >::VariableGradient & gradient()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real