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
2185  {
2186  mdata.Cd = m_Cd;
2187  mdata.Ch = m_Ch;
2188  mdata.Cq = m_Cq;
2189  }
most_data mdata
Definition: ERF_MOSTStress.H:2300
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
2205  {
2206  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2207  amrex::Real qv = cons_arr(i,j,k,RhoQ1_comp)/cons_arr(i,j,k,Rho_comp);
2208  amrex::Real qvsurf = q_surf_arr(i,j,0);
2209  amrex::Real velx = 0.5 * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2210  amrex::Real vely = 0.5 * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2211  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2212 
2213  // NOTE: this is rho*<q'w'> = -K dqdz
2214  amrex::Real moflux = rho * mdata.Cq * wsp * (qvsurf - qv);
2215 
2216  return moflux;
2217  }
#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
@ 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
2233  {
2234  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2235  amrex::Real th = cons_arr(i,j,k,RhoTheta_comp)/cons_arr(i,j,k,Rho_comp);
2236  amrex::Real thsurf = t_surf_arr(i,j,0);
2237  amrex::Real velx = 0.5 * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2238  amrex::Real vely = 0.5 * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2239  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2240 
2241  // NOTE: this is rho*<T'w'> = -K dTdz
2242  amrex::Real moflux = rho * mdata.Ch * wsp * (thsurf - th);
2243 
2244  return moflux;
2245  }
#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
2259  {
2260  amrex::Real rho = 0.5 * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2261  amrex::Real velx = velx_arr(i,j,k);
2262  amrex::Real vely = 0.25 * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2263  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2264  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2265 
2266  // NOTE: this is rho*<u'w'> = -K dudz
2267  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by u/wsp to get tau_13
2268  amrex::Real stressx = -rho * mdata.Cd * wsp * velx;
2269 
2270  return stressx;
2271  }

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

Member Data Documentation

◆ mdata

most_data bulk_coeff_flux::mdata
private

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