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