https://mooseframework.inl.gov
PressureEqualsDensityMaterial.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 
11 #include "NS.h"
12 
14 
17 {
19  params.addRequiredCoupledVar(NS::density, "The density");
20  params.addRequiredCoupledVar(NS::momentum_x, "The momentum in the x direction");
21  params.addCoupledVar(NS::momentum_y, 0, "The momentum in the y direction");
22  params.addCoupledVar(NS::momentum_z, 0, "The momentum in the z direction");
24  "The total energy density, e.g. Et or rho_et");
25  return params;
26 }
27 
29  : Material(parameters),
30  _rho(adCoupledValue(NS::density)),
31  _grad_rho(adCoupledGradient(NS::density)),
32  _rho_u(adCoupledValue(NS::momentum_x)),
33  _rho_v(adCoupledValue(NS::momentum_y)),
34  _rho_w(adCoupledValue(NS::momentum_z)),
35  _rho_et(adCoupledValue(NS::total_energy_density)),
36  _velocity(declareADProperty<RealVectorValue>(NS::velocity)),
37  _grad_p(declareADProperty<RealVectorValue>(NS::grad(NS::pressure))),
38  _rho_ht(declareADProperty<Real>(NS::total_enthalpy_density))
39 {
40 }
41 
42 void
44 {
45  _velocity[_qp] =
47 
48  // This is our dummy relationship between rho and p
49  const auto p = _rho[_qp];
51 
52  _rho_ht[_qp] = _rho_et[_qp] + p;
53 }
static const std::string total_energy_density
Definition: NS.h:65
static const std::string momentum_x
Definition: NS.h:35
ADMaterialProperty< RealVectorValue > & _velocity
ADMaterialProperty< RealVectorValue > & _grad_p
static const std::string density
Definition: NS.h:33
unsigned int _qp
static const std::string total_enthalpy_density
Definition: NS.h:71
static InputParameters validParams()
std::string grad(const std::string &var)
Definition: NS.h:91
void addCoupledVar(const std::string &name, const std::string &doc_string)
static const std::string momentum_y
Definition: NS.h:36
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:56
ADMaterialProperty< Real > & _rho_ht
registerMooseObject("NavierStokesTestApp", PressureEqualsDensityMaterial)
static const std::string velocity
Definition: NS.h:45
static const std::string momentum_z
Definition: NS.h:37
PressureEqualsDensityMaterial(const InputParameters &parameters)