ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SedimentationFlux.H File Reference

The sedimentation face fluxes a precipitating microphysics scheme records. More...

#include <memory>
#include <AMReX_MultiFab.H>
#include <AMReX_Vector.H>
Include dependency graph for ERF_SedimentationFlux.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SedimentationFlux
 

Functions

template<typename F >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void sedimentation_add_column_sums (const amrex::Array4< amrex::Real > &sed, int n, int i, int j, int klo, int khi, amrex::Real sign, F &&w) noexcept
 

Detailed Description

The sedimentation face fluxes a precipitating microphysics scheme records.

Function Documentation

◆ sedimentation_add_column_sums()

template<typename F >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void sedimentation_add_column_sums ( const amrex::Array4< amrex::Real > &  sed,
int  n,
int  i,
int  j,
int  klo,
int  khi,
amrex::Real  sign,
F &&  w 
)
noexcept

Add sign * (sum over m = k..khi of w(m)) to sed(i,j,k,n) for every k in [klo, khi].

Called with sign = +1 and w(m) = rho*q*dz before a sedimentation step and with sign = -1 and the same w after it, this adds to each face k the mass that crossed it downward: what the cells above it lost. The face above khi gets nothing (no inflow).

76 {
77  amrex::Real sum = 0.0;
78  for (int k = khi; k >= klo; --k) {
79  sum += w(k);
80  sed(i,j,k,n) += sign * sum;
81  }
82 }
const int khi
Definition: ERF_InitCustomPert_Bubble.H:25
const int klo
Definition: ERF_InitCustomPert_KE.H:9
Real w
Definition: ERF_Plotfile2DInterpolator.cpp:23
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by WDM6::AdvanceColumns(), and WSM6::AdvanceColumns().

Here is the caller graph for this function: