ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ERF_ComputeTurbulentViscosity.cpp File Reference
#include <ERF_ABLMost.H>
#include <ERF_EddyViscosity.H>
#include <ERF_Diffusion.H>
#include <ERF_PBLModels.H>
#include <ERF_TileNoZ.H>
#include <ERF_TerrainMetrics.H>
Include dependency graph for ERF_ComputeTurbulentViscosity.cpp:

Functions

void ComputeTurbulentViscosityLES (const MultiFab &Tau11, const MultiFab &Tau22, const MultiFab &Tau33, const MultiFab &Tau12, const MultiFab &Tau13, const MultiFab &Tau23, const MultiFab &cons_in, MultiFab &eddyViscosity, MultiFab &Hfx1, MultiFab &Hfx2, MultiFab &Hfx3, MultiFab &Diss, const Geometry &geom, bool use_terrain, const MultiFab &mapfac_u, const MultiFab &mapfac_v, const std::unique_ptr< MultiFab > &z_phys_nd, const TurbChoice &turbChoice, const Real const_grav, std::unique_ptr< ABLMost > &most, const bool &exp_most)
 
void ComputeTurbulentViscosityRANS (const MultiFab &, const MultiFab &, const MultiFab &, const MultiFab &, const MultiFab &, const MultiFab &, const MultiFab &cons_in, const MultiFab &wdist, MultiFab &eddyViscosity, MultiFab &Hfx1, MultiFab &Hfx2, MultiFab &Hfx3, MultiFab &Diss, const Geometry &geom, bool use_terrain, const MultiFab &, const MultiFab &, const std::unique_ptr< MultiFab > &z_phys_nd, const TurbChoice &turbChoice, const Real const_grav, std::unique_ptr< ABLMost > &most, const FArrayBox *z_0, const bool &exp_most)
 
void ComputeTurbulentViscosity (const MultiFab &xvel, const MultiFab &yvel, const MultiFab &Tau11, const MultiFab &Tau22, const MultiFab &Tau33, const MultiFab &Tau12, const MultiFab &Tau13, const MultiFab &Tau23, const MultiFab &cons_in, const MultiFab &wdist, MultiFab &eddyViscosity, MultiFab &Hfx1, MultiFab &Hfx2, MultiFab &Hfx3, MultiFab &Diss, const Geometry &geom, const MultiFab &mapfac_u, const MultiFab &mapfac_v, const std::unique_ptr< MultiFab > &z_phys_nd, const SolverChoice &solverChoice, std::unique_ptr< ABLMost > &most, const amrex::FArrayBox *z_0, const bool &exp_most, const bool &use_terrain_fitted_coords, const bool &use_moisture, int level, const BCRec *bc_ptr, bool vert_only)
 

Function Documentation

◆ ComputeTurbulentViscosity()

void ComputeTurbulentViscosity ( const MultiFab &  xvel,
const MultiFab &  yvel,
const MultiFab &  Tau11,
const MultiFab &  Tau22,
const MultiFab &  Tau33,
const MultiFab &  Tau12,
const MultiFab &  Tau13,
const MultiFab &  Tau23,
const MultiFab &  cons_in,
const MultiFab &  wdist,
MultiFab &  eddyViscosity,
MultiFab &  Hfx1,
MultiFab &  Hfx2,
MultiFab &  Hfx3,
MultiFab &  Diss,
const Geometry &  geom,
const MultiFab &  mapfac_u,
const MultiFab &  mapfac_v,
const std::unique_ptr< MultiFab > &  z_phys_nd,
const SolverChoice solverChoice,
std::unique_ptr< ABLMost > &  most,
const amrex::FArrayBox *  z_0,
const bool &  exp_most,
const bool &  use_terrain_fitted_coords,
const bool &  use_moisture,
int  level,
const BCRec *  bc_ptr,
bool  vert_only 
)

Wrapper to compute turbulent viscosity with LES or PBL.

