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 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 > &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 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 > &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 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 > &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 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 > &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
2330  : theta_z0{l_theta_z0}, qsat_z0{l_qsat_z0} {}
amrex::Real qsat_z0
Definition: ERF_MOSTStress.H:2452
amrex::Real theta_z0
Definition: ERF_MOSTStress.H:2451

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 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 > &  q_star_arr,
const amrex::Array4< const amrex::Real > &   
) const
inline
2347  {
2348  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2349  amrex::Real qstar = q_star_arr(i,j,0);
2350  amrex::Real q = cons_arr(i, j, k, RhoQ1_comp) / rho;
2351 
2352  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2353  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2354  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2355 
2356  // NOTE: this is rho*<q'w'> = -K dqdz
2357  amrex::Real moflux = (std::abs(qstar) > eps) ? - rho * qstar * wsp * (q - qsat_z0) : zero;
2358 
2359  return moflux;
2360  }
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
rho
Definition: ERF_InitCustomPert_Bubble.H:106
amrex::Real Real
Definition: ERF_ShocInterface.H:19
const amrex::Real eps
Definition: ERF_MOSTStress.H:2449

◆ 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 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 > &  t_star_arr,
const amrex::Array4< const amrex::Real > &   
) const
inline
2376  {
2377  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2378  amrex::Real tstar = t_star_arr(i, j, 0);
2379  amrex::Real theta = cons_arr(i, j, k, RhoTheta_comp) / rho;
2380 
2381  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2382  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2383  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2384 
2385  // NOTE: this is rho*<T'w'> = -K dTdz
2386  amrex::Real moflux = (std::abs(tstar) > eps) ? - rho * tstar * wsp * (theta - theta_z0) : zero;
2387 
2388  return moflux;
2389  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
@ theta
Definition: ERF_MM5.H:20

◆ 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 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 > &  u_star_arr 
) const
inline
2403  {
2404  amrex::Real velx = velx_arr(i,j,k);
2405  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2406  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2407  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2408 
2409  amrex::Real ustar = myhalf * ( u_star_arr(i-1,j,0) + u_star_arr(i,j,0) );
2410  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2411 
2412  // NOTE: this is rho*<u'w'> = -K dudz
2413  amrex::Real stressx = -rho * ustar * wsp * velx;
2414 
2415  return stressx;
2416  }
constexpr amrex::Real fourth
Definition: ERF_Constants.H:12

◆ 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 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 > &  u_star_arr 
) const
inline
2430  {
2431  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2432  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2433  amrex::Real vely = vely_arr(i,j,k);
2434  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2435 
2436  amrex::Real ustar = myhalf * ( u_star_arr(i,j-1,0) + u_star_arr(i,j,0) );
2437  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2438 
2439  // NOTE: this is rho*<v'w'> = -K dvdz
2440  amrex::Real stressy = -rho * ustar * wsp * vely;
2441 
2442  return stressy;
2443  }

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: