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

#include <ERF_MOSTStress.H>

Collaboration diagram for bulk_coeff_flux:

Public Member Functions

 bulk_coeff_flux (amrex::Real m_Cd, amrex::Real m_Ch, amrex::Real m_Cq)
 
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 > &, const amrex::Array4< const amrex::Real > &q_surf_arr) 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 > &, const amrex::Array4< const amrex::Real > &t_surf_arr) 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 > &) 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 > &) const
 

Private Attributes

most_data mdata
 

Detailed Description

Bulk coefficient flux formulation

Constructor & Destructor Documentation

◆ bulk_coeff_flux()

bulk_coeff_flux::bulk_coeff_flux ( amrex::Real  m_Cd,
amrex::Real  m_Ch,
amrex::Real  m_Cq 
)
inline
2184  {
2185  mdata.Cd = m_Cd;
2186  mdata.Ch = m_Ch;
2187  mdata.Cq = m_Cq;
2188  }
most_data mdata
Definition: ERF_MOSTStress.H:2299
amrex::Real Ch
Definition: ERF_MOSTStress.H:29
amrex::Real Cd
Definition: ERF_MOSTStress.H:28
amrex::Real Cq
Definition: ERF_MOSTStress.H:30

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_coeff_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 > &  ,
const amrex::Array4< const amrex::Real > &  q_surf_arr 
) const
inline
2204  {
2205  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2206  amrex::Real qv = cons_arr(i,j,k,RhoQ1_comp)/cons_arr(i,j,k,Rho_comp);
2207  amrex::Real qvsurf = q_surf_arr(i,j,k);
2208  amrex::Real velx = 0.5 * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2209  amrex::Real vely = 0.5 * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2210  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2211 
2212  // NOTE: this is rho*<q'w'> = -K dqdz
2213  amrex::Real moflux = rho * mdata.Cq * wsp * (qvsurf - qv);
2214 
2215  return moflux;
2216  }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ rho
Definition: ERF_Kessler.H:22
@ qv
Definition: ERF_Kessler.H:28

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_coeff_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 > &  ,
const amrex::Array4< const amrex::Real > &  t_surf_arr 
) const
inline
2232  {
2233  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2234  amrex::Real th = cons_arr(i,j,k,RhoTheta_comp)/cons_arr(i,j,k,Rho_comp);
2235  amrex::Real thsurf = t_surf_arr(i,j,k);
2236  amrex::Real velx = 0.5 * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2237  amrex::Real vely = 0.5 * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2238  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2239 
2240  // NOTE: this is rho*<T'w'> = -K dTdz
2241  amrex::Real moflux = rho * mdata.Ch * wsp * (thsurf - th);
2242 
2243  return moflux;
2244  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_coeff_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 > &   
) const
inline
2258  {
2259  amrex::Real rho = 0.5 * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2260  amrex::Real velx = velx_arr(i,j,k);
2261  amrex::Real vely = 0.25 * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2262  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2263  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2264 
2265  // NOTE: this is rho*<u'w'> = -K dudz
2266  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by u/wsp to get tau_13
2267  amrex::Real stressx = -rho * mdata.Cd * wsp * velx;
2268 
2269  return stressx;
2270  }

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_coeff_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 > &   
) const
inline
2284  {
2285  amrex::Real rho = 0.5 * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2286  amrex::Real velx = 0.25 * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2287  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2288  amrex::Real vely = vely_arr(i,j,k);
2289  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2290 
2291  // NOTE: this is rho*<v'w'> = -K dvdz
2292  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by v/wsp to get tau_13
2293  amrex::Real stressy = -rho * mdata.Cd * wsp * vely;
2294 
2295  return stressy;
2296  }

Member Data Documentation

◆ mdata

most_data bulk_coeff_flux::mdata
private

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