Loading...
Searching...
No Matches
terra::fv::hex::operators::ComputeDtStableKernel< ScalarT > Struct Template Reference

Kokkos kernel that computes the local maximum stable explicit dt for each FV cell. More...

#include <fct_advection_diffusion.hpp>

Public Types

using ScalarType = ScalarT
 
using Vec3 = dense::Vec< ScalarT, 3 >
 
using GH = fct_detail::GeometryHelper< ScalarT >
 

Public Member Functions

void operator() (const int id, const int x, const int y, const int r, ScalarT &local_min) const
 

Public Attributes

grid::Grid3DDataVec< ScalarT, 3 > grid_
 
grid::Grid2DDataScalar< ScalarT > radii_
 
grid::Grid4DDataVec< ScalarT, 3 > cell_centers_
 
grid::Grid4DDataVec< ScalarT, 3 > vel_grid_
 
ScalarT diffusivity_
 

Static Public Attributes

static constexpr int num_neighbors = GH::num_neighbors
 

Detailed Description

template<typename ScalarT>
struct terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >

Kokkos kernel that computes the local maximum stable explicit dt for each FV cell.

The low-order predictor \(T^L_i\) is stable if and only if

\[ \frac{\Delta t}{M_{ii}}\,\lambda_i \leq 1, \qquad \lambda_i = \sum_{j:\,\beta_{ij}<0} |\beta_{ij}| + \sum_j \kappa\,\frac{|\mathbf{S}_{f,j}|^2} {(\mathbf{x}_j-\mathbf{x}_i)\cdot\mathbf{S}_{f,j}} \]

(assumes subtract_divergence = true; the formula naturally coincides with the advective stability limit \(\sum_{j:\,\beta>0}\beta_{ij}\) for exactly divergence-free fields.)

For each cell the kernel outputs \(M_{ii}/\lambda_i\) (a time scale), so the global minimum is the largest dt that satisfies the stability criterion everywhere.

This accounts for:

  • Lateral face fluxes on irregular/small cells near pentagon vertices of the icosahedral grid — these are missed by the simpler \(h_\text{min,radial}/u_\text{max}\) estimate.
  • Non-orthogonal diffusion stencils, where \(|\mathbf{S}_f|^2/(\mathbf{dx}\cdot\mathbf{S}_f)\) can be much larger than \(1/h^2\).

Member Typedef Documentation

◆ GH

template<typename ScalarT >
using terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::GH = fct_detail::GeometryHelper< ScalarT >

◆ ScalarType

template<typename ScalarT >
using terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::ScalarType = ScalarT

◆ Vec3

template<typename ScalarT >
using terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::Vec3 = dense::Vec< ScalarT, 3 >

Member Function Documentation

◆ operator()()

template<typename ScalarT >
void terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::operator() ( const int  id,
const int  x,
const int  y,
const int  r,
ScalarT &  local_min 
) const
inline

Member Data Documentation

◆ cell_centers_

template<typename ScalarT >
grid::Grid4DDataVec< ScalarT, 3 > terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::cell_centers_

◆ diffusivity_

template<typename ScalarT >
ScalarT terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::diffusivity_

◆ grid_

template<typename ScalarT >
grid::Grid3DDataVec< ScalarT, 3 > terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::grid_

◆ num_neighbors

template<typename ScalarT >
constexpr int terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::num_neighbors = GH::num_neighbors
staticconstexpr

◆ radii_

template<typename ScalarT >
grid::Grid2DDataScalar< ScalarT > terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::radii_

◆ vel_grid_

template<typename ScalarT >
grid::Grid4DDataVec< ScalarT, 3 > terra::fv::hex::operators::ComputeDtStableKernel< ScalarT >::vel_grid_

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