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 "ReynoldsNumber.h" 22 : #include "NekInterface.h" 23 : #include "UserErrorChecking.h" 24 : 25 : registerMooseObject("CardinalApp", ReynoldsNumber); 26 : 27 : InputParameters 28 180 : ReynoldsNumber::validParams() 29 : { 30 180 : InputParameters params = NekSidePostprocessor::validParams(); 31 360 : params.addRangeCheckedParam<Real>("L_ref", "L_ref > 0.0", "Reference length scale"); 32 180 : params.addClassDescription("Reynolds number characteristic of the NekRS solution"); 33 180 : return params; 34 0 : } 35 : 36 60 : ReynoldsNumber::ReynoldsNumber(const InputParameters & parameters) 37 60 : : NekSidePostprocessor(parameters) 38 : { 39 : // for dimensional cases, we need to provide the characteristic length ourselves 40 : // because there's no way to infer it 41 60 : if (!_nek_problem->nondimensional()) 42 : { 43 88 : checkRequiredParam(parameters, "L_ref", "running NekRS in dimensional form"); 44 88 : _L_ref = &getParam<Real>("L_ref"); 45 : } 46 : else 47 32 : checkUnusedParam(parameters, "L_ref", "running NekRS in non-dimensional form"); 48 60 : } 49 : 50 : Real 51 184 : ReynoldsNumber::getValue() const 52 : { 53 184 : Real area = nekrs::area(_boundary, _pp_mesh); 54 184 : Real mdot = std::abs(nekrs::sideMassFluxWeightedIntegral(_boundary, field::unity, _pp_mesh)); 55 184 : Real mu = nekrs::viscosity(); 56 184 : Real L = _nek_problem->nondimensional() ? nekrs::referenceLength() : *_L_ref; 57 : 58 184 : return mdot * L / (area * mu); 59 : } 60 : 61 : #endif