https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TestNavierStokesMethods.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
10#include "gtest/gtest.h"
11#include "NavierStokesMethods.h"
12#include "NS.h"
13
14namespace
15{
16// Residual of the equation that NS::findYplusThermal solves: the laminar sublayer
17// temperature profile equals the logarithmic-layer temperature profile at y.
18Real
19thermalMatchResidual(const Real & y, const Real & Pr, const Real & Pr_t)
20{
21 const auto Pr_ratio = Pr / Pr_t;
22 const auto jayatilleke_P =
23 9.24 * (std::pow(Pr_ratio, 0.75) - 1.0) * (1.0 + 0.28 * std::exp(-0.007 * Pr_ratio));
24 return Pr * y -
25 Pr_t * (1.0 / NS::von_karman_constant * std::log(NS::E_turb_constant * y) + jayatilleke_P);
26}
27}
28
29TEST(NavierStokesMethodsTest, findYplusThermalSatisfiesMatchingCondition)
30{
31 // A range of molecular-to-turbulent Prandtl number combinations spanning liquids
32 // (Pr >> 1), gases (Pr ~ 1), and liquid metals (Pr << 1).
33 const std::vector<std::pair<Real, Real>> cases = {
34 {0.7, 0.9}, {1.0, 0.85}, {7.0, 0.9}, {50.0, 1.0}, {0.01, 0.9}, {0.1, 0.7}};
35
36 for (const auto & [Pr, Pr_t] : cases)
37 {
38 const auto y_plus_thermal = NS::findYplusThermal<Real>(Pr, Pr_t);
39 EXPECT_GT(y_plus_thermal, 0.0);
40 EXPECT_NEAR(thermalMatchResidual(y_plus_thermal, Pr, Pr_t), 0.0, 1e-2 * Pr_t);
41 }
42}
const std::vector< double > y
TEST(NavierStokesMethodsTest, findYplusThermalSatisfiesMatchingCondition)
static constexpr Real von_karman_constant
Definition NS.h:206
static constexpr Real E_turb_constant
Definition NS.h:207
template Real findYplusThermal< Real >(const Real &Pr, const Real &Pr_t)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real