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 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 > &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 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 > &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 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 > &) 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 > &) 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

Construct the bulk-coefficient flux calculator.

Parameters
[in]m_Cddrag coefficient
[in]m_Chheat-transfer coefficient
[in]m_Cqmoisture-transfer coefficient
2593  {
2594  mdata.Cd = m_Cd;
2595  mdata.Ch = m_Ch;
2596  mdata.Cq = m_Cq;
2597  }
most_data mdata
Definition: ERF_MOSTStress.H:2748
amrex::Real Ch
Definition: ERF_MOSTUtils.H:26
amrex::Real Cd
Definition: ERF_MOSTUtils.H:25
amrex::Real Cq
Definition: ERF_MOSTUtils.H:27

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 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 > &  q_surf_arr 
) 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.
2622  {
2623  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2624  amrex::Real qv = cons_arr(i,j,k,RhoQ1_comp)/cons_arr(i,j,k,Rho_comp);
2625  amrex::Real qvsurf = q_surf_arr(i,j,0);
2626  amrex::Real velx = myhalf * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2627  amrex::Real vely = myhalf * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2628  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2629 
2630  // NOTE: this is rho*<q'w'> = -K dqdz
2631  amrex::Real moflux = rho * mdata.Cq * wsp * (qvsurf - qv);
2632 
2633  return moflux;
2634  }
#define Rho_comp
Definition: ERF_IndexDefines.H:39
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:34
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ rho
Definition: ERF_Kessler.H:25
@ qv
Definition: ERF_Kessler.H:31

◆ 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 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 > &  t_surf_arr 
) 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.
2659  {
2660  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2661  amrex::Real th = cons_arr(i,j,k,RhoTheta_comp)/cons_arr(i,j,k,Rho_comp);
2662  amrex::Real thsurf = t_surf_arr(i,j,0);
2663  amrex::Real velx = myhalf * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2664  amrex::Real vely = myhalf * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2665  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2666 
2667  // NOTE: this is rho*<T'w'> = -K dTdz
2668  amrex::Real moflux = rho * mdata.Ch * wsp * (thsurf - th);
2669 
2670  return moflux;
2671  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:40

◆ 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 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 > &   
) 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.
2696  {
2697  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2698  amrex::Real velx = velx_arr(i,j,k);
2699  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2700  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2701  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2702 
2703  // NOTE: this is rho*<u'w'> = -K dudz
2704  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by u/wsp to get tau_13
2705  amrex::Real stressx = -rho * mdata.Cd * wsp * velx;
2706 
2707  return stressx;
2708  }
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:35

◆ 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 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 > &   
) 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.
2733  {
2734  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2735  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2736  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2737  amrex::Real vely = vely_arr(i,j,k);
2738  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2739 
2740  // NOTE: this is rho*<v'w'> = -K dvdz
2741  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by v/wsp to get tau_13
2742  amrex::Real stressy = -rho * mdata.Cd * wsp * vely;
2743 
2744  return stressy;
2745  }

Member Data Documentation

◆ mdata

most_data bulk_coeff_flux::mdata
private

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