ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
surface_temp_wave_coupled Struct Reference

#include <ERF_MOSTStress.H>

Collaboration diagram for surface_temp_wave_coupled:

Public Member Functions

 surface_temp_wave_coupled (amrex::Real zref, amrex::Real flux)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void iterate_flux (const int &i, const int &j, const int &k, const int &max_iters, const amrex::Array4< amrex::Real > &z0_arr, const amrex::Array4< const amrex::Real > &umm_arr, const amrex::Array4< const amrex::Real > &tm_arr, const amrex::Array4< const amrex::Real > &tvm_arr, const amrex::Array4< const amrex::Real > &qvm_arr, const amrex::Array4< amrex::Real > &u_star_arr, const amrex::Array4< amrex::Real > &w_star_arr, const amrex::Array4< amrex::Real > &t_star_arr, const amrex::Array4< amrex::Real > &q_star_arr, const amrex::Array4< amrex::Real > &t_surf_arr, const amrex::Array4< amrex::Real > &olen_arr, const amrex::Array4< amrex::Real > &pblh_arr, const amrex::Array4< amrex::Real > &Hwave_arr, const amrex::Array4< amrex::Real > &Lwave_arr, const amrex::Array4< amrex::Real > &eta_arr) const
 

Private Attributes

most_data mdata
 
similarity_funs sfuns
 
const amrex::Real tol = 1.0e-5
 
const amrex::Real eps = 1e-15
 
const amrex::Real z0_eps = 1.0e-6
 
const amrex::Real z0_max = 0.1
 
const amrex::Real WSMIN = 0.1
 

Detailed Description

Surface temperature with wave-coupled roughness

Constructor & Destructor Documentation

◆ surface_temp_wave_coupled()

surface_temp_wave_coupled::surface_temp_wave_coupled ( amrex::Real  zref,
amrex::Real  flux 
)
inline
1170  {
1171  mdata.zref = zref;
1172  mdata.surf_temp_flux = flux;
1173  }
amrex::Real zref
Reference height (m)
Definition: ERF_MOSTStress.H:15
amrex::Real surf_temp_flux
Heat flux.
Definition: ERF_MOSTStress.H:19
most_data mdata
Definition: ERF_MOSTStress.H:1245

Member Function Documentation