Parameters
[in]xvelvelocity in x-dir
[in]yvelvelocity in y-dir
[in]Tau1111 strain
[in]Tau2222 strain
[in]Tau3333 strain
[in]Tau1212 strain
[in]Tau1313 strain
[in]Tau2323 strain
[in]cons_incell center conserved quantities
[out]eddyViscosityturbulent viscosity
[in]Hfx1heat flux in x-dir
[in]Hfx2heat flux in y-dir
[in]Hfx3heat flux in z-dir
[in]Dissdissipation of turbulent kinetic energy
[in]geomproblem geometry
[in]mapfac_umap factor at x-face
[in]mapfac_vmap factor at y-face
[in]turbChoicecontainer with turbulence parameters
[in]mostpointer to Monin-Obukhov class if instantiated
[in]vert_onlyflag for vertical components of eddyViscosity
561 {
562  BL_PROFILE_VAR("ComputeTurbulentViscosity()",ComputeTurbulentViscosity);
563  //
564  // In LES mode, the turbulent viscosity is isotropic, so the LES model sets both horizontal and vertical viscosities
565  // In PBL mode, the primary purpose of the PBL model is to control vertical transport, so the PBL model sets the vertical viscosity.
566  // Optionally, the PBL model can be run in conjunction with an LES model that sets the horizontal viscosity
567  // (this isn’t truly LES, but the model form is the same as Smagorinsky).
568  //
569  // ComputeTurbulentViscosityLES populates the LES viscosity for both horizontal and vertical components.
570  // ComputeTurbulentViscosityPBL computes the PBL viscosity just for the vertical component.
571  //
572 
573  TurbChoice turbChoice = solverChoice.turbChoice[level];
574  const Real const_grav = solverChoice.gravity;
575 
576  if (most) {
577  bool l_use_turb = ( turbChoice.les_type == LESType::Smagorinsky ||
578  turbChoice.les_type == LESType::Deardorff ||
579  turbChoice.rans_type == RANSType::kEqn ||
580  turbChoice.pbl_type == PBLType::MYNN25 ||
581  turbChoice.pbl_type == PBLType::MYNNEDMF ||
582  turbChoice.pbl_type == PBLType::YSU );
583  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(l_use_turb,
584  "A turbulence model must be utilized with MOST boundaries to compute the turbulent viscosity");
585  } else {
586  AMREX_ALWAYS_ASSERT(!vert_only);
587  }
588 
589  bool impose_phys_bcs = false;
590 
591  if (turbChoice.les_type != LESType::None) {
592  impose_phys_bcs = true;
593  ComputeTurbulentViscosityLES(Tau11, Tau22, Tau33,
594  Tau12, Tau13, Tau23,
595  cons_in, eddyViscosity,
596  Hfx1, Hfx2, Hfx3, Diss,
597  geom, use_terrain_fitted_coords,
598  mapfac_u, mapfac_v,
599  z_phys_nd, turbChoice, const_grav,
600  most, exp_most);
601  }
602 
603  if (turbChoice.rans_type != RANSType::None) {
604  impose_phys_bcs = true;
605  ComputeTurbulentViscosityRANS(Tau11, Tau22, Tau33,
606  Tau12, Tau13, Tau23,
607  cons_in, wdist,
608  eddyViscosity,
609  Hfx1, Hfx2, Hfx3, Diss,
610  geom, use_terrain_fitted_coords,
611  mapfac_u, mapfac_v,
612  z_phys_nd, turbChoice, const_grav,
613  most, z_0, exp_most);
614  }
615 
616  if (turbChoice.pbl_type == PBLType::MYNN25) {
617  ComputeDiffusivityMYNN25(xvel, yvel, cons_in, eddyViscosity,
618  geom, turbChoice, most,
619  use_terrain_fitted_coords, use_moisture,
620  level, bc_ptr, vert_only, z_phys_nd,
621  solverChoice.RhoQv_comp, solverChoice.RhoQc_comp,
622  solverChoice.RhoQr_comp);
623  } else if (turbChoice.pbl_type == PBLType::MYNNEDMF) {
624  ComputeDiffusivityMYNNEDMF(xvel, yvel, cons_in, eddyViscosity,
625  geom, turbChoice, most,
626  use_terrain_fitted_coords, use_moisture,
627  level, bc_ptr, vert_only, z_phys_nd,
628  solverChoice.RhoQv_comp, solverChoice.RhoQc_comp,
629  solverChoice.RhoQr_comp);
630  } else if (turbChoice.pbl_type == PBLType::YSU) {
631  ComputeDiffusivityYSU(xvel, yvel, cons_in, eddyViscosity,
632  geom, turbChoice, most,
633  use_terrain_fitted_coords, use_moisture,
634  level, bc_ptr, vert_only, z_phys_nd);
635  }
636 
637  //
638  // At all levels we need to fill values outside the physical boundary for the LES coeffs.
639  // In addition, for all cases, if at level > 0, we want to fill fine ghost cell values that
640  // overlie coarse grid cells (and that are not in another fine valid region) with
641  // extrapolated values from the interior, rather than interpolating from the coarser level,
642  // since we may be using a different turbulence model there.
643  //
644  // Note: here "covered" refers to "covered by valid region of another grid at this level"
645  // Note: here "physbnd" refers to "cells outside the domain if not periodic"
646  // Note: here "interior" refers to "valid cells, i.e. inside 'my' grid"
647  //
648  {
649  int is_covered = 0;
650  int is_notcovered = 1;
651  int is_physbnd = 2;
652  int is_interior = 3;
653  iMultiFab cc_mask(eddyViscosity.boxArray(),eddyViscosity.DistributionMap(),1,1);
654  cc_mask.BuildMask(geom.Domain(), geom.periodicity(), is_covered, is_notcovered, is_physbnd, is_interior);
655 
656  Box domain = geom.Domain();
657  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
658  if (geom.isPeriodic(i)) {
659  domain.grow(i,1);
660  }
661  }
662 
663  eddyViscosity.FillBoundary(geom.periodicity());
664 
665  int ncomp = eddyViscosity.nComp();
666 
667 #ifdef _OPENMP
668 #pragma omp parallel if (Gpu::notInLaunchRegion())
669 #endif
670  for (MFIter mfi(eddyViscosity); mfi.isValid(); ++mfi)
671  {
672  Box vbx = mfi.validbox();
673 
674  Box planex_lo = mfi.growntilebox(1); planex_lo.setBig(0, vbx.smallEnd(0)-1);
675  Box planey_lo = mfi.growntilebox(1); planey_lo.setBig(1, vbx.smallEnd(1)-1);
676  Box planez_lo = mfi.growntilebox(1); planez_lo.setBig(2, vbx.smallEnd(2)-1);
677 
678  Box planex_hi = mfi.growntilebox(1); planex_hi.setSmall(0, vbx.bigEnd(0)+1);
679  Box planey_hi = mfi.growntilebox(1); planey_hi.setSmall(1, vbx.bigEnd(1)+1);
680  Box planez_hi = mfi.growntilebox(1); planez_hi.setSmall(2, vbx.bigEnd(2)+1);
681 
682  int i_lo = vbx.smallEnd(0); int i_hi = vbx.bigEnd(0);
683  int j_lo = vbx.smallEnd(1); int j_hi = vbx.bigEnd(1);
684  int k_lo = vbx.smallEnd(2); int k_hi = vbx.bigEnd(2);
685 
686  const Array4<Real>& mu_turb = eddyViscosity.array(mfi);
687  const Array4<int>& mask_arr = cc_mask.array(mfi);
688 
689  auto domlo = lbound(domain);
690  auto domhi = ubound(domain);
691 
692  ParallelFor(planex_lo, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
693  {
694  int lj = amrex::min(amrex::max(j, domlo.y), domhi.y);
695  int lk = amrex::min(amrex::max(k, domlo.z), domhi.z);
696  if ((mask_arr(i,j,k) == is_notcovered) ||
697  (mask_arr(i,j,k) == is_physbnd && i < domlo.x && impose_phys_bcs)) {
698  for (int n = 0; n < ncomp; n++) {
699  mu_turb(i,j,k,n) = mu_turb(i_lo,lj,lk,n);
700  }
701  }
702  });
703  ParallelFor(planex_hi, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
704  {
705  int lj = amrex::min(amrex::max(j, domlo.y), domhi.y);
706  int lk = amrex::min(amrex::max(k, domlo.z), domhi.z);
707  if ((mask_arr(i,j,k) == is_notcovered) ||
708  (mask_arr(i,j,k) == is_physbnd && i > domhi.x && impose_phys_bcs)) {
709  for (int n = 0; n < ncomp; n++) {
710  mu_turb(i,j,k,n) = mu_turb(i_hi,lj,lk,n);
711  }
712  }
713  });
714  ParallelFor(planey_lo, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
715  {
716  int lk = amrex::min(amrex::max(k, domlo.z), domhi.z);
717  if ((mask_arr(i,j,k) == is_notcovered) ||
718  (mask_arr(i,j,k) == is_physbnd && j < domlo.y && impose_phys_bcs)) {
719  for (int n = 0; n < ncomp; n++) {
720  mu_turb(i,j,k,n) = mu_turb(i,j_lo,lk,n);
721  }
722  }
723  });
724  ParallelFor(planey_hi, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
725  {
726  int lk = amrex::min(amrex::max(k, domlo.z), domhi.z);
727  if ((mask_arr(i,j,k) == is_notcovered) ||
728  (mask_arr(i,j,k) == is_physbnd && j > domhi.y && impose_phys_bcs)) {
729  for (int n = 0; n < ncomp; n++) {
730  mu_turb(i,j,k,n) = mu_turb(i,j_hi,lk,n);
731  }
732  }
733  });
734  ParallelFor(planez_lo, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
735  {
736  if ((mask_arr(i,j,k) == is_notcovered) ||
737  (mask_arr(i,j,k) == is_physbnd && k < domlo.z && impose_phys_bcs)) {
738  if (mask_arr(i,j,k) == is_physbnd) {
739  }
740  for (int n = 0; n < ncomp; n++) {
741  mu_turb(i,j,k,n) = mu_turb(i,j,k_lo,n);
742  }
743  }
744  });
745  ParallelFor(planez_hi, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
746  {
747  if ((mask_arr(i,j,k) == is_notcovered) ||
748  (mask_arr(i,j,k) == is_physbnd && k > domhi.z && impose_phys_bcs)) {
749  for (int n = 0; n < ncomp; n++) {
750  mu_turb(i,j,k,n) = mu_turb(i,j,k_hi,n);
751  }
752  }
753  });
754  } // mfi
755  eddyViscosity.FillBoundary(geom.periodicity());
756  }
757 }
void ComputeDiffusivityMYNN25(const MultiFab &xvel, const MultiFab &yvel, const MultiFab &cons_in, MultiFab &eddyViscosity, const Geometry &geom, const TurbChoice &turbChoice, std::unique_ptr< ABLMost > &most, bool use_terrain_fitted_coords, bool use_moisture, int level, const BCRec *bc_ptr, bool, const std::unique_ptr< MultiFab > &z_phys_nd, const int RhoQv_comp, const int RhoQc_comp, const int RhoQr_comp)
Definition: ERF_ComputeDiffusivityMYNN25.cpp:11
void ComputeDiffusivityMYNNEDMF(const MultiFab &xvel, const MultiFab &yvel, const MultiFab &cons_in, MultiFab &eddyViscosity, const Geometry &geom, const TurbChoice &turbChoice, std::unique_ptr< ABLMost > &most, bool use_terrain_fitted_coords, bool use_moisture, int level, const BCRec *bc_ptr, bool, const std::unique_ptr< MultiFab > &z_phys_nd, const int RhoQv_comp, const int RhoQc_comp, const int RhoQr_comp)
Definition: ERF_ComputeDiffusivityMYNNEDMF.cpp:4177
void ComputeDiffusivityYSU(const MultiFab &xvel, const MultiFab &yvel, const MultiFab &cons_in, MultiFab &eddyViscosity, const Geometry &geom, const TurbChoice &turbChoice, std::unique_ptr< ABLMost > &most, bool use_terrain_fitted_coords, bool, int level, const BCRec *bc_ptr, bool, const std::unique_ptr< MultiFab > &z_phys_nd)
Definition: ERF_ComputeDiffusivityYSU.cpp:11
void ComputeTurbulentViscosityRANS(const MultiFab &, const MultiFab &, const MultiFab &, const MultiFab &, const MultiFab &, const MultiFab &, const MultiFab &cons_in, const MultiFab &wdist, MultiFab &eddyViscosity, MultiFab &Hfx1, MultiFab &Hfx2, MultiFab &Hfx3, MultiFab &Diss, const Geometry &geom, bool use_terrain, const MultiFab &, const MultiFab &, const std::unique_ptr< MultiFab > &z_phys_nd, const TurbChoice &turbChoice, const Real const_grav, std::unique_ptr< ABLMost > &most, const FArrayBox *z_0, const bool &exp_most)
Definition: ERF_ComputeTurbulentViscosity.cpp:310
void ComputeTurbulentViscosity(const MultiFab &xvel, const MultiFab &yvel, const MultiFab &Tau11, const MultiFab &Tau22, const MultiFab &Tau33, const MultiFab &Tau12, const MultiFab &Tau13, const MultiFab &Tau23, const MultiFab &cons_in, const MultiFab &wdist, MultiFab &eddyViscosity, MultiFab &Hfx1, MultiFab &Hfx2, MultiFab &Hfx3, MultiFab &Diss, const Geometry &geom, const MultiFab &mapfac_u, const MultiFab &mapfac_v, const std::unique_ptr< MultiFab > &z_phys_nd, const SolverChoice &solverChoice, std::unique_ptr< ABLMost > &most, const amrex::FArrayBox *z_0, const bool &exp_most, const bool &use_terrain_fitted_coords, const bool &use_moisture, int level, const BCRec *bc_ptr, bool vert_only)
Definition: ERF_ComputeTurbulentViscosity.cpp:542
void ComputeTurbulentViscosityLES(const MultiFab &Tau11, const MultiFab &Tau22, const MultiFab &Tau33, const MultiFab &Tau12, const MultiFab &Tau13, const MultiFab &Tau23, const MultiFab &cons_in, MultiFab &eddyViscosity, MultiFab &Hfx1, MultiFab &Hfx2, MultiFab &Hfx3, MultiFab &Diss, const Geometry &geom, bool use_terrain, const MultiFab &mapfac_u, const MultiFab &mapfac_v, const std::unique_ptr< MultiFab > &z_phys_nd, const TurbChoice &turbChoice, const Real const_grav, std::unique_ptr< ABLMost > &most, const bool &exp_most)
Definition: ERF_ComputeTurbulentViscosity.cpp:32
@ xvel
Definition: ERF_IndexDefines.H:141
@ yvel
Definition: ERF_IndexDefines.H:142
int RhoQr_comp
Definition: ERF_DataStruct.H:783
amrex::Real gravity
Definition: ERF_DataStruct.H:709
int RhoQc_comp
Definition: ERF_DataStruct.H:777
int RhoQv_comp
Definition: ERF_DataStruct.H:776
amrex::Vector< TurbChoice > turbChoice
Definition: ERF_DataStruct.H:676
Definition: ERF_TurbStruct.H:31
PBLType pbl_type
Definition: ERF_TurbStruct.H:240
RANSType rans_type
Definition: ERF_TurbStruct.H:237
LESType les_type
Definition: ERF_TurbStruct.H:204

