https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
42void
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}
const Real p
registerMooseObject("NavierStokesTestApp", PressureEqualsDensityMaterial)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
ADMaterialProperty< RealVectorValue > & _grad_p
ADMaterialProperty< RealVectorValue > & _velocity
PressureEqualsDensityMaterial(const InputParameters &parameters)
static const std::string density
Definition NS.h:34
static const std::string total_energy_density
Definition NS.h:66
static const std::string momentum_x
Definition NS.h:36
static const std::string momentum_y
Definition NS.h:37
static const std::string momentum_z
Definition NS.h:38