Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
viscous_flux.h File Reference

Viscous (diffusive) flux functor for the Navier-Stokes equations. More...

#include <Kokkos_Core.hpp>
#include "common.h"
#include "boundary.h"
#include "physics.h"

Go to the source code of this file.

Classes

struct  ViscousFluxFunctor
 Integrates the viscous stress and heat flux over every face (one-point rule) and adds them to face_flux (see ConvectiveFluxFunctor). More...
 

Functions

KOKKOS_INLINE_FUNCTION void viscous_traction (const rtype mu, const rtype g[][N_DIM], const rtype *n, rtype *tau_n, const rtype hoop_divergence=0.0_r)
 Viscous traction tau . n of a Newtonian fluid under Stokes' hypothesis, tau = mu (grad u + grad u^T - 2/3 div u I), with g[k][i] = d u_k / d x_i. Axisymmetric flows add the hoop part u_r / r of the divergence.
 
KOKKOS_INLINE_FUNCTION rtype hoop_divergence (const rtype r, const rtype *u, const rtype g[][N_DIM])
 u_r / r at radius r for velocity u and gradient g (g[k][i] = d u_k / d x_i), with r = y: its limit d u_r / d r on the axis.
 
KOKKOS_INLINE_FUNCTION rtype variance_jump (const Kokkos::View< rtype *[3]> &covariance, const int32_t c0, const int32_t c1, const rtype *d)
 Axisymmetric meshes: jump from cell c0 to c1 of the cells' r-weighted variance along d (Mesh::cell_covariance), divided by |d|^2.
 
KOKKOS_INLINE_FUNCTION rtype mean_offset (const rtype *g0, const rtype *g1, const rtype *d, const rtype dvar)
 Part of the jump of two cell averages that comes from the cells' different spreads (variance jump dvar along d, see variance_jump): an average exceeds the value at the center by q_ss var / 2, with the second derivative q_ss along d from the cell gradients g0, g1.
 
KOKKOS_INLINE_FUNCTION rtype face_fraction (const Kokkos::View< rtype *[N_DIM]> &face_coords, const Kokkos::View< rtype *[N_DIM]> &cell_coords, const uint32_t f, const int32_t c0, const rtype *d)
 Fraction along d (from the center of cell c0 to that of its neighbor) of the projection of face f's center.
 

Detailed Description

Viscous (diffusive) flux functor for the Navier-Stokes equations.

Author
Matthew Bonanni (mbona.nosp@m.nni0.nosp@m.01@gm.nosp@m.ail..nosp@m.com)
Version
0.1
Date
2026-10-02

Function Documentation

◆ face_fraction()

KOKKOS_INLINE_FUNCTION rtype face_fraction ( const Kokkos::View< rtype *[N_DIM]> &  face_coords,
const Kokkos::View< rtype *[N_DIM]> &  cell_coords,
const uint32_t  f,
const int32_t  c0,
const rtype *  d 
)

Fraction along d (from the center of cell c0 to that of its neighbor) of the projection of face f's center.

◆ hoop_divergence()

KOKKOS_INLINE_FUNCTION rtype hoop_divergence ( const rtype  r,
const rtype *  u,
const rtype  g[][N_DIM] 
)

u_r / r at radius r for velocity u and gradient g (g[k][i] = d u_k / d x_i), with r = y: its limit d u_r / d r on the axis.

◆ mean_offset()

KOKKOS_INLINE_FUNCTION rtype mean_offset ( const rtype *  g0,
const rtype *  g1,
const rtype *  d,
const rtype  dvar 
)

Part of the jump of two cell averages that comes from the cells' different spreads (variance jump dvar along d, see variance_jump): an average exceeds the value at the center by q_ss var / 2, with the second derivative q_ss along d from the cell gradients g0, g1.

◆ variance_jump()

KOKKOS_INLINE_FUNCTION rtype variance_jump ( const Kokkos::View< rtype *[3]> &  covariance,
const int32_t  c0,
const int32_t  c1,
const rtype *  d 
)

Axisymmetric meshes: jump from cell c0 to c1 of the cells' r-weighted variance along d (Mesh::cell_covariance), divided by |d|^2.

◆ viscous_traction()

KOKKOS_INLINE_FUNCTION void viscous_traction ( const rtype  mu,
const rtype  g[][N_DIM],
const rtype *  n,
rtype *  tau_n,
const rtype  hoop_divergence = 0.0_r 
)

Viscous traction tau . n of a Newtonian fluid under Stokes' hypothesis, tau = mu (grad u + grad u^T - 2/3 div u I), with g[k][i] = d u_k / d x_i. Axisymmetric flows add the hoop part u_r / r of the divergence.