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 : #pragma once 11 : 12 : #include "FVFluxKernel.h" 13 : #include "INSFVBCInterface.h" 14 : 15 : /** 16 : * An advection kernel that implements interpolation schemes specific to Navier-Stokes flow 17 : * physics 18 : */ 19 : class INSFVAdvectionKernel : public FVFluxKernel, public INSFVBCInterface 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : INSFVAdvectionKernel(const InputParameters & params); 24 : void initialSetup() override; 25 : 26 : protected: 27 : bool skipForBoundary(const FaceInfo & fi) const override; 28 : 29 : /** 30 : * @returns whether the equation this object adds to has a material time derivative. An instance 31 : * when this will be false is the mass equation for incompressible flows 32 : */ 33 : virtual bool hasMaterialTimeDerivative() const = 0; 34 : 35 : /** 36 : * @returns the advecting velocity 37 : */ 38 : ADRealVectorValue velocity() const; 39 : 40 : /// The interpolation method to use for the advected quantity 41 : Moose::FV::InterpMethod _advected_interp_method; 42 : 43 : /// The interpolation method to use for the velocity 44 : Moose::FV::InterpMethod _velocity_interp_method; 45 : 46 : /// The Rhie-Chow user object that provides us with the velocity 47 : const RhieChowInterpolatorBase & _rc_vel_provider; 48 : }; 49 : 50 : inline ADRealVectorValue 51 256546972 : INSFVAdvectionKernel::velocity() const 52 : { 53 256546972 : return _rc_vel_provider.getVelocity( 54 256546972 : _velocity_interp_method, *_face_info, determineState(), _tid, hasMaterialTimeDerivative()); 55 : }