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 "InputParameters.h" 13 : #include "RhieChowInterpolatorBase.h" 14 : 15 : class MooseObject; 16 : class FaceInfo; 17 : 18 : /** 19 : * All objects that contribute to pressure-based (e.g. not density-based) Navier-Stokes momentum 20 : * equation residuals should inherit from this interface class. This holds true for INSFV, PINSFV, 21 : * and WCNSFV objects (but not CNSFV or PCNSFV). This interface class introduces virtual methods 22 : * that are used to gather on-diagonal 'a' coefficient data for Rhie-Chow interpolation 23 : */ 24 : class INSFVMomentumResidualObject 25 : { 26 : public: 27 : static InputParameters validParams(); 28 : 29 : /** 30 : * @param obj the residual object that inherits from this interface 31 : */ 32 : template <typename T> 33 : INSFVMomentumResidualObject(T & obj); 34 : 35 : /** 36 : * Should be a non-empty implementation if the residual object is a \p FVElementalKernel and 37 : * introduces residuals that are a function of the velocity, e.g. friction and time-derivative 38 : * terms. 39 : */ 40 : virtual void gatherRCData(const Elem & elem) = 0; 41 : 42 : /** 43 : * Should be a non-empty implementation if the residual object is a \p FVFluxKernel and introduces 44 : * residuals that are a function of the velocity, e.g. advection, viscosity/diffusion, symmetry 45 : * boundary conditions, etc. 46 : */ 47 : virtual void gatherRCData(const FaceInfo & fi) = 0; 48 : 49 31245 : virtual ~INSFVMomentumResidualObject() = default; 50 : 51 : protected: 52 : /// The Rhie Chow user object that is responsible for generating face velocities for advection 53 : /// terms. In monolithic solvers, it also collects data from kernels to determine suitable 54 : /// face velocities. 55 : RhieChowInterpolatorBase & _rc_uo; 56 : 57 : /// index x|y|z 58 : const unsigned int _index; 59 : }; 60 : 61 : template <typename T> 62 73216 : INSFVMomentumResidualObject::INSFVMomentumResidualObject(T & obj) 63 73216 : : _rc_uo(const_cast<RhieChowInterpolatorBase &>( 64 73216 : obj.template getUserObject<RhieChowInterpolatorBase>("rhie_chow_user_object"))), 65 219648 : _index(obj.template getParam<MooseEnum>("momentum_component")) 66 : { 67 73216 : }