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
2764  : theta_z0{l_theta_z0}, qsat_z0{l_qsat_z0} {}
amrex::Real qsat_z0
Definition: ERF_MOSTStress.H:2926
amrex::Real theta_z0
Definition: ERF_MOSTStress.H:2925

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.
2790  {
2791  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2792  amrex::Real qstar = q_star_arr(i,j,0);
2793  amrex::Real q = cons_arr(i, j, k, RhoQ1_comp) / rho;
2794 
2795  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2796  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2797  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2798 
2799  // NOTE: this is rho*<q'w'> = -K dqdz
2800  amrex::Real moflux = (std::abs(qstar) > eps) ? - rho * qstar * wsp * (q - qsat_z0) : zero;
2801 
2802  return moflux;
2803  }
#define Rho_comp
Definition: ERF_IndexDefines.H:39
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:29
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:34
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ rho
Definition: ERF_Kessler.H:25
@ q
Definition: ERF_WSM6.H:273
const amrex::Real eps
Definition: ERF_MOSTStress.H:2923

◆ 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.
2828  {
2829  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2830  amrex::Real tstar = t_star_arr(i, j, 0);
2831  amrex::Real theta = cons_arr(i, j, k, RhoTheta_comp) / rho;
2832 
2833  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2834  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2835  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2836 
2837  // NOTE: this is rho*<T'w'> = -K dTdz
2838  amrex::Real moflux = (std::abs(tstar) > eps) ? - rho * tstar * wsp * (theta - theta_z0) : zero;
2839 
2840  return moflux;
2841  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:40
@ theta
Definition: ERF_SLM.H:19

◆ 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.
2866  {
2867  amrex::Real velx = velx_arr(i,j,k);
2868  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2869  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2870  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2871 
2872  amrex::Real ustar = myhalf * ( u_star_arr(i-1,j,0) + u_star_arr(i,j,0) );
2873  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2874 
2875  // NOTE: this is rho*<u'w'> = -K dudz
2876  amrex::Real stressx = -rho * ustar * wsp * velx;
2877 
2878  return stressx;
2879  }
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:35

◆ 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.
2904  {
2905  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2906  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2907  amrex::Real vely = vely_arr(i,j,k);
2908  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2909 
2910  amrex::Real ustar = myhalf * ( u_star_arr(i,j-1,0) + u_star_arr(i,j,0) );
2911  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2912 
2913  // NOTE: this is rho*<v'w'> = -K dvdz
2914  amrex::Real stressy = -rho * ustar * wsp * vely;
2915 
2916  return stressy;
2917  }

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: