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

#include <ERF_MOSTStress.H>

Collaboration diagram for adiabatic_charnock:

Public Member Functions

 adiabatic_charnock (amrex::Real zref, amrex::Real flux, amrex::Real cnk_a, bool cnk_visc)
 
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 > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< amrex::Real > &u_star_arr, const amrex::Array4< amrex::Real > &, const amrex::Array4< amrex::Real > &t_star_arr, const amrex::Array4< amrex::Real > &, const amrex::Array4< amrex::Real > &, const amrex::Array4< amrex::Real > &olen_arr, const amrex::Array4< amrex::Real > &, const amrex::Array4< amrex::Real > &, const amrex::Array4< amrex::Real > &, const amrex::Array4< amrex::Real > &) const
 

Private Attributes

most_data mdata
 
similarity_funs sfuns
 
const amrex::Real tol = 1.0e-5
 
const amrex::Real WSMIN = 0.1
 

Detailed Description

Adiabatic with charnock roughness

Constructor & Destructor Documentation

◆ adiabatic_charnock()

adiabatic_charnock::adiabatic_charnock ( amrex::Real  zref,
amrex::Real  flux,
amrex::Real  cnk_a,
bool  cnk_visc 
)
inline
141  {
142  mdata.zref = zref;
143  mdata.surf_temp_flux = flux;
144  mdata.Cnk_a = cnk_a;
145  mdata.visc = cnk_visc;
146  }
most_data mdata
Definition: ERF_MOSTStress.H:196
amrex::Real zref
Reference height (m)
Definition: ERF_MOSTStress.H:15
amrex::Real Cnk_a
Standard Charnock constant https://doi.org/10.1175/JAMC-D-17-0137.1.
Definition: ERF_MOSTStress.H:21
bool visc
Use viscous Charnock formulation.
Definition: ERF_MOSTStress.H:26
amrex::Real surf_temp_flux
Heat flux.
Definition: ERF_MOSTStress.H:19

Member Function Documentation

◆ iterate_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void adiabatic_charnock::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 > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< amrex::Real > &  u_star_arr,
const amrex::Array4< amrex::Real > &  ,
const amrex::Array4< amrex::Real > &  t_star_arr,
const amrex::Array4< amrex::Real > &  ,
const amrex::Array4< amrex::Real > &  ,
const amrex::Array4< amrex::Real > &  olen_arr,
const amrex::Array4< amrex::Real > &  ,
const amrex::Array4< amrex::Real > &  ,
const amrex::Array4< amrex::Real > &  ,
const amrex::Array4< amrex::Real > &   
) const
inline
170  {
171  int iter = 0;
172  amrex::Real umm = std::max(umm_arr(i,j,k), WSMIN);
173  amrex::Real ustar = 0.0;
174  amrex::Real z0 = 0.0;
175  u_star_arr(i,j,k) = mdata.kappa * umm / std::log(mdata.zref / z0_arr(i,j,k));
176  do {
177  ustar = u_star_arr(i,j,k);
178  if (mdata.Cnk_a > 0) {
179  z0 = (mdata.Cnk_a / mdata.gravity) * ustar * ustar;
180  if (mdata.visc) {
181  z0 += air_viscosity(tm_arr(i,j,k)) / std::max(ustar, 0.05);
182  }
183  } else {
184  z0 = COARE3_roughness(mdata.zref, umm, ustar);
185  }
186  u_star_arr(i,j,k) = mdata.kappa * umm / std::log(mdata.zref / z0);
187  ++iter;
188  } while ((std::abs(u_star_arr(i,j,k) - ustar) > tol) && iter <= max_iters);
189 
190  t_star_arr(i,j,k) = 0.0;
191  olen_arr(i,j,k) = 1.0e16;
192  z0_arr(i,j,k) = z0;
193  }
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real COARE3_roughness(amrex::Real zref, amrex::Real umm, amrex::Real ustar)
Definition: ERF_MOSTRoughness.H:9
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real air_viscosity(amrex::Real T_degK)
Definition: ERF_MOSTStress.H:79
const amrex::Real WSMIN
Definition: ERF_MOSTStress.H:199
const amrex::Real tol
Definition: ERF_MOSTStress.H:198
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
Here is the call graph for this function:

Member Data Documentation

◆ mdata

most_data adiabatic_charnock::mdata
private

Referenced by adiabatic_charnock(), and iterate_flux().

◆ sfuns

similarity_funs adiabatic_charnock::sfuns
private

◆ tol

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

Referenced by iterate_flux().

◆ WSMIN

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

Referenced by iterate_flux().


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