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 : 14 : // Forward Declarations 15 : 16 : /** 17 : * This class computes the "Chorin" Predictor equation in fully-discrete 18 : * (both time and space) form. 19 : */ 20 : class INSChorinPredictor : public Kernel 21 : { 22 : public: 23 : static InputParameters validParams(); 24 : 25 : INSChorinPredictor(const InputParameters & parameters); 26 : 27 88 : virtual ~INSChorinPredictor() {} 28 : 29 : protected: 30 : virtual Real computeQpResidual(); 31 : virtual Real computeQpJacobian(); 32 : virtual Real computeQpOffDiagJacobian(unsigned jvar); 33 : 34 : // Velocity 35 : const VariableValue & _u_vel; 36 : const VariableValue & _v_vel; 37 : const VariableValue & _w_vel; 38 : 39 : // Old Velocity 40 : const VariableValue & _u_vel_old; 41 : const VariableValue & _v_vel_old; 42 : const VariableValue & _w_vel_old; 43 : 44 : // Star Velocity 45 : const VariableValue & _u_vel_star; 46 : const VariableValue & _v_vel_star; 47 : const VariableValue & _w_vel_star; 48 : 49 : // Velocity Gradients 50 : const VariableGradient & _grad_u_vel; 51 : const VariableGradient & _grad_v_vel; 52 : const VariableGradient & _grad_w_vel; 53 : 54 : // Old Velocity Gradients 55 : const VariableGradient & _grad_u_vel_old; 56 : const VariableGradient & _grad_v_vel_old; 57 : const VariableGradient & _grad_w_vel_old; 58 : 59 : // Star Velocity Gradients 60 : const VariableGradient & _grad_u_vel_star; 61 : const VariableGradient & _grad_v_vel_star; 62 : const VariableGradient & _grad_w_vel_star; 63 : 64 : // Variable numberings 65 : unsigned _u_vel_var_number; 66 : unsigned _v_vel_var_number; 67 : unsigned _w_vel_var_number; 68 : 69 : // Star velocity numbers 70 : unsigned _u_vel_star_var_number; 71 : unsigned _v_vel_star_var_number; 72 : unsigned _w_vel_star_var_number; 73 : 74 : // Parameters 75 : unsigned _component; 76 : 77 : // An enumeration defining which velocity vector is used on the rhs 78 : // of the Chorin predictor. 79 : // OLD - Use velocity from the previous timestep, leads to explicit method 80 : // NEW - Use velocity from current timestep, this may not be an actual method 81 : // STAR - Use the "star" velocity. According to Donea's book, this is the 82 : // right way to get an implicit method... 83 : MooseEnum _predictor_enum; 84 : 85 : // A C++ enumeration corresponding to the predictor enumeration. 86 : enum PredictorType 87 : { 88 : OLD = 0, 89 : NEW = 1, 90 : STAR = 2 91 : }; 92 : 93 : // Material properties 94 : const MaterialProperty<Real> & _mu; 95 : const MaterialProperty<Real> & _rho; 96 : };