◆ iterate_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void surface_temp_wave_coupled::iterate_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  max_iters,
const amrex::Array4< amrex::Real > &  z0_arr,
const amrex::Array4< const amrex::Real > &  umm_arr,
const amrex::Array4< const amrex::Real > &  tm_arr,
const amrex::Array4< const amrex::Real > &  tvm_arr,
const amrex::Array4< const amrex::Real > &  qvm_arr,
const amrex::Array4< amrex::Real > &  u_star_arr,
const amrex::Array4< amrex::Real > &  w_star_arr,
const amrex::Array4< amrex::Real > &  t_star_arr,
const amrex::Array4< amrex::Real > &  q_star_arr,
const amrex::Array4< amrex::Real > &  t_surf_arr,
const amrex::Array4< amrex::Real > &  olen_arr,
const amrex::Array4< amrex::Real > &  pblh_arr,
const amrex::Array4< amrex::Real > &  Hwave_arr,
const amrex::Array4< amrex::Real > &  Lwave_arr,
const amrex::Array4< amrex::Real > &  eta_arr 
) const
inline
1197  {
1198  int iter = 0;
1199  amrex::Real ustar = 0.0;
1200  amrex::Real wstar = 0.0;
1201  amrex::Real z0 = 0.0;
1202  amrex::Real tflux = 0.0;
1203  amrex::Real zeta = 0.0;
1204  amrex::Real psi_m = 0.0;
1205  amrex::Real psi_h = 0.0;
1206  amrex::Real Olen = 0.0;
1207  int ie, je;
1208  ie = i < lbound(eta_arr).x ? lbound(eta_arr).x : i;
1209  je = j < lbound(eta_arr).y ? lbound(eta_arr).y : j;
1210  ie = ie > ubound(eta_arr).x ? ubound(eta_arr).x : ie;
1211  je = je > ubound(eta_arr).y ? ubound(eta_arr).y : je;
1212  amrex::Real umm = std::max(umm_arr(i,j,k), WSMIN);
1213  u_star_arr(i,j,k) = mdata.kappa * umm / std::log(mdata.zref / z0_arr(i,j,k));
1214  do {
1215  ustar = u_star_arr(i,j,k);
1216  z0 = std::min( std::max(1200.0 * Hwave_arr(i,j,k) * std::pow( Hwave_arr(i,j,k)/(Lwave_arr(i,j,k)+eps), 4.5 )
1217  + 0.11 * eta_arr(ie,je,k,EddyDiff::Mom_v) / ustar, z0_eps), z0_max );
1218  tflux = -(tm_arr(i,j,k) - t_surf_arr(i,j,k)) * ustar * mdata.kappa /
1219  (std::log(mdata.zref / z0) - psi_h); // <w'T'>
1220  tflux *= (1 + 0.61*qvm_arr(i,j,k));
1221  tflux += 0.61*tm_arr(i,j,k) * -ustar*q_star_arr(i,j,k); // ~= <w'Tv'>
1222  if (w_star_arr) {
1223  // update w* and Umagmean
1224  w_star_arr(i,j,k) = calc_wstar(tflux, pblh_arr(i,j,k), tvm_arr(i,j,k));
1225  wstar = mdata.Bjr_beta * w_star_arr(i,j,k);
1226  umm = std::sqrt(umm_arr(i,j,k)*umm_arr(i,j,k) + wstar*wstar);
1227  umm = std::max(umm, WSMIN);
1228  }
1229  Olen = -ustar * ustar * ustar * tvm_arr(i,j,k) / (mdata.kappa * mdata.gravity * tflux);
1230  zeta = mdata.zref / Olen;
1231  psi_m = sfuns.calc_psi_m(zeta);
1232  psi_h = sfuns.calc_psi_h(zeta);
1233  u_star_arr(i,j,k) = mdata.kappa * umm / (std::log(mdata.zref / z0) - psi_m);
1234  ++iter;
1235  } while ((std::abs(u_star_arr(i,j,k) - ustar) > tol) && iter <= max_iters);
1236  AMREX_ASSERT_WITH_MESSAGE(iter < max_iters, "Maximum number of MOST iterations reached.");
1237 
1238  t_star_arr(i,j,k) = mdata.kappa * (tm_arr(i,j,k) - t_surf_arr(i,j,k)) /
1239  (std::log(mdata.zref / z0) - psi_h);
1240  olen_arr(i,j,k) = Olen;
1241  z0_arr(i,j,k) = z0;
1242  }
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real calc_wstar(const amrex::Real &ust, const amrex::Real &tst, const amrex::Real &qst, const amrex::Real &pblh, const amrex::Real &th, const amrex::Real &thv, const amrex::Real &qv=0.0)
Definition: ERF_Wstar.H:13
@ Mom_v
Definition: ERF_IndexDefines.H:156
amrex::Real kappa
von Karman constant
Definition: ERF_MOSTStress.H:17
amrex::Real gravity
Acceleration due to gravity (m/s^2)
Definition: ERF_MOSTStress.H:18
const amrex::Real Bjr_beta
Definition: ERF_MOSTStress.H:28
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_m(amrex::Real zeta) const
Definition: ERF_MOSTStress.H:40
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_h(amrex::Real zeta) const
Definition: ERF_MOSTStress.H:54
const amrex::Real eps
Definition: ERF_MOSTStress.H:1248
const amrex::Real tol
Definition: ERF_MOSTStress.H:1247
const amrex::Real z0_eps
Definition: ERF_MOSTStress.H:1249
similarity_funs sfuns
Definition: ERF_MOSTStress.H:1246
const amrex::Real z0_max
Definition: ERF_MOSTStress.H:1250
const amrex::Real WSMIN
Definition: ERF_MOSTStress.H:1251
Here is the call graph for this function:

Member Data Documentation

◆ eps

const amrex::Real surface_temp_wave_coupled::eps = 1e-15
private

Referenced by iterate_flux().

◆ mdata

most_data surface_temp_wave_coupled::mdata
private

◆ sfuns

similarity_funs surface_temp_wave_coupled::sfuns
private

Referenced by iterate_flux().

◆ tol

const amrex::Real surface_temp_wave_coupled::tol = 1.0e-5
private

Referenced by iterate_flux().

◆ WSMIN

const amrex::Real surface_temp_wave_coupled::WSMIN = 0.1
private

Referenced by iterate_flux().

◆ z0_eps

const amrex::Real surface_temp_wave_coupled::z0_eps = 1.0e-6
private

Referenced by iterate_flux().

◆ z0_max

const amrex::Real surface_temp_wave_coupled::z0_max = 0.1
private

Referenced by iterate_flux().


The documentation for this struct was generated from the following file: