https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ConservedVarValuesMaterial.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// Navier-Stokes includes
12#include "NS.h"
13#include "NavierStokesMethods.h"
14
15// FluidProperties includes
17
19
22{
23 auto params = Material::validParams();
24 params.addRequiredParam<UserObjectName>(NS::fluid, "fluid userobject");
25 params.addRequiredCoupledVar(NS::density, "density");
26 params.addRequiredCoupledVar(NS::total_energy_density, "total fluid energy");
27 params.addRequiredCoupledVar(NS::momentum_x, "The x-momentum");
28 params.addCoupledVar(NS::momentum_y, "The y-momentum");
29 params.addCoupledVar(NS::momentum_z, "The z-momentum");
30 params.addClassDescription("Provides access to variables for a conserved variable set "
31 "of density, total fluid energy, and momentum");
32 return params;
33}
34
36 : Material(params),
37 _fluid(UserObjectInterface::getUserObject<SinglePhaseFluidProperties>(NS::fluid)),
38 _var_rho(adCoupledValue(NS::density)),
39 _var_rho_u(adCoupledValue(NS::momentum_x)),
40 _var_rho_v(isCoupled(NS::momentum_y) ? adCoupledValue(NS::momentum_y) : _ad_zero),
41 _var_rho_w(isCoupled(NS::momentum_z) ? adCoupledValue(NS::momentum_z) : _ad_zero),
42 _var_total_energy_density(adCoupledValue(NS::total_energy_density)),
43 _rho(declareADProperty<Real>(NS::density)),
44 _mass_flux(declareADProperty<RealVectorValue>(NS::mass_flux)),
45 _momentum(declareADProperty<RealVectorValue>(NS::momentum)),
46 _total_energy_density(declareADProperty<Real>(NS::total_energy_density)),
47 _velocity(declareADProperty<RealVectorValue>(NS::velocity)),
48 _speed(declareADProperty<Real>(NS::speed)),
49 _vel_x(declareADProperty<Real>(NS::velocity_x)),
50 _vel_y(declareADProperty<Real>(NS::velocity_y)),
51 _vel_z(declareADProperty<Real>(NS::velocity_z)),
52 _rhou(declareADProperty<Real>(NS::momentum_x)),
53 _rhov(declareADProperty<Real>(NS::momentum_y)),
54 _rhow(declareADProperty<Real>(NS::momentum_z)),
55 _v(declareADProperty<Real>(NS::v)),
56 _specific_internal_energy(declareADProperty<Real>(NS::specific_internal_energy)),
57 _pressure(declareADProperty<Real>(NS::pressure)),
58 _specific_total_enthalpy(declareADProperty<Real>(NS::specific_total_enthalpy)),
59 _rho_ht(declareADProperty<Real>(NS::total_enthalpy_density)),
60 _T_fluid(declareADProperty<Real>(NS::T_fluid))
61{
62}
63
64void
registerMooseObject("NavierStokesApp", ConservedVarValuesMaterial)
const double v
This object takes a conserved free-flow variable set (rho, rhoU, rho et) and computes all the necessa...
const ADVariableValue & _var_total_energy_density
virtual void computeQpProperties() override
ADMaterialProperty< Real > & _vel_z
ADMaterialProperty< Real > & _v
ADMaterialProperty< RealVectorValue > & _momentum
ADMaterialProperty< Real > & _specific_internal_energy
ADMaterialProperty< Real > & _vel_y
ADMaterialProperty< Real > & _rhou
ADMaterialProperty< Real > & _rho_ht
ADMaterialProperty< Real > & _rho
ADMaterialProperty< Real > & _vel_x
ConservedVarValuesMaterial(const InputParameters &parameters)
ADMaterialProperty< RealVectorValue > & _mass_flux
ADMaterialProperty< Real > & _rhow
ADMaterialProperty< Real > & _total_energy_density
ADMaterialProperty< RealVectorValue > & _velocity
ADMaterialProperty< Real > & _speed
const SinglePhaseFluidProperties & _fluid
fluid properties
ADMaterialProperty< Real > & _T_fluid
ADMaterialProperty< Real > & _rhov
ADMaterialProperty< Real > & _pressure
ADMaterialProperty< Real > & _specific_total_enthalpy
static InputParameters validParams()
unsigned int _qp
static InputParameters validParams()
Common class for single phase fluid properties.
static const std::string density
Definition NS.h:34
template ADReal computeSpeed< ADReal >(const libMesh::VectorValue< ADReal > &velocity)
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 fluid
Definition NS.h:88
static const std::string momentum_z
Definition NS.h:38