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 "INSQCriterionAux.h" 11 : 12 : registerMooseObject("NavierStokesApp", INSQCriterionAux); 13 : 14 : InputParameters 15 0 : INSQCriterionAux::validParams() 16 : { 17 0 : InputParameters params = AuxKernel::validParams(); 18 : 19 0 : params.addClassDescription("This class computes the Q criterion, a scalar which" 20 : "aids in vortex identification in turbulent flows"); 21 0 : params.addCoupledVar("velocity", "The velocity component"); 22 0 : return params; 23 0 : } 24 : 25 0 : INSQCriterionAux::INSQCriterionAux(const InputParameters & parameters) 26 0 : : AuxKernel(parameters), _grad_velocity(coupledVectorGradient("velocity")) 27 : { 28 0 : } 29 : 30 : Real 31 0 : INSQCriterionAux::computeValue() 32 : { 33 0 : const Real symm_part = 2.0 * Utility::pow<2>(_grad_velocity[_qp](0, 0)) + 34 0 : 2.0 * Utility::pow<2>(_grad_velocity[_qp](1, 1)) + 35 0 : 2.0 * Utility::pow<2>(_grad_velocity[_qp](2, 2)) + 36 0 : Utility::pow<2>(_grad_velocity[_qp](0, 2) + _grad_velocity[_qp](2, 0)) + 37 0 : Utility::pow<2>(_grad_velocity[_qp](0, 1) + _grad_velocity[_qp](1, 0)) + 38 0 : Utility::pow<2>(_grad_velocity[_qp](1, 2) + _grad_velocity[_qp](2, 1)); 39 : const Real antisymm_part = 40 0 : Utility::pow<2>(_grad_velocity[_qp](0, 2) - _grad_velocity[_qp](2, 0)) + 41 0 : Utility::pow<2>(_grad_velocity[_qp](0, 1) - _grad_velocity[_qp](1, 0)) + 42 0 : Utility::pow<2>(_grad_velocity[_qp](1, 2) - _grad_velocity[_qp](2, 1)); 43 0 : return 0.5 * (antisymm_part - symm_part); 44 : }