www.mooseframework.org
INSADMomentumPressure.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 "INSADMomentumPressure.h"
11 
13 
16  ADVectorKernel,
17  params.addClassDescription("Adds the pressure term to the INS momentum equation");
18  params.addRequiredCoupledVar("p", "The pressure");
19  params.addParam<bool>("integrate_p_by_parts",
20  true,
21  "Whether to integrate the pressure term by parts"););
22 
23 template <ComputeStage compute_stage>
25  : ADVectorKernel<compute_stage>(parameters),
26  _integrate_p_by_parts(getParam<bool>("integrate_p_by_parts")),
27  _p(adCoupledValue("p")),
28  _grad_p(adCoupledGradient("p"))
29 {
30 }
31 
32 template <ComputeStage compute_stage>
33 ADReal
35 {
36  if (_integrate_p_by_parts)
37  return -_p[_qp] * _grad_test[_i][_qp].tr();
38  else
39  return _test[_i][_qp] * _grad_p[_qp];
40 }
defineADValidParams
defineADValidParams(INSADMomentumPressure, ADVectorKernel, params.addClassDescription("Adds the pressure term to the INS momentum equation");params.addRequiredCoupledVar("p", "The pressure");params.addParam< bool >("integrate_p_by_parts", true, "Whether to integrate the pressure term by parts");)
INSADMomentumPressure::computeQpResidual
virtual ADReal computeQpResidual() override
Definition: INSADMomentumPressure.C:34
INSADMomentumPressure.h
INSADMomentumPressure::INSADMomentumPressure
INSADMomentumPressure(const InputParameters &parameters)
Definition: INSADMomentumPressure.C:24
registerADMooseObject
registerADMooseObject("NavierStokesApp", INSADMomentumPressure)
INSADMomentumPressure
This class computes the momentum equation residual and Jacobian contributions for the pressure term o...
Definition: INSADMomentumPressure.h:16