Referenced by ERF::advance_dycore().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeTurbulentViscosityLES()

void ComputeTurbulentViscosityLES ( const MultiFab &  Tau11,
const MultiFab &  Tau22,
const MultiFab &  Tau33,
const MultiFab &  Tau12,
const MultiFab &  Tau13,
const MultiFab &  Tau23,
const MultiFab &  cons_in,
MultiFab &  eddyViscosity,
MultiFab &  Hfx1,
MultiFab &  Hfx2,
MultiFab &  Hfx3,
MultiFab &  Diss,
const Geometry &  geom,
bool  use_terrain,
const MultiFab &  mapfac_u,
const MultiFab &  mapfac_v,
const std::unique_ptr< MultiFab > &  z_phys_nd,
const TurbChoice turbChoice,
const Real  const_grav,
std::unique_ptr< ABLMost > &  most,
const bool &  exp_most 
)

Function for computing the turbulent viscosity with LES.

Parameters
[in]Tau1111 strain
[in]Tau2222 strain
[in]Tau3333 strain
[in]Tau1212 strain
[in]Tau1313 strain
[in]Tau2323 strain
[in]cons_incell center conserved quantities
[out]eddyViscosityturbulent viscosity
[in]Hfx1heat flux in x-dir
[in]Hfx2heat flux in y-dir
[in]Hfx3heat flux in z-dir
[in]Dissdissipation of turbulent kinetic energy
[in]geomproblem geometry
[in]mapfac_umap factor at x-face
[in]mapfac_vmap factor at y-face
[in]turbChoicecontainer with turbulence parameters
41 {
42  const GpuArray<Real, AMREX_SPACEDIM> cellSizeInv = geom.InvCellSizeArray();
43  const Box& domain = geom.Domain();
44  const int& klo = domain.smallEnd(2);
45  const bool use_most = (most != nullptr);
46 
47  Real inv_Pr_t = turbChoice.Pr_t_inv;
48  Real inv_Sc_t = turbChoice.Sc_t_inv;
49  Real inv_sigma_k = 1.0 / turbChoice.sigma_k;
50 
51  // SMAGORINSKY: Fill Kturb for momentum in horizontal and vertical
52  //***********************************************************************************
53  if (turbChoice.les_type == LESType::Smagorinsky)
54  {
55  Real Cs = turbChoice.Cs;
56 
57 #ifdef _OPENMP
58 #pragma omp parallel if (Gpu::notInLaunchRegion())
59 #endif
60  for (MFIter mfi(eddyViscosity,TilingIfNotGPU()); mfi.isValid(); ++mfi)
61  {
62  // NOTE: This gets us the lateral ghost cells for lev>0; which
63  // have been filled from FP Two Levels.
64  Box bxcc = mfi.growntilebox(1) & domain;
65 
66  const Array4<Real>& mu_turb = eddyViscosity.array(mfi);
67  const Array4<Real>& hfx_x = Hfx1.array(mfi);
68  const Array4<Real>& hfx_y = Hfx2.array(mfi);
69  const Array4<Real>& hfx_z = Hfx3.array(mfi);
70  const Array4<Real const > &cell_data = cons_in.array(mfi);
71 
72  Array4<Real const> tau11 = Tau11.array(mfi);
73  Array4<Real const> tau22 = Tau22.array(mfi);
74  Array4<Real const> tau33 = Tau33.array(mfi);
75  Array4<Real const> tau12 = Tau12.array(mfi);
76  Array4<Real const> tau13 = Tau13.array(mfi);
77  Array4<Real const> tau23 = Tau23.array(mfi);
78 
79  Array4<Real const> mf_u = mapfac_u.array(mfi);
80  Array4<Real const> mf_v = mapfac_v.array(mfi);
81 
82  Array4<Real const> z_nd_arr = z_phys_nd->const_array(mfi);
83 
84  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
85  {
86  Real SmnSmn = ComputeSmnSmn(i,j,k,tau11,tau22,tau33,tau12,tau13,tau23,klo,use_most,exp_most);
87  Real dxInv = cellSizeInv[0];
88  Real dyInv = cellSizeInv[1];
89  Real dzInv = cellSizeInv[2];
90  if (use_terrain) {
91  // the terrain grid is only deformed in z for now
92  dzInv /= Compute_h_zeta_AtCellCenter(i,j,k, cellSizeInv, z_nd_arr);
93  }
94  Real cellVolMsf = 1.0 / (dxInv * mf_u(i,j,0) * dyInv * mf_v(i,j,0) * dzInv);
95  Real DeltaMsf = std::pow(cellVolMsf,1.0/3.0);
96  Real CsDeltaSqrMsf = Cs*Cs*DeltaMsf*DeltaMsf;
97 
98  mu_turb(i, j, k, EddyDiff::Mom_h) = CsDeltaSqrMsf * cell_data(i, j, k, Rho_comp) * std::sqrt(2.0*SmnSmn);
99  mu_turb(i, j, k, EddyDiff::Mom_v) = mu_turb(i, j, k, EddyDiff::Mom_h);
100 
101  // Calculate SFS quantities
102  Real dtheta_dz;
103  if (use_most && k==klo) {
104  if (exp_most) {
105  dtheta_dz = ( cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp)
106  - cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp) )*dzInv;
107  } else {
108  dtheta_dz = 0.5 * (-3 * cell_data(i,j,k ,RhoTheta_comp)
109  / cell_data(i,j,k ,Rho_comp)
110  + 4 * cell_data(i,j,k+1,RhoTheta_comp)
111  / cell_data(i,j,k+1,Rho_comp)
112  - cell_data(i,j,k+2,RhoTheta_comp)
113  / cell_data(i,j,k+2,Rho_comp) ) * dzInv;
114  }
115  } else {
116  dtheta_dz = 0.5 * ( cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp)
117  - cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp) )*dzInv;
118  }
119  // - heat flux
120  // (Note: If using ERF_EXPLICIT_MOST_STRESS, the value at k=0 will
121  // be overwritten when BCs are applied)
122  hfx_x(i,j,k) = 0.0;
123  hfx_y(i,j,k) = 0.0;
124  hfx_z(i,j,k) = -inv_Pr_t*mu_turb(i,j,k,EddyDiff::Mom_v) * dtheta_dz; // (rho*w)' theta' [kg m^-2 s^-1 K]
125  });
126  }
127  }
128  // DEARDORFF: Fill Kturb for momentum in horizontal and vertical
129  //***********************************************************************************
130  else if (turbChoice.les_type == LESType::Deardorff)
131  {
132  const Real l_C_k = turbChoice.Ck;
133  const Real l_C_e = turbChoice.Ce;
134  const Real l_C_e_wall = turbChoice.Ce_wall;
135  const Real Ce_lcoeff = amrex::max(0.0, l_C_e - 1.9*l_C_k);
136  const Real l_abs_g = const_grav;
137  const Real l_inv_theta0 = 1.0 / turbChoice.theta_ref;
138 
139 #ifdef _OPENMP
140 #pragma omp parallel if (Gpu::notInLaunchRegion())
141 #endif
142  for ( MFIter mfi(eddyViscosity,TilingIfNotGPU()); mfi.isValid(); ++mfi)
143  {
144  Box bxcc = mfi.tilebox();
145 
146  const Array4<Real>& mu_turb = eddyViscosity.array(mfi);
147  const Array4<Real>& hfx_x = Hfx1.array(mfi);
148  const Array4<Real>& hfx_y = Hfx2.array(mfi);
149  const Array4<Real>& hfx_z = Hfx3.array(mfi);
150  const Array4<Real>& diss = Diss.array(mfi);
151 
152  const Array4<Real const > &cell_data = cons_in.array(mfi);
153 
154  Array4<Real const> mf_u = mapfac_u.array(mfi);
155  Array4<Real const> mf_v = mapfac_v.array(mfi);
156 
157  Array4<Real const> z_nd_arr = z_phys_nd->const_array(mfi);
158 
159  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
160  {
161  Real dxInv = cellSizeInv[0];
162  Real dyInv = cellSizeInv[1];
163  Real dzInv = cellSizeInv[2];
164  if (use_terrain) {
165  // the terrain grid is only deformed in z for now
166  dzInv /= Compute_h_zeta_AtCellCenter(i,j,k, cellSizeInv, z_nd_arr);
167  }
168  Real cellVolMsf = 1.0 / (dxInv * mf_u(i,j,0) * dyInv * mf_v(i,j,0) * dzInv);
169  Real DeltaMsf = std::pow(cellVolMsf,1.0/3.0);
170 
171  // Calculate stratification-dependent mixing length (Deardorff 1980)
172  Real eps = std::numeric_limits<Real>::epsilon();
173  Real dtheta_dz;
174  if (use_most && k==klo) {
175  if (exp_most) {
176  dtheta_dz = ( cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp)
177  - cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp) )*dzInv;
178  } else {
179  dtheta_dz = 0.5 * (-3 * cell_data(i,j,k ,RhoTheta_comp)
180  / cell_data(i,j,k ,Rho_comp)
181  + 4 * cell_data(i,j,k+1,RhoTheta_comp)
182  / cell_data(i,j,k+1,Rho_comp)
183  - cell_data(i,j,k+2,RhoTheta_comp)
184  / cell_data(i,j,k+2,Rho_comp) ) * dzInv;
185  }
186  } else {
187  dtheta_dz = 0.5 * ( cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp)
188  - cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp) )*dzInv;
189  }
190  Real E = amrex::max(cell_data(i,j,k,RhoKE_comp)/cell_data(i,j,k,Rho_comp),Real(0.0));
191  Real stratification = l_abs_g * dtheta_dz * l_inv_theta0;
192  Real length;
193  if (stratification <= eps) {
194  length = DeltaMsf;
195  } else {
196  length = 0.76 * std::sqrt(E / amrex::max(stratification,eps));
197  // mixing length should be _reduced_ for stable stratification
198  length = amrex::min(length, DeltaMsf);
199  // following WRF, make sure the mixing length isn't too small
200  length = amrex::max(length, 0.001 * DeltaMsf);
201  }
202 
203  // Calculate eddy diffusivities
204  // K = rho * C_k * l * KE^(1/2)
205  mu_turb(i,j,k,EddyDiff::Mom_h) = cell_data(i,j,k,Rho_comp) * l_C_k * length * std::sqrt(E);
206  mu_turb(i,j,k,EddyDiff::Mom_v) = mu_turb(i,j,k,EddyDiff::Mom_h);
207  // KH = (1 + 2*l/delta) * mu_turb
208  mu_turb(i,j,k,EddyDiff::Theta_h) = (1.+2.*length/DeltaMsf) * mu_turb(i,j,k,EddyDiff::Mom_h);
209  mu_turb(i,j,k,EddyDiff::Theta_v) = mu_turb(i,j,k,EddyDiff::Theta_h);
210  // Store lengthscale for TKE source terms
211  mu_turb(i,j,k,EddyDiff::Turb_lengthscale) = length;
212 
213  // Calculate SFS quantities
214  // - dissipation
215  Real Ce;
216  if ((l_C_e_wall > 0) && (k==0)) {
217  Ce = l_C_e_wall;
218  } else {
219  Ce = 1.9*l_C_k + Ce_lcoeff*length / DeltaMsf;
220  }
221  diss(i,j,k) = cell_data(i,j,k,Rho_comp) * Ce * std::pow(E,1.5) / length;
222 
223  // - heat flux
224  // (Note: If using ERF_EXPLICIT_MOST_STRESS, the value at k=0 will
225  // be overwritten when BCs are applied)
226  hfx_x(i,j,k) = 0.0;
227  hfx_y(i,j,k) = 0.0;
228  hfx_z(i,j,k) = -mu_turb(i,j,k,EddyDiff::Theta_v) * dtheta_dz; // (rho*w)' theta' [kg m^-2 s^-1 K]
229  });
230  }
231  }
232 
233  // Extrapolate Kturb in x/y, fill remaining elements (relevant to lev==0)
234  //***********************************************************************************
235  int ngc(1);
236  // EddyDiff mapping : Theta_h KE_h Scalar_h Q_h
237  Vector<Real> Factors = {inv_Pr_t, inv_sigma_k, inv_Sc_t, inv_Sc_t}; // alpha = mu/Pr
238  Gpu::AsyncVector<Real> d_Factors; d_Factors.resize(Factors.size());
239  Gpu::copy(Gpu::hostToDevice, Factors.begin(), Factors.end(), d_Factors.begin());
240  Real* fac_ptr = d_Factors.data();
241 
242  const bool use_KE = ( turbChoice.les_type == LESType::Deardorff );
243 
244 #ifdef _OPENMP
245 #pragma omp parallel if (Gpu::notInLaunchRegion())
246 #endif
247  for ( MFIter mfi(eddyViscosity,TilingIfNotGPU()); mfi.isValid(); ++mfi)
248  {
249  Box bxcc = mfi.tilebox();
250  Box planex = bxcc; planex.setSmall(0, 1); planex.setBig(0, ngc); planex.grow(1,1);
251  Box planey = bxcc; planey.setSmall(1, 1); planey.setBig(1, ngc); planey.grow(0,1);
252  bxcc.growLo(0,ngc); bxcc.growHi(0,ngc);
253  bxcc.growLo(1,ngc); bxcc.growHi(1,ngc);
254 
255  const Array4<Real>& mu_turb = eddyViscosity.array(mfi);
256 
257  for (auto n = 1; n < (EddyDiff::NumDiffs-1)/2; ++n) {
258  int offset = (EddyDiff::NumDiffs-1)/2;
259  switch (n)
260  {
261  case EddyDiff::KE_h:
262  if (use_KE) {
263  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
264  {
265  int indx = n;
266  int indx_v = indx + offset;
267  mu_turb(i,j,k,indx) = mu_turb(i,j,k,EddyDiff::Mom_h) * fac_ptr[indx-1];
268  mu_turb(i,j,k,indx_v) = mu_turb(i,j,k,indx);
269  });
270  }
271  break;
272  default:
273  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
274  {
275  int indx = n;
276  int indx_v = indx + offset;
277 
278  // NOTE: Theta_h, Theta_v have already been set for Deardorff
279  if (!(indx_v == EddyDiff::Theta_v && use_KE)) {
280  mu_turb(i,j,k,indx) = mu_turb(i,j,k,EddyDiff::Mom_h) * fac_ptr[indx-1];
281  mu_turb(i,j,k,indx_v) = mu_turb(i,j,k,indx);
282  }
283  });
284  break;
285  }
286  }
287  }
288 }
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real ComputeSmnSmn(int &i, int &j, int &k, const amrex::Array4< amrex::Real const > &tau11, const amrex::Array4< amrex::Real const > &tau22, const amrex::Array4< amrex::Real const > &tau33, const amrex::Array4< amrex::Real const > &tau12, const amrex::Array4< amrex::Real const > &tau13, const amrex::Array4< amrex::Real const > &tau23, const int &klo, const bool &use_most, const bool &exp_most)
Definition: ERF_EddyViscosity.H:33
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
#define RhoKE_comp
Definition: ERF_IndexDefines.H:38
AMREX_FORCE_INLINE IntVect offset(const int face_dir, const int normal)
Definition: ERF_ReadBndryPlanes.cpp:28
AMREX_FORCE_INLINE AMREX_GPU_DEVICE amrex::Real Compute_h_zeta_AtCellCenter(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:46
@ Theta_v
Definition: ERF_IndexDefines.H:168
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:172
@ Mom_h
Definition: ERF_IndexDefines.H:162
@ Mom_v
Definition: ERF_IndexDefines.H:167
@ NumDiffs
Definition: ERF_IndexDefines.H:173
@ Theta_h
Definition: ERF_IndexDefines.H:163
@ KE_h
Definition: ERF_IndexDefines.H:164
amrex::Real sigma_k
Definition: ERF_TurbStruct.H:231
amrex::Real Sc_t_inv
Definition: ERF_TurbStruct.H:212
amrex::Real Ck
Definition: ERF_TurbStruct.H:220
amrex::Real Cs
Definition: ERF_TurbStruct.H:215
amrex::Real Pr_t_inv
Definition: ERF_TurbStruct.H:208
amrex::Real Ce_wall
Definition: ERF_TurbStruct.H:219
amrex::Real Ce
Definition: ERF_TurbStruct.H:218
amrex::Real theta_ref
Definition: ERF_TurbStruct.H:234

Referenced by ComputeTurbulentViscosity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeTurbulentViscosityRANS()

void ComputeTurbulentViscosityRANS ( const MultiFab &  ,
const MultiFab &  ,
const MultiFab &  ,
const MultiFab &  ,
const MultiFab &  ,
const MultiFab &  ,
const MultiFab &  cons_in,
const MultiFab &  wdist,
MultiFab &  eddyViscosity,
MultiFab &  Hfx1,
MultiFab &  Hfx2,
MultiFab &  Hfx3,
MultiFab &  Diss,
const Geometry &  geom,
bool  use_terrain,
const MultiFab &  ,
const MultiFab &  ,
const std::unique_ptr< MultiFab > &  z_phys_nd,
const TurbChoice turbChoice,
const Real  const_grav,
std::unique_ptr< ABLMost > &  most,
const FArrayBox *  z_0,
const bool &  exp_most 
)

Function for computing the eddy viscosity with RANS.

Parameters
[in]Tau1111 strain
[in]Tau2222 strain
[in]Tau3333 strain
[in]Tau1212 strain
[in]Tau1313 strain
[in]Tau2323 strain
[in]cons_incell center conserved quantities
[out]eddyViscosityturbulent viscosity
[in]Hfx1heat flux in x-dir
[in]Hfx2heat flux in y-dir
[in]Hfx3heat flux in z-dir
[in]Dissdissipation of turbulent kinetic energy
[in]geomproblem geometry
[in]mapfac_umap factor at x-face
[in]mapfac_vmap factor at y-face
[in]turbChoicecontainer with turbulence parameters
320 {
321  const GpuArray<Real, AMREX_SPACEDIM> cellSizeInv = geom.InvCellSizeArray();
322  const Box& domain = geom.Domain();
323  const int& klo = domain.smallEnd(2);
324  const bool use_most = (most != nullptr);
325 
326  Real inv_Pr_t = turbChoice.Pr_t_inv;
327  Real inv_Sc_t = turbChoice.Sc_t_inv;
328  Real inv_sigma_k = 1.0 / turbChoice.sigma_k;
329 
330  // One-Equation k model (Axell & Liungman 2001, Environ Fluid Mech)
331  //***********************************************************************************
332  if (turbChoice.rans_type == RANSType::kEqn)
333  {
334  const Real Cmu0 = turbChoice.Cmu0;
335  const Real Cmu0_pow3 = Cmu0 * Cmu0 * Cmu0;
336  const Real inv_Cb_sq = 1.0 / (turbChoice.Cb * turbChoice.Cb);
337  const Real Rt_crit = turbChoice.Rt_crit;
338  const Real Rt_min = turbChoice.Rt_min;
339  const Real l_g_max = turbChoice.l_g_max;
340 
341  const Real abs_g = const_grav;
342  const Real inv_theta0 = 1.0 / turbChoice.theta_ref;
343 
344 #ifdef _OPENMP
345 #pragma omp parallel if (Gpu::notInLaunchRegion())
346 #endif
347  for ( MFIter mfi(eddyViscosity,TilingIfNotGPU()); mfi.isValid(); ++mfi)
348  {
349  Box bxcc = mfi.tilebox();
350 
351  const Array4<Real const>& d_arr = wdist.const_array(mfi);
352  const Array4<Real const>& z0_arr = (use_most) ? z_0->const_array() : Array4<Real const>{};
353 
354  const Array4<Real>& mu_turb = eddyViscosity.array(mfi);
355  const Array4<Real>& hfx_x = Hfx1.array(mfi);
356  const Array4<Real>& hfx_y = Hfx2.array(mfi);
357  const Array4<Real>& hfx_z = Hfx3.array(mfi);
358  const Array4<Real>& diss = Diss.array(mfi);
359 
360  const Array4<Real const>& cell_data = cons_in.array(mfi);
361 
362  const Array4<Real const>& z_nd_arr = z_phys_nd->const_array(mfi);
363 
364  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
365  {
366  Real eps = std::numeric_limits<Real>::epsilon();
367  Real tke = amrex::max(cell_data(i,j,k,RhoKE_comp)/cell_data(i,j,k,Rho_comp), eps);
368 
369  // Estimate stratification
370  Real dtheta_dz;
371  Real dzInv = cellSizeInv[2];
372  if (use_terrain) {
373  // the terrain grid is only deformed in z for now
374  dzInv /= Compute_h_zeta_AtCellCenter(i,j,k, cellSizeInv, z_nd_arr);
375  }
376  if (use_most && k==klo) {
377  if (exp_most) {
378  dtheta_dz = ( cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp)
379  - cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp) )*dzInv;
380  } else {
381  dtheta_dz = 0.5 * (-3 * cell_data(i,j,k ,RhoTheta_comp)
382  / cell_data(i,j,k ,Rho_comp)
383  + 4 * cell_data(i,j,k+1,RhoTheta_comp)
384  / cell_data(i,j,k+1,Rho_comp)
385  - cell_data(i,j,k+2,RhoTheta_comp)
386  / cell_data(i,j,k+2,Rho_comp) ) * dzInv;
387  }
388  } else {
389  dtheta_dz = 0.5 * ( cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp)
390  - cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp) )*dzInv;
391  }
392  Real N2 = abs_g * inv_theta0 * dtheta_dz; // Brunt–Väisälä frequency squared
393 
394  // Geometric length scale (AL01, Eqn. 22)
395  Real l_g = (z0_arr) ? KAPPA * (d_arr(i, j, k) + z0_arr(i, j, 0))
396  : KAPPA * d_arr(i, j, k);
397 
398  // Enforce a maximum value
399  l_g = l_g_max * l_g / (l_g_max + l_g);
400 
401  // Turbulent Richardson number (AL01, Eqn. 29)
402  // using the old dissipation value
403  Real diss0 = max(diss(i, j, k) / cell_data(i, j, k, Rho_comp),
404  eps);
405  Real Rt = tke*tke * N2 / diss0;
406 
407  // Turbulent length scale
408  Real length;
409  if (std::abs(N2) <= eps) {
410  length = l_g;
411  } else if (N2 > eps) {
412  // Stable (AL01, Eqn. 26)
413  length = std::sqrt(1.0 /
414  (1.0 / (l_g * l_g) + inv_Cb_sq * N2 / tke));
415  } else {
416  // Unstable (AL01, Eqn. 28)
417  length = l_g * std::sqrt(1.0 - Cmu0_pow3*Cmu0_pow3 * inv_Cb_sq * Rt);
418  }
419  mu_turb(i, j, k, EddyDiff::Turb_lengthscale) = length;
420 
421  // Burchard & Petersen smoothing function
422  Rt = (Rt >= Rt_crit) ? Rt
423  : std::max(Rt,
424  Rt - std::pow(Rt - Rt_crit, 2) /
425  (Rt + Rt_min - 2*Rt_crit));
426 
427  // Stability functions
428  // Note: These use the smoothed turbulent Richardson number
429  Real cmu = (Cmu0 + 0.108*Rt)
430  / (1.0 + 0.308*Rt + 0.00837*Rt*Rt); // (AL01, Eqn. 31)
431  Real cmu_prime = Cmu0 / (1 + 0.277*Rt); // (AL01, Eqn. 32)
432 
433  // Calculate eddy diffusivities
434  // K = rho * nu_t = rho * c_mu * tke^(1/2) * length
435  Real nut = cmu * std::sqrt(tke) * length; // eddy viscosity
436  Real nut_prime = cmu_prime / cmu * nut; // eddy diffusivity
437  mu_turb(i, j, k, EddyDiff::Mom_h) = cell_data(i, j, k, Rho_comp) * nut;
438  mu_turb(i, j, k, EddyDiff::Mom_v) = mu_turb(i, j, k, EddyDiff::Mom_h);
439  mu_turb(i, j, k, EddyDiff::Theta_v) = cell_data(i, j, k, Rho_comp) * nut_prime;
440 
441  // Calculate SFS quantities
442  // - dissipation (AL01 Eqn. 19)
443  diss(i, j, k) = cell_data(i, j, k, Rho_comp) * Cmu0_pow3 * std::pow(tke,1.5) / length;
444 
445  // - heat flux
446  // (Note: If using ERF_EXPLICIT_MOST_STRESS, the value at k=0 will
447  // be overwritten when BCs are applied)
448  hfx_x(i, j, k) = 0.0;
449  hfx_y(i, j, k) = 0.0;
450  // Note: buoyant production = g/theta0 * hfx == -nut_prime * N^2 (c.f. AL01 Eqn. 15)
451  // = nut_prime * g/theta0 * dtheta/dz
452  // ==> hfx = nut_prime * dtheta/dz
453  // Our convention is such that dtheta/dz < 0 gives a positive
454  // (upward) heat flux.
455  hfx_z(i, j, k) = -mu_turb(i, j, k, EddyDiff::Theta_v) * dtheta_dz; // (rho*w)' theta' [kg m^-2 s^-1 K]
456  });
457  }
458  }
459 
460  // Extrapolate Kturb in x/y, fill remaining elements (relevant to lev==0)
461  //***********************************************************************************
462  int ngc(1);
463  // EddyDiff mapping : Theta_h KE_h Scalar_h Q_h
464  Vector<Real> Factors = {inv_Pr_t, inv_sigma_k, inv_Sc_t, inv_Sc_t}; // alpha = mu/Pr
465  Gpu::AsyncVector<Real> d_Factors; d_Factors.resize(Factors.size());
466  Gpu::copy(Gpu::hostToDevice, Factors.begin(), Factors.end(), d_Factors.begin());
467  Real* fac_ptr = d_Factors.data();
468 
469  const bool use_KE = ( turbChoice.rans_type == RANSType::kEqn );
470 
471 #ifdef _OPENMP
472 #pragma omp parallel if (Gpu::notInLaunchRegion())
473 #endif
474  for ( MFIter mfi(eddyViscosity,TilingIfNotGPU()); mfi.isValid(); ++mfi)
475  {
476  Box bxcc = mfi.tilebox();
477  Box planex = bxcc; planex.setSmall(0, 1); planex.setBig(0, ngc); planex.grow(1,1);
478  Box planey = bxcc; planey.setSmall(1, 1); planey.setBig(1, ngc); planey.grow(0,1);
479  bxcc.growLo(0,ngc); bxcc.growHi(0,ngc);
480  bxcc.growLo(1,ngc); bxcc.growHi(1,ngc);
481 
482  const Array4<Real>& mu_turb = eddyViscosity.array(mfi);
483 
484  for (auto n = 1; n < (EddyDiff::NumDiffs-1)/2; ++n) {
485  int offset = (EddyDiff::NumDiffs-1)/2;
486  switch (n)
487  {
488  case EddyDiff::KE_h:
489  if (use_KE) {
490  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
491  {
492  int indx = n;
493  int indx_v = indx + offset;
494  mu_turb(i,j,k,indx) = mu_turb(i,j,k,EddyDiff::Mom_h) * fac_ptr[indx-1];
495  mu_turb(i,j,k,indx_v) = mu_turb(i,j,k,indx);
496  });
497  }
498  break;
499  default:
500  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
501  {
502  int indx = n;
503  int indx_v = indx + offset;
504 
505  mu_turb(i,j,k,indx) = mu_turb(i,j,k,EddyDiff::Mom_h) * fac_ptr[indx-1];
506 
507  // NOTE: Theta_v has already been set for Deardorff
508  if (!(indx_v == EddyDiff::Theta_v && use_KE)) {
509  mu_turb(i,j,k,indx_v) = mu_turb(i,j,k,indx);
510  }
511  });
512  break;
513  }
514  }
515  }
516 }
constexpr amrex::Real KAPPA
Definition: ERF_Constants.H:20
amrex::Real Rt_min
Definition: ERF_TurbStruct.H:226
amrex::Real Cmu0
Definition: ERF_TurbStruct.H:223
amrex::Real Cb
Definition: ERF_TurbStruct.H:224
amrex::Real Rt_crit
Definition: ERF_TurbStruct.H:225
amrex::Real l_g_max
Definition: ERF_TurbStruct.H:227

Referenced by ComputeTurbulentViscosity().

Here is the call graph for this function:
Here is the caller graph for this function: