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 88 : params.addParam<unsigned int>( 32 88 : "wall_distance_index", 1, "Index into nek::scPtr where the wall distance is stored"); 33 44 : params.addClassDescription("Compute y+ on boundaries"); 34 44 : return params; 35 44 : } 36 : 37 15 : NekYPlus::NekYPlus(const InputParameters & parameters) 38 : : NekSidePostprocessor(parameters), 39 15 : _value_type(getParam<MooseEnum>("value_type")), 40 45 : _wall_distance_index(getParam<unsigned int>("wall_distance_index")) 41 : { 42 15 : if (_pp_mesh != nek_mesh::fluid) 43 1 : mooseError("The 'NekYPlus' postprocessor can only be applied to the fluid mesh " 44 : "boundaries!\n" 45 : "Please change 'mesh' to 'fluid'."); 46 14 : } 47 : 48 : Real 49 12 : NekYPlus::getValue() const 50 : { 51 12 : auto yplus = nekrs::yPlus(_boundary, _wall_distance_index); 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