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