Line data Source code
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 "ADDynamicViscosityMaterial.h" 11 : #include "SinglePhaseFluidProperties.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", ADDynamicViscosityMaterial); 14 : 15 : InputParameters 16 9006 : ADDynamicViscosityMaterial::validParams() 17 : { 18 9006 : InputParameters params = Material::validParams(); 19 : 20 18012 : params.addRequiredParam<MaterialPropertyName>("mu", "Dynamic viscosity property"); 21 18012 : params.addRequiredParam<MaterialPropertyName>("v", "Specific volume property"); 22 18012 : params.addRequiredParam<MaterialPropertyName>("e", "Specific internal energy property"); 23 : 24 18012 : params.addRequiredParam<UserObjectName>("fp_1phase", "Single-phase fluid properties"); 25 : 26 9006 : params.addClassDescription("Computes dynamic viscosity as a material property"); 27 : 28 9006 : return params; 29 0 : } 30 : 31 6969 : ADDynamicViscosityMaterial::ADDynamicViscosityMaterial(const InputParameters & parameters) 32 : : Material(parameters), 33 : 34 6969 : _mu_name(getParam<MaterialPropertyName>("mu")), 35 6969 : _mu(declareADProperty<Real>(_mu_name)), 36 : 37 13938 : _v(getADMaterialProperty<Real>("v")), 38 : 39 13938 : _e(getADMaterialProperty<Real>("e")), 40 : 41 13938 : _fp_1phase(getUserObject<SinglePhaseFluidProperties>("fp_1phase")) 42 : { 43 6969 : } 44 : 45 : void 46 14861229 : ADDynamicViscosityMaterial::computeQpProperties() 47 : { 48 14861229 : _mu[_qp] = _fp_1phase.mu_from_v_e(_v[_qp], _e[_qp]); 49 14861229 : }