https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PecletNumberFunctorAux.C
Go to the documentation of this file.
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
11#include "MooseMesh.h"
12#include "NS.h"
13
15
18{
20 params.addClassDescription("Computes the Peclet number: u*L/alpha.");
21 params.addRequiredParam<MooseFunctorName>(NS::speed, "The fluid speed");
22 params.addRequiredParam<MooseFunctorName>(
24 "The fluid thermal diffusivity, or if using this object for evaluating mass transfer, the "
25 "mass diffusivity. Regardless of which, this should have units of length^2/time");
26 return params;
27}
28
30 : AuxKernel(parameters),
31 _speed(getFunctor<Real>(NS::speed)),
32 _alpha(getFunctor<Real>(NS::thermal_diffusivity)),
33 _use_qp_arg(dynamic_cast<MooseVariableFE<Real> *>(&_var))
34{
35 if (!_use_qp_arg && !dynamic_cast<MooseVariableFV<Real> *>(&_var))
37 "variable",
38 "The variable must be a non-vector, non-array finite-volume/finite-element variable.");
39
40 if (isNodal())
41 mooseError("This AuxKernel only supports Elemental fields");
42}
43
44Real
46{
48 const auto state = determineState();
49
50 if (_use_qp_arg)
51 {
53 return _current_elem->hmax() * _speed(qp_arg, state) / _alpha(qp_arg, state);
54 }
55 else
56 {
57 const auto elem_arg = makeElemArg(_current_elem);
58 return _current_elem->hmax() * _speed(elem_arg, state) / _alpha(elem_arg, state);
59 }
60}
registerMooseObject("NavierStokesApp", PecletNumberFunctorAux)
const MooseArray< Point > & _q_point
const Elem *const & _current_elem
MooseVariableField< ComputeValueType > & _var
const QBase *const & _qrule
static InputParameters validParams()
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void paramError(const std::string &param, Args... args) const
void mooseError(Args &&... args) const
Computes u*L/alpha where L is the maximum element dimension.
PecletNumberFunctorAux(const InputParameters &parameters)
const Moose::Functor< Real > & _speed
The fluid speed.
static InputParameters validParams()
const bool _use_qp_arg
Whether to use a quadrature-based argument to evaluate the functors.
const Moose::Functor< Real > & _alpha
The fluid thermal diffusivity or mass diffusivity. Should have units of length^2/time.
Moose::StateArg determineState() const
auto raw_value(const Eigen::Map< T > &in)
static const std::string thermal_diffusivity
Definition NS.h:137
static const std::string speed
Definition NS.h:147