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

#include <ERF_Interpolation_UPW.H>

Collaboration diagram for UPWIND3SL:

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE UPWIND3SL (const amrex::Array4< const amrex::Real > &phi, const amrex::Real)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInX (const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real upw_lo) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInY (const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real upw_lo) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInZ (const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real upw_lo) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Evaluate (const amrex::Real &s, const amrex::Real &sm1, const amrex::Real &sm2) const
 
int GetUpwindCellNumber () const
 

Private Attributes

amrex::Array4< const amrex::Realm_phi
 

Static Private Attributes

static constexpr amrex::Real eps =(amrex::Real(1.0e-16))
 
static constexpr amrex::Real l1 =(amrex::Real(1)/amrex::Real(6.0))
 
static constexpr amrex::Real l2 =(amrex::Real(1)/three)
 

Detailed Description

Interpolation operators used for 3rd order upwind scheme

Constructor & Destructor Documentation

◆ UPWIND3SL()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE UPWIND3SL::UPWIND3SL ( const amrex::Array4< const amrex::Real > &  phi,
const amrex::Real   
)
inline
224  : m_phi(phi)
225  {}
amrex::Array4< const amrex::Real > m_phi
Definition: ERF_Interpolation_UPW.H:324

Member Function Documentation

◆ Evaluate()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real UPWIND3SL::Evaluate ( const amrex::Real s,
const amrex::Real sm1,
const amrex::Real sm2 
) const
inline
314  {
315  amrex::Real rmh = (s - sm1) / ((sm1 - sm2) + eps);
316  amrex::Real K = l2 + amrex::Real(2)*l2*rmh;
317  amrex::Real phi = amrex::max(amrex::Real(0), amrex::min(amrex::Real(2)*rmh, amrex::min(amrex::Real(2), K)));
318  return (sm1 + myhalf * phi * (sm1 - sm2));
319  }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
amrex::Real Real
Definition: ERF_ShocInterface.H:19
static constexpr amrex::Real eps
Definition: ERF_Interpolation_UPW.H:325
static constexpr amrex::Real l2
Definition: ERF_Interpolation_UPW.H:327

Referenced by InterpolateInX(), InterpolateInY(), and InterpolateInZ().

Here is the caller graph for this function:

◆ GetUpwindCellNumber()

int UPWIND3SL::GetUpwindCellNumber ( ) const
inline
321 {return 2;}

◆ InterpolateInX()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void UPWIND3SL::InterpolateInX ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real val_lo,
amrex::Real  upw_lo 
) const
inline
236  {
237  // Upwinding flags
238  if (upw_lo != amrex::Real(0)) upw_lo = (upw_lo > 0) ? amrex::Real(1) : -amrex::Real(1);
239 
240  // Data to interpolate on
241  amrex::Real sp1 = m_phi(i+1, j , k , qty_index);
242  amrex::Real s = m_phi(i , j , k , qty_index);
243  amrex::Real sm1 = m_phi(i-1, j , k , qty_index);
244  amrex::Real sm2 = m_phi(i-2, j , k , qty_index);
245 
246  // Left and right fluxes
247  amrex::Real Fhi = Evaluate(s ,sm1,sm2);
248  amrex::Real Flo = Evaluate(sm1,s ,sp1);
249 
250  // Numerical flux
251  val_lo = (amrex::Real(1) + upw_lo)/amrex::Real(2) * Fhi + (amrex::Real(1) - upw_lo)/amrex::Real(2) * Flo;
252  }
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Evaluate(const amrex::Real &s, const amrex::Real &sm1, const amrex::Real &sm2) const
Definition: ERF_Interpolation_UPW.H:311
Here is the call graph for this function:

◆ InterpolateInY()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void UPWIND3SL::InterpolateInY ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real val_lo,
amrex::Real  upw_lo 
) const
inline
263  {
264  // Upwinding flags
265  if (upw_lo != amrex::Real(0)) upw_lo = (upw_lo > 0) ? amrex::Real(1) : -amrex::Real(1);
266 
267  // Data to interpolate on
268  amrex::Real sp1 = m_phi(i , j+1, k , qty_index);
269  amrex::Real s = m_phi(i , j , k , qty_index);
270  amrex::Real sm1 = m_phi(i , j-1, k , qty_index);
271  amrex::Real sm2 = m_phi(i , j-2, k , qty_index);
272 
273  // Left and right fluxes
274  amrex::Real Fhi = Evaluate(s ,sm1,sm2);
275  amrex::Real Flo = Evaluate(sm1,s ,sp1);
276 
277  // Numerical flux
278  val_lo = (amrex::Real(1) + upw_lo)/amrex::Real(2) * Fhi + (amrex::Real(1) - upw_lo)/amrex::Real(2) * Flo;
279  }
Here is the call graph for this function:

◆ InterpolateInZ()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void UPWIND3SL::InterpolateInZ ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real val_lo,
amrex::Real  upw_lo 
) const
inline
290  {
291  // Upwinding flags
292  if (upw_lo != amrex::Real(0)) upw_lo = (upw_lo > 0) ? amrex::Real(1) : -amrex::Real(1);
293 
294  // Data to interpolate on
295  amrex::Real sp1 = m_phi(i , j , k+1, qty_index);
296  amrex::Real s = m_phi(i , j , k , qty_index);
297  amrex::Real sm1 = m_phi(i , j , k-1, qty_index);
298  amrex::Real sm2 = m_phi(i , j , k-2, qty_index);
299 
300  // Left and right fluxes
301  amrex::Real Fhi = Evaluate(s ,sm1,sm2);
302  amrex::Real Flo = Evaluate(sm1,s ,sp1);
303 
304  // Numerical flux
305  val_lo = (amrex::Real(1) + upw_lo)/amrex::Real(2) * Fhi + (amrex::Real(1) - upw_lo)/amrex::Real(2) * Flo;
306  }
Here is the call graph for this function:

Member Data Documentation

◆ eps

constexpr amrex::Real UPWIND3SL::eps =(amrex::Real(1.0e-16))
staticconstexprprivate

Referenced by Evaluate().

◆ l1

constexpr amrex::Real UPWIND3SL::l1 =(amrex::Real(1)/amrex::Real(6.0))
staticconstexprprivate

◆ l2

constexpr amrex::Real UPWIND3SL::l2 =(amrex::Real(1)/three)
staticconstexprprivate

Referenced by Evaluate().

◆ m_phi

amrex::Array4<const amrex::Real> UPWIND3SL::m_phi
private

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