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 "Kernel.h" 13 : #include "SinglePhaseFluidProperties.h" 14 : #include "MooseVariable.h" 15 : 16 : /** 17 : * This class couples together all the variables for the 3D fluid equations to allow them to be used 18 : * in derived Kernel classes. 19 : */ 20 : class INSFEFluidKernelBase : public Kernel 21 : { 22 : public: 23 : static InputParameters validParams(); 24 : 25 : INSFEFluidKernelBase(const InputParameters & parameters); 26 462 : virtual ~INSFEFluidKernelBase() {} 27 : 28 : protected: 29 : Real velocityDiv() { return _grad_u_vel[_qp](0) + _grad_v_vel[_qp](1) + _grad_w_vel[_qp](2); } 30 : RealVectorValue velocityDot() const; 31 : 32 : const VariableSecond & _second_u; 33 : // Coupled variables 34 : MooseVariable & _u_var; 35 : MooseVariable & _v_var; 36 : MooseVariable & _w_var; 37 : 38 : const VariableValue & _u_vel; 39 : const VariableValue & _v_vel; 40 : const VariableValue & _w_vel; 41 : const VariableValue & _pressure; 42 : const VariableValue & _temperature; 43 : 44 : const MaterialProperty<Real> & _rho; 45 : bool _has_porosity; 46 : const VariableValue & _porosity; 47 : 48 : bool _bTransient; 49 : const VariableValue & _u_vel_dot; 50 : const VariableValue & _v_vel_dot; 51 : const VariableValue & _w_vel_dot; 52 : 53 : // Gradients 54 : const VariableGradient & _grad_u_vel; 55 : const VariableGradient & _grad_v_vel; 56 : const VariableGradient & _grad_w_vel; 57 : const VariableGradient & _grad_pressure; 58 : const VariableGradient & _grad_temperature; 59 : 60 : // Variable numberings 61 : unsigned _u_vel_var_number; 62 : unsigned _v_vel_var_number; 63 : unsigned _w_vel_var_number; 64 : unsigned _pressure_var_number; 65 : unsigned _temperature_var_number; 66 : 67 : // Material properties 68 : const MaterialProperty<RealTensorValue> & _viscous_stress_tensor; 69 : const MaterialProperty<Real> & _dynamic_viscosity; 70 : const MaterialProperty<Real> & _turbulence_viscosity; 71 : const MaterialProperty<RealTensorValue> & _inertia_resistance_coeff; 72 : const MaterialProperty<RealTensorValue> & _viscous_resistance_coeff; 73 : 74 : /** 75 : * Helper function for mapping Moose variable numberings into 76 : * the "canonical" numbering for the porous medium equations. 77 : */ 78 : unsigned int mapVarNumber(unsigned int var) const; 79 : 80 : const SinglePhaseFluidProperties & _eos; 81 : 82 : RealVectorValue _vec_g; 83 : }; 84 : 85 : inline RealVectorValue 86 177500160 : INSFEFluidKernelBase::velocityDot() const 87 : { 88 177500160 : RealVectorValue vec_vel_dot(_u_vel_dot[_qp], _v_vel_dot[_qp], _w_vel_dot[_qp]); 89 177500160 : return vec_vel_dot; 90 : }