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 "PCNSFVDensityTimeDerivative.h" 11 : #include "NS.h" 12 : 13 : registerMooseObject("NavierStokesApp", PCNSFVDensityTimeDerivative); 14 : 15 : InputParameters 16 17 : PCNSFVDensityTimeDerivative::validParams() 17 : { 18 17 : InputParameters params = FVTimeKernel::validParams(); 19 17 : params.addClassDescription("A time derivative kernel for which the form is eps * ddt(rho*var)."); 20 17 : params.addParam<MaterialPropertyName>(NS::porosity, NS::porosity, "The porosity"); 21 17 : params.addRequiredCoupledVar(NS::density, "The density variable."); 22 17 : return params; 23 0 : } 24 : 25 9 : PCNSFVDensityTimeDerivative::PCNSFVDensityTimeDerivative(const InputParameters & parameters) 26 : : FVTimeKernel(parameters), 27 18 : _u_dot(_var.adUDot()), 28 9 : _eps(getMaterialProperty<Real>(NS::porosity)), 29 9 : _rho_dot(adCoupledDot(NS::density)), 30 18 : _rho(adCoupledValue(NS::density)) 31 : { 32 9 : } 33 : 34 : ADReal 35 10000 : PCNSFVDensityTimeDerivative::computeQpResidual() 36 : { 37 30000 : return _eps[_qp] * (_u[_qp] * _rho_dot[_qp] + _u_dot[_qp] * _rho[_qp]); 38 : }