Line data Source code
1 : /********************************************************************/ 2 : /* SOFTWARE COPYRIGHT NOTIFICATION */ 3 : /* Cardinal */ 4 : /* */ 5 : /* (c) 2021 UChicago Argonne, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /* */ 8 : /* Prepared by UChicago Argonne, LLC */ 9 : /* Under Contract No. DE-AC02-06CH11357 */ 10 : /* With the U. S. Department of Energy */ 11 : /* */ 12 : /* Prepared by Battelle Energy Alliance, LLC */ 13 : /* Under Contract No. DE-AC07-05ID14517 */ 14 : /* With the U. S. Department of Energy */ 15 : /* */ 16 : /* See LICENSE for full restrictions */ 17 : /********************************************************************/ 18 : 19 : #ifdef ENABLE_NEK_COUPLING 20 : 21 : #include "NekYPlus.h" 22 : 23 : registerMooseObject("CardinalApp", NekYPlus); 24 : 25 : InputParameters 26 44 : NekYPlus::validParams() 27 : { 28 44 : InputParameters params = NekSidePostprocessor::validParams(); 29 88 : MooseEnum value_type("max min avg", "max"); 30 88 : params.addParam<MooseEnum>("value_type", value_type, "Type of value to report"); 31 44 : params.addClassDescription("Compute y+ on boundaries"); 32 44 : return params; 33 44 : } 34 : 35 15 : NekYPlus::NekYPlus(const InputParameters & parameters) 36 30 : : NekSidePostprocessor(parameters), _value_type(getParam<MooseEnum>("value_type")) 37 : { 38 15 : if (_pp_mesh != nek_mesh::fluid) 39 1 : mooseError("The 'NekYPlus' postprocessor can only be applied to the fluid mesh " 40 : "boundaries!\n" 41 : "Please change 'mesh' to 'fluid'."); 42 : 43 : // TODO: for moving mesh features, we will need to re-compute the wall distance 44 : // on every time step. This call here assumes the mesh is not moving. 45 14 : nekrs::computeWallDistance(_boundary); 46 14 : } 47 : 48 : Real 49 12 : NekYPlus::getValue() const 50 : { 51 12 : auto yplus = nekrs::yPlus(_boundary); 52 : 53 12 : if (_value_type == "max") 54 4 : return yplus[0]; 55 8 : else if (_value_type == "min") 56 4 : return yplus[1]; 57 4 : else if (_value_type == "avg") 58 4 : return yplus[2]; 59 : else 60 0 : mooseError("Unhandled 'value_type' in NekYPlus!"); 61 12 : } 62 : 63 : #endif