https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NavierStokesMethods.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 "NavierStokesMethods.h"
11#include "MooseError.h"
12#include "libmesh/vector_value.h"
13#include "NS.h"
14
15namespace NS
16{
17int
18delta(unsigned int i, unsigned int j)
19{
20 if (i == j)
21 return 1;
22 else
23 return 0;
24}
25
26int
27computeSign(const Real & a)
28{
29 return a > 0 ? 1 : (a < 0 ? -1 : 0);
30}
31
32unsigned int
33getIndex(const Real & p, const std::vector<Real> & bounds)
34{
35 if (p < bounds.front() || p > bounds.back())
36 mooseError("Point exceeds bounds of domain!");
37
38 for (unsigned int i = 1; i < bounds.size(); ++i)
39 if (p <= bounds[i])
40 return i - 1;
41
42 return bounds.size() - 2;
43}
44
45Real
47 const Real & Re, const Real & rho, const Real & mu, const Real & drho, const Real & dmu)
48{
49 return Re * (drho / std::max(rho, 1e-6) - dmu / std::max(mu, 1e-8));
50}
51
52Real
54 const Real & cp,
55 const Real & k,
56 const Real & dmu,
57 const Real & dcp,
58 const Real & dk)
59{
60 return (k * (mu * dcp + cp * dmu) - mu * cp * dk) / std::max(k * k, 1e-8);
61}
62
63template <typename T>
64T
65findUStar(const T & mu, const T & rho, const T & u, const Real dist)
66{
67 using std::log, std::sqrt, std::pow, std::max, std::abs;
68
69 // usually takes about 3-4 iterations
70 constexpr int MAX_ITERS{50};
71 constexpr Real REL_TOLERANCE{1e-6};
72
73 // Check inputs
74 mooseAssert(mu > 0, "Need a strictly positive viscosity");
75 mooseAssert(rho > 0, "Need a strictly positive density");
76 mooseAssert(u > 0, "Need a strictly positive velocity");
77 mooseAssert(dist > 0, "Need a strictly positive wall distance");
78
79 const T nu = mu / rho;
80
81 // Wall-function linearized guess
82 const Real a_c = 1 / NS::von_karman_constant;
83 const T b_c = 1.0 / NS::von_karman_constant * (log(NS::E_turb_constant * dist / mu) + 1.0);
84 const T & c_c = u;
85
87 T u_star = max(1e-20, (-b_c + sqrt(pow(b_c, 2) + 4.0 * a_c * c_c)) / (2.0 * a_c));
88
89 // Newton-Raphson method to solve for u_star (friction velocity).
90 for (int i = 0; i < MAX_ITERS; ++i)
91 {
92 T residual =
93 u_star / NS::von_karman_constant * log(NS::E_turb_constant * u_star * dist / nu) - u;
94 T deriv = (1.0 + log(NS::E_turb_constant * u_star * dist / nu)) / NS::von_karman_constant;
95 T new_u_star = max(1e-20, u_star - residual / deriv);
96
97 Real rel_err =
98 abs(MetaPhysicL::raw_value(new_u_star - u_star) / MetaPhysicL::raw_value(new_u_star));
99
100 u_star = new_u_star;
101 if (rel_err < REL_TOLERANCE)
102 return u_star;
103 }
104
105 mooseException("Could not find the wall friction velocity (mu: ",
106 mu,
107 " rho: ",
108 rho,
109 " velocity: ",
110 u,
111 " wall distance: ",
112 dist,
113 ")");
114}
115template Real findUStar<Real>(const Real & mu, const Real & rho, const Real & u, const Real dist);
116template ADReal
117findUStar<ADReal>(const ADReal & mu, const ADReal & rho, const ADReal & u, const Real dist);
118
119template <typename T>
120T
121findyPlus(const T & mu, const T & rho, const T & u, const Real dist)
122{
123 using std::max, std::log, std::abs;
124
125 // Fixed point iteration method to find y_plus
126 // It should take 3 or 4 iterations
127 constexpr int MAX_ITERS{10};
128 constexpr Real REL_TOLERANCE{1e-2};
129
130 // Check inputs
131 mooseAssert(mu > 0, "Need a strictly positive viscosity");
132 mooseAssert(u > 0, "Need a strictly positive velocity");
133 mooseAssert(rho > 0, "Need a strictly positive density");
134 mooseAssert(dist > 0, "Need a strictly positive wall distance");
135
136 Real yPlusLast = 0.0;
137 T yPlus = dist * u * rho / mu; // Assign initial value to laminar
138 const Real rev_yPlusLam = 1.0 / MetaPhysicL::raw_value(yPlus);
139 const T kappa_time_Re = NS::von_karman_constant * u * dist / (mu / rho);
140 unsigned int iters = 0;
141
142 do
143 {
144 yPlusLast = MetaPhysicL::raw_value(yPlus);
145 // Negative y plus does not make sense
146 yPlus = max(NS::min_y_plus, yPlus);
147 yPlus = (kappa_time_Re + yPlus) / (1.0 + log(NS::E_turb_constant * yPlus));
148 } while (abs(rev_yPlusLam * (MetaPhysicL::raw_value(yPlus) - yPlusLast)) > REL_TOLERANCE &&
149 ++iters < MAX_ITERS);
150
151 return max(NS::min_y_plus, yPlus);
152}
153
154template Real findyPlus<Real>(const Real & mu, const Real & rho, const Real & u, Real dist);
155template ADReal
156findyPlus<ADReal>(const ADReal & mu, const ADReal & rho, const ADReal & u, Real dist);
157
158template <typename T>
159T
160findYplusThermal(const T & Pr, const T & Pr_t)
161{
162 using std::abs, std::exp, std::log, std::max, std::pow;
163
164 constexpr int MAX_ITERS{35};
165 constexpr Real REL_TOLERANCE{1e-3};
166 constexpr Real DERIV_TOLERANCE{1e-12};
167
168 mooseAssert(Pr > 0, "Need a strictly positive Prandtl number");
169 mooseAssert(Pr_t > 0, "Need a strictly positive turbulent Prandtl number");
170
171 const auto Pr_ratio = Pr / Pr_t;
172
173 const auto jayatilleke_P =
174 9.24 * (pow(Pr_ratio, 0.75) - 1.0) * (1.0 + 0.28 * exp(-0.007 * Pr_ratio));
175
176 auto f = [&](const T y)
177 {
178 return Pr * y -
179 Pr_t * (1.0 / NS::von_karman_constant * log(NS::E_turb_constant * y) + jayatilleke_P);
180 };
181
182 auto df = [&](const T y) { return Pr - Pr_t * (1.0 / NS::von_karman_constant / y); };
183
184 // Location of the minimum of f(y); the larger root is to the right of this.
185 const auto y_plus_min = Pr_t / (Pr * NS::von_karman_constant);
186
187 // Start to the right of the minimum so Newton converges to the larger root.
188 auto y_plus = max(1.5 * y_plus_min, NS::min_y_plus);
189 auto y_plus_last = y_plus;
190
191 // If the minimum is above zero, no real intersection exists.
192 const auto f_min = f(y_plus_min);
193 if (f_min > 0.0)
194 return T(y_plus);
195
196 unsigned int iters = 0;
197 do
198 {
199 y_plus_last = y_plus;
200
201 const auto f_val = f(y_plus);
202 const auto df_val = df(y_plus);
203
204 // Avoid division by nearly zero derivative
205 if (abs(df_val) < DERIV_TOLERANCE)
206 mooseException("Derivative vanished while finding the thermal matching non-dimensional wall "
207 "distance (Pr: ",
208 Pr,
209 " Pr_t: ",
210 Pr_t,
211 ")");
212
213 auto y_new = y_plus - f_val / df_val;
214
215 // Keep Newton on the right branch so we get the largest root
216 if (y_new <= y_plus_min)
217 y_new = 0.5 * (y_plus + y_plus_min);
218
219 y_plus = max(y_new, NS::min_y_plus);
220 } while (abs((y_plus - y_plus_last) / y_plus_last) > REL_TOLERANCE && ++iters < MAX_ITERS);
221
222 if (iters >= MAX_ITERS && abs(f(y_plus)) > REL_TOLERANCE * Pr_t)
223 mooseException("Could not find the thermal matching non-dimensional wall distance (Pr: ",
224 Pr,
225 " Pr_t: ",
226 Pr_t,
227 ")");
228
229 return T(max(y_plus, NS::min_y_plus));
230}
231
232template Real findYplusThermal<Real>(const Real & Pr, const Real & Pr_t);
233
234template <typename T>
235T
237{
238 // if the velocity is zero, then the norm function call fails because AD tries to calculate the
239 // derivatives which causes a divide by zero - because d/dx(sqrt(f(x))) = 1/2/sqrt(f(x))*df/dx.
240 // So add a bit of noise (based on hitchhiker's guide to the galaxy's meaning of life number) to
241 // avoid this failure mode.
242 return isZero(velocity) ? 1e-42 : velocity.norm();
243}
246
247template <typename T>
248T
250 const Moose::Functor<T> * v,
251 const Moose::Functor<T> * w,
252 const Moose::ElemArg & elem_arg,
253 const Moose::StateArg & state,
254 const Moose::CoordinateSystemType coord_sys,
255 const unsigned int rz_radial_coord)
256{
257 const auto & grad_u = u.gradient(elem_arg, state);
258 const T Sij_xx = 2.0 * grad_u(0);
259 T Sij_xy = 0.0;
260 T Sij_xz = 0.0;
261 T Sij_yy = 0.0;
262 T Sij_yz = 0.0;
263 T Sij_zz = 0.0;
264
265 const T grad_xx = grad_u(0);
266 T grad_xy = 0.0;
267 T grad_xz = 0.0;
268 T grad_yx = 0.0;
269 T grad_yy = 0.0;
270 T grad_yz = 0.0;
271 T grad_zx = 0.0;
272 T grad_zy = 0.0;
273 T grad_zz = 0.0;
274
275 T trace = Sij_xx / 3.0;
276
277 if (v) // dim >= 2
278 {
279 const auto & grad_v = (*v).gradient(elem_arg, state);
280 Sij_xy = grad_u(1) + grad_v(0);
281 Sij_yy = 2.0 * grad_v(1);
282
283 grad_xy = grad_u(1);
284 grad_yx = grad_v(0);
285 grad_yy = grad_v(1);
286
287 trace += Sij_yy / 3.0;
288
289 if (w) // dim >= 3
290 {
291 const auto & grad_w = (*w).gradient(elem_arg, state);
292
293 Sij_xz = grad_u(2) + grad_w(0);
294 Sij_yz = grad_v(2) + grad_w(1);
295 Sij_zz = 2.0 * grad_w(2);
296
297 grad_xz = grad_u(2);
298 grad_yz = grad_v(2);
299 grad_zx = grad_w(0);
300 grad_zy = grad_w(1);
301 grad_zz = grad_w(2);
302
303 trace += Sij_zz / 3.0;
304 }
305 }
306
307 if (coord_sys == Moose::COORD_RZ)
308 {
309 mooseAssert(elem_arg.elem, "ElemArg must reference an element for cylindrical calculations.");
310 const auto radius = elem_arg.elem->vertex_average()(rz_radial_coord);
311 mooseAssert(radius > 0.0, "Axisymmetric radial coordinate should be positive.");
312
313 const Moose::Functor<T> * radial_functor = nullptr;
314 switch (rz_radial_coord)
315 {
316 case 0:
317 radial_functor = &u;
318 break;
319 case 1:
320 radial_functor = v;
321 break;
322 default:
323 mooseError("Unsupported axisymmetric radial coordinate index: ", rz_radial_coord);
324 }
325
326 mooseAssert(radial_functor,
327 "The functor corresponding to the axisymmetric radial velocity must be provided.");
328 const T radial_velocity = (*radial_functor)(elem_arg, state);
329 Sij_zz = 2.0 * radial_velocity / radius;
330 grad_zz = radial_velocity / radius;
331 trace += Sij_zz / 3.0;
332 }
333
334 // Note that in RZ we can only do X or Y axis. However, due to the hoop stress the
335 // Z direction (polar coordinate) tensors are not 0 in this case.
336 return (Sij_xx - trace) * grad_xx + Sij_xy * grad_xy + Sij_xz * grad_xz + Sij_xy * grad_yx +
337 (Sij_yy - trace) * grad_yy + Sij_yz * grad_yz + Sij_xz * grad_zx + Sij_yz * grad_zy +
338 (Sij_zz - trace) * grad_zz;
339}
341 const Moose::Functor<Real> * v,
342 const Moose::Functor<Real> * w,
343 const Moose::ElemArg & elem_arg,
344 const Moose::StateArg & state,
345 const Moose::CoordinateSystemType coord_sys,
346 const unsigned int rz_radial_coord);
347template ADReal
350 const Moose::Functor<ADReal> * w,
351 const Moose::ElemArg & elem_arg,
352 const Moose::StateArg & state,
353 const Moose::CoordinateSystemType coord_sys,
354 const unsigned int rz_radial_coord);
355
357void
358getWallBoundedElements(const std::vector<BoundaryName> & wall_boundary_names,
359 const FEProblemBase & fe_problem,
360 const SubProblem & subproblem,
361 const std::set<SubdomainID> & block_ids,
362 std::unordered_set<const Elem *> & wall_bounded)
363{
364
365 wall_bounded.clear();
366 const auto wall_boundary_ids = subproblem.mesh().getBoundaryIDs(wall_boundary_names);
367
368 // We define these lambdas so that we can fetch the bounded elements from other
369 // processors.
370 auto gather_functor = [&subproblem, &wall_bounded](const processor_id_type libmesh_dbg_var(pid),
371 const std::vector<dof_id_type> & elem_ids,
372 std::vector<unsigned char> & data_to_fill)
373 {
374 mooseAssert(pid != subproblem.processor_id(), "We shouldn't be gathering from ourselves.");
375 data_to_fill.resize(elem_ids.size());
376
377 const auto & mesh = subproblem.mesh().getMesh();
378
379 for (const auto i : index_range(elem_ids))
380 {
381 const auto elem = mesh.elem_ptr(elem_ids[i]);
382 data_to_fill[i] = wall_bounded.count(elem) != 0;
383 }
384 };
385
386 auto action_functor = [&subproblem, &wall_bounded](const processor_id_type libmesh_dbg_var(pid),
387 const std::vector<dof_id_type> & elem_ids,
388 const std::vector<unsigned char> & filled_data)
389 {
390 mooseAssert(pid != subproblem.processor_id(),
391 "The request filler shouldn't have been ourselves");
392 mooseAssert(elem_ids.size() == filled_data.size(), "I think these should be the same size");
393
394 const auto & mesh = subproblem.mesh().getMesh();
395
396 for (const auto i : index_range(elem_ids))
397 {
398 const auto elem = mesh.elem_ptr(elem_ids[i]);
399 if (filled_data[i])
400 wall_bounded.insert(elem);
401 }
402 };
403
404 // We need these elements from other processors
405 std::unordered_map<processor_id_type, std::vector<dof_id_type>> elem_ids_requested;
406
407 for (const auto & elem : fe_problem.mesh().getMesh().active_local_element_ptr_range())
408 if (block_ids.find(elem->subdomain_id()) != block_ids.end())
409 for (const auto i_side : elem->side_index_range())
410 {
411 // This is needed because in some cases the internal boundary is registered
412 // to the neighbor element
413 std::set<BoundaryID> combined_side_bds;
414 const auto & side_bnds = subproblem.mesh().getBoundaryIDs(elem, i_side);
415 combined_side_bds.insert(side_bnds.begin(), side_bnds.end());
416 if (const auto neighbor = elem->neighbor_ptr(i_side))
417 {
418 const auto neighbor_side = neighbor->which_neighbor_am_i(elem);
419 const auto & neighbor_bnds = subproblem.mesh().getBoundaryIDs(neighbor, neighbor_side);
420 combined_side_bds.insert(neighbor_bnds.begin(), neighbor_bnds.end());
421
422 // If the neighbor lives on the first layer of the ghost region then we would
423 // like to grab its value as well (if it exists)
424 if (neighbor->processor_id() != subproblem.processor_id() &&
425 block_ids.find(neighbor->subdomain_id()) != block_ids.end())
426 elem_ids_requested[neighbor->processor_id()].push_back(neighbor->id());
427 }
428
429 for (const auto wall_id : wall_boundary_ids)
430 if (combined_side_bds.count(wall_id))
431 {
432 wall_bounded.insert(elem);
433 break;
434 }
435 }
436
437 unsigned char * bool_ex = nullptr;
439 subproblem.comm(), elem_ids_requested, gather_functor, action_functor, bool_ex);
440}
441
443void
444getWallDistance(const std::vector<BoundaryName> & wall_boundary_name,
445 const FEProblemBase & fe_problem,
446 const SubProblem & subproblem,
447 const std::set<SubdomainID> & block_ids,
448 std::map<const Elem *, std::vector<Real>> & dist_map)
449{
450 dist_map.clear();
451 const auto wall_boundary_ids = subproblem.mesh().getBoundaryIDs(wall_boundary_name);
452
453 for (const auto & elem : fe_problem.mesh().getMesh().active_local_element_ptr_range())
454 if (block_ids.find(elem->subdomain_id()) != block_ids.end())
455 for (const auto i_side : elem->side_index_range())
456 {
457 // This is needed because in some cases the internal boundary is registered
458 // to the neighbor element
459 std::set<BoundaryID> combined_side_bds;
460 const auto & side_bnds = subproblem.mesh().getBoundaryIDs(elem, i_side);
461 combined_side_bds.insert(side_bnds.begin(), side_bnds.end());
462 if (const auto neighbor = elem->neighbor_ptr(i_side))
463 {
464 const auto neighbor_side = neighbor->which_neighbor_am_i(elem);
465 const std::vector<BoundaryID> & neighbor_bnds =
466 subproblem.mesh().getBoundaryIDs(neighbor, neighbor_side);
467 combined_side_bds.insert(neighbor_bnds.begin(), neighbor_bnds.end());
468 }
469
470 for (const auto wall_id : wall_boundary_ids)
471 if (combined_side_bds.count(wall_id))
472 {
473 // The list below stores the face infos with respect to their owning elements,
474 // depending on the block restriction we might encounter situations where the
475 // element outside of the block owns the face info.
476 const auto & neighbor = elem->neighbor_ptr(i_side);
477 const auto elem_has_fi = Moose::FV::elemHasFaceInfo(*elem, neighbor);
478 const auto & elem_for_fi = elem_has_fi ? elem : neighbor;
479 const auto side = elem_has_fi ? i_side : neighbor->which_neighbor_am_i(elem);
480
481 const FaceInfo * const fi = subproblem.mesh().faceInfo(elem_for_fi, side);
482 const auto & elem_centroid = elem_has_fi ? fi->elemCentroid() : fi->neighborCentroid();
483 const Real dist = std::abs((elem_centroid - fi->faceCentroid()) * fi->normal());
484 dist_map[elem].push_back(dist);
485 }
486 }
487}
488
490void
491getElementFaceArgs(const std::vector<BoundaryName> & wall_boundary_name,
492 const FEProblemBase & fe_problem,
493 const SubProblem & subproblem,
494 const std::set<SubdomainID> & block_ids,
495 std::map<const Elem *, std::vector<const FaceInfo *>> & face_info_map)
496{
497 face_info_map.clear();
498 const auto wall_boundary_ids = subproblem.mesh().getBoundaryIDs(wall_boundary_name);
499
500 for (const auto & elem : fe_problem.mesh().getMesh().active_local_element_ptr_range())
501 if (block_ids.find(elem->subdomain_id()) != block_ids.end())
502 for (const auto i_side : elem->side_index_range())
503 {
504 // This is needed because in some cases the internal boundary is registered
505 // to the neighbor element
506 std::set<BoundaryID> combined_side_bds;
507 const auto & side_bnds = subproblem.mesh().getBoundaryIDs(elem, i_side);
508 combined_side_bds.insert(side_bnds.begin(), side_bnds.end());
509 if (elem->neighbor_ptr(i_side) && !elem->neighbor_ptr(i_side)->is_remote())
510 {
511 const auto neighbor = elem->neighbor_ptr(i_side);
512 const auto neighbor_side = neighbor->which_neighbor_am_i(elem);
513 const std::vector<BoundaryID> & neighbor_bnds =
514 subproblem.mesh().getBoundaryIDs(neighbor, neighbor_side);
515 combined_side_bds.insert(neighbor_bnds.begin(), neighbor_bnds.end());
516 }
517
518 for (const auto wall_id : wall_boundary_ids)
519 if (combined_side_bds.count(wall_id))
520 {
521 // The list below stores the face infos with respect to their owning elements,
522 // depending on the block restriction we might encounter situations where the
523 // element outside of the block owns the face info.
524 const auto & neighbor = elem->neighbor_ptr(i_side);
525 const auto elem_has_fi = Moose::FV::elemHasFaceInfo(*elem, neighbor);
526 const auto & elem_for_fi = elem_has_fi ? elem : neighbor;
527 const auto side = elem_has_fi ? i_side : neighbor->which_neighbor_am_i(elem);
528
529 const FaceInfo * const fi = subproblem.mesh().faceInfo(elem_for_fi, side);
530 face_info_map[elem].push_back(fi);
531 }
532 }
533}
534}
DualNumber< Real, DNDerivativeType, true > ADReal
Real f(Real x)
Test function for Brents method.
const std::vector< double > y
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real p
const double Re
const double rho
const double T
void mooseError(Args &&... args)
virtual MooseMesh & mesh() override
const Point & normal() const
const Point & neighborCentroid() const
const Point & elemCentroid() const
const Point & faceCentroid() const
MeshBase & getMesh()
const std::vector< const FaceInfo * > & faceInfo() const
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
GradientType gradient(const ElemArg &elem, const StateArg &state) const
virtual MooseMesh & mesh()=0
Point vertex_average() const
processor_id_type processor_id() const
const Parallel::Communicator & comm() const
MeshBase & mesh
auto raw_value(const Eigen::Map< T > &in)
bool elemHasFaceInfo(const Elem &elem, const Elem *const neighbor)
CoordinateSystemType
void getWallBoundedElements(const std::vector< BoundaryName > &wall_boundary_name, const FEProblemBase &fe_problem, const SubProblem &subproblem, const std::set< SubdomainID > &block_ids, std::unordered_set< const Elem * > &wall_bounded)
Map marking wall bounded elements The map passed in wall_bounded_map gets cleared and re-populated.
T findyPlus(const T &mu, const T &rho, const T &u, Real dist)
Finds the non-dimensional wall distance normalized with the friction velocity Implements a fixed-poin...
void getWallDistance(const std::vector< BoundaryName > &wall_boundary_name, const FEProblemBase &fe_problem, const SubProblem &subproblem, const std::set< SubdomainID > &block_ids, std::map< const Elem *, std::vector< Real > > &dist_map)
Map storing wall ditance for near-wall marked elements The map passed in dist_map gets cleared and re...
int computeSign(const Real &a)
Sign function, returns $+1$ if $a$ is positive and $-1$ if $a$ is negative.
template ADReal findyPlus< ADReal >(const ADReal &mu, const ADReal &rho, const ADReal &u, Real dist)
T computeShearStrainRateNormSquared(const Moose::Functor< T > &u, const Moose::Functor< T > *v, const Moose::Functor< T > *w, const Moose::ElemArg &elem_arg, const Moose::StateArg &state, const Moose::CoordinateSystemType coord_sys=Moose::COORD_XYZ, const unsigned int rz_radial_coord=0)
Utility function to compute the shear strain rate.
template Real computeSpeed< Real >(const libMesh::VectorValue< Real > &velocity)
static constexpr Real von_karman_constant
Definition NS.h:206
static const std::string cp
Definition NS.h:125
Real reynoldsPropertyDerivative(const Real &Re, const Real &rho, const Real &mu, const Real &drho, const Real &dmu)
Computes the derivative of the Reynolds number, $Re\equiv \frac{\rho Vd}{\mu}$, with respect to an ar...
template ADReal computeSpeed< ADReal >(const libMesh::VectorValue< ADReal > &velocity)
static const std::string mu
Definition NS.h:127
static const std::string v
Definition NS.h:85
static const std::string k
Definition NS.h:134
T findUStar(const T &mu, const T &rho, const T &u, Real dist)
Finds the friction velocity using standard velocity wall functions formulation.
template ADReal computeShearStrainRateNormSquared< ADReal >(const Moose::Functor< ADReal > &u, const Moose::Functor< ADReal > *v, const Moose::Functor< ADReal > *w, const Moose::ElemArg &elem_arg, const Moose::StateArg &state, const Moose::CoordinateSystemType coord_sys, const unsigned int rz_radial_coord)
static constexpr Real E_turb_constant
Definition NS.h:207
Real prandtlPropertyDerivative(const Real &mu, const Real &cp, const Real &k, const Real &dmu, const Real &dcp, const Real &dk)
Computes the derivative of the Prandtl number, $Pr\equiv\frac{\mu C_p}{k}$, with respect to an arbitr...
template Real findYplusThermal< Real >(const Real &Pr, const Real &Pr_t)
T findYplusThermal(const T &Pr, const T &Pr_t)
Finds the thermal non-dimensional wall distance at which the laminar and logarithmic temperature wall...
unsigned int getIndex(const Real &p, const std::vector< Real > &bounds)
Determines the index $i$ in a sorted array such that the input point is within the $i$-th and $i+1$-t...
static constexpr Real min_y_plus
Definition NS.h:213
template ADReal findUStar< ADReal >(const ADReal &mu, const ADReal &rho, const ADReal &u, const Real dist)
T computeSpeed(const libMesh::VectorValue< T > &velocity)
Compute the speed (velocity norm) given the supplied velocity.
template Real findyPlus< Real >(const Real &mu, const Real &rho, const Real &u, Real dist)
int delta(unsigned int i, unsigned int j)
Delta function, which returns zero if $i\ne j$ and unity if $i=j$.
template Real computeShearStrainRateNormSquared< Real >(const Moose::Functor< Real > &u, const Moose::Functor< Real > *v, const Moose::Functor< Real > *w, const Moose::ElemArg &elem_arg, const Moose::StateArg &state, const Moose::CoordinateSystemType coord_sys, const unsigned int rz_radial_coord)
template Real findUStar< Real >(const Real &mu, const Real &rho, const Real &u, const Real dist)
static const std::string velocity
Definition NS.h:46
void getElementFaceArgs(const std::vector< BoundaryName > &wall_boundary_name, const FEProblemBase &fe_problem, const SubProblem &subproblem, const std::set< SubdomainID > &block_ids, std::map< const Elem *, std::vector< const FaceInfo * > > &face_info_map)
Map storing face arguments to wall bounded faces The map passed in face_info_map gets cleared and re-...
void pull_parallel_vector_data(const Communicator &comm, const MapToVectors &queries, GatherFunctor &gather_data, const ActionFunctor &act_on_data, const datum *example)
const libMesh::Elem * elem
const Real radius