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

#include <ERF_MOSTStress.H>

Collaboration diagram for rico_flux:

Public Member Functions

 rico_flux (amrex::Real l_theta_z0, amrex::Real l_qsat_z0)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_q_flux (const int &i, const int &j, const int &k, const int &, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, const amrex::Array4< const amrex::Real > &vely_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &q_star_arr, const amrex::Array4< const amrex::Real > &) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_t_flux (const int &i, const int &j, const int &k, const int &, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, const amrex::Array4< const amrex::Real > &vely_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &t_star_arr, const amrex::Array4< const amrex::Real > &) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_u_flux (const int &i, const int &j, const int &k, const int &, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, const amrex::Array4< const amrex::Real > &vely_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &u_star_arr) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_v_flux (const int &i, const int &j, const int &k, const int &, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, const amrex::Array4< const amrex::Real > &vely_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &u_star_arr) const
 

Private Attributes

const amrex::Real eps = amrex::Real(1e-15)
 
amrex::Real theta_z0 = amrex::Real(298.0)
 
amrex::Real qsat_z0 = amrex::Real(0.0010)
 

Detailed Description

RICO flux formulation

Constructor & Destructor Documentation

◆ rico_flux()

rico_flux::rico_flux ( amrex::Real  l_theta_z0,
amrex::Real  l_qsat_z0 
)
inline

Construct the RICO flux calculator.

Parameters
[in]l_theta_z0surface reference potential temperature
[in]l_qsat_z0surface saturation specific humidity
2781  : theta_z0{l_theta_z0}, qsat_z0{l_qsat_z0} {}
amrex::Real qsat_z0
Definition: ERF_MOSTStress.H:2943
amrex::Real theta_z0
Definition: ERF_MOSTStress.H:2942

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rico_flux::compute_q_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  ,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
const amrex::Array4< const amrex::Real > &  vely_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  q_star_arr,
const amrex::Array4< const amrex::Real > &   
) const
inline

Compute moisture flux for one surface point.

Calling sequence
i, j, k, cons_arr, velx_arr, vely_arr, umm_arr, qvm_arr, u_star_arr, q_star_arr, q_surf_arr.
2807  {
2808  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2809  amrex::Real qstar = q_star_arr(i,j,0);
2810  amrex::Real q = cons_arr(i, j, k, RhoQ1_comp) / rho;
2811 
2812  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2813  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2814  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2815 
2816  // NOTE: this is rho*<q'w'> = -K dqdz
2817  amrex::Real moflux = (std::abs(qstar) > eps) ? - rho * qstar * wsp * (q - qsat_z0) : zero;
2818 
2819  return moflux;
2820  }
#define Rho_comp
Definition: ERF_IndexDefines.H:53
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:66
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ qstar
Definition: ERF_SLM.H:30
@ rho
Definition: ERF_Kessler.H:25
@ q
Definition: ERF_WSM6.H:294
const amrex::Real eps
Definition: ERF_MOSTStress.H:2940

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rico_flux::compute_t_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  ,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
const amrex::Array4< const amrex::Real > &  vely_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  t_star_arr,
const amrex::Array4< const amrex::Real > &   
) const
inline

Compute heat flux for one surface point.

Calling sequence
i, j, k, cons_arr, velx_arr, vely_arr, umm_arr, tm_arr, u_star_arr, t_star_arr, t_surf_arr.
2845  {
2846  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2847  amrex::Real tstar = t_star_arr(i, j, 0);
2848  amrex::Real theta = cons_arr(i, j, k, RhoTheta_comp) / rho;
2849 
2850  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2851  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2852  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2853 
2854  // NOTE: this is rho*<T'w'> = -K dTdz
2855  amrex::Real moflux = (std::abs(tstar) > eps) ? - rho * tstar * wsp * (theta - theta_z0) : zero;
2856 
2857  return moflux;
2858  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:54
@ tstar
Definition: ERF_SLM.H:29
@ theta
Definition: ERF_Kessler.H:26

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rico_flux::compute_u_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  ,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
const amrex::Array4< const amrex::Real > &  vely_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  u_star_arr 
) const
inline

Compute x-momentum flux for one surface face.

Calling sequence
i, j, k, cons_arr, velx_arr, vely_arr, umm_arr, um_arr, u_star_arr.
2883  {
2884  amrex::Real velx = velx_arr(i,j,k);
2885  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2886  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2887  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2888 
2889  amrex::Real ustar = myhalf * ( u_star_arr(i-1,j,0) + u_star_arr(i,j,0) );
2890  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2891 
2892  // NOTE: this is rho*<u'w'> = -K dudz
2893  amrex::Real stressx = -rho * ustar * wsp * velx;
2894 
2895  return stressx;
2896  }
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:42
@ ustar
Definition: ERF_SLM.H:28

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rico_flux::compute_v_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  ,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
const amrex::Array4< const amrex::Real > &  vely_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  u_star_arr 
) const
inline

Compute y-momentum flux for one surface face.

Calling sequence
i, j, k, cons_arr, velx_arr, vely_arr, umm_arr, vm_arr, u_star_arr.
2921  {
2922  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2923  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2924  amrex::Real vely = vely_arr(i,j,k);
2925  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2926 
2927  amrex::Real ustar = myhalf * ( u_star_arr(i,j-1,0) + u_star_arr(i,j,0) );
2928  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2929 
2930  // NOTE: this is rho*<v'w'> = -K dvdz
2931  amrex::Real stressy = -rho * ustar * wsp * vely;
2932 
2933  return stressy;
2934  }

Member Data Documentation

◆ eps

const amrex::Real rico_flux::eps = amrex::Real(1e-15)
private

Referenced by compute_q_flux(), and compute_t_flux().

◆ qsat_z0

amrex::Real rico_flux::qsat_z0 = amrex::Real(0.0010)
private

Referenced by compute_q_flux().

◆ theta_z0

amrex::Real rico_flux::theta_z0 = amrex::Real(298.0)
private

Referenced by compute_t_flux().


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