PLUTO  4.4-patch2
Functions
viscous_flux.c File Reference

Computes viscous fluxes and source terms for the HD/MHD equations. More...

#include "pluto.h"

Functions

void ViscousFlux (const Data *d, double **ViF, double **ViS, double *dcoeff, int beg, int end, Grid *grid)
 

Detailed Description

Compute the stress tensor components (at the i+1/2 face of each cell) and adds explicit viscous terms to the energy and momentum equation. It is called in the during the sweep integrators. The stress tensor is given by

\[ \tens{\Pi} = \nu_1\Big[\nabla\vec{v} + (\nabla\vec{v})^\intercal\Big] + \left(\nu_2 - \frac{2}{3}\nu_1\right)(\nabla\cdot\vec{v}) \tens{I} \]

where $\nu_1 = \mu$ is the dynamic viscosity and $\tens{I}$ is the unit tensor.

In order to compute the viscous stress tensor, we report here the expression for the gradient of a vector in cylindrical and spherical coordinates (see the book "I do like CFD, vol. I" by K. Masatsuka, Sec. 1.5.5, Eq. 1.5.35):

restart;
#div := 2*(abs(r[i+1])*V[i+1] - abs(r[i])*V[i])/(r[i+1]*abs(r[i+1]) - r[i]*abs(r[i]));
div := 3*(r[i+1]^2*V[i+1] - r[i]^2*V[i])/(r[i+1]^3 - r[i]^3);
r[i] := -r[i+1]; V[i] := -V[i+1];
simplify(div);

References

Authors
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
Petros Tzeferacos
Date
Nov 25, 2020

Function Documentation

◆ ViscousFlux()

void ViscousFlux ( const Data d,
double **  ViF,
double **  ViS,
double *  dcoeff,
int  beg,
int  end,
Grid grid 
)
Parameters
[in]Vdata array containing cell-centered quantities
[in,out]ViFpointer to viscous fluxes
[in,out]ViSpointer to viscous source terms
[in,out]dcoeffpointer to diffusion coefficient for dt calculation
[in]beginteger, index for loop beg
[in]endinteger, index for loop end
[in]gridpointer to array of Grid structures
Returns
This function has no return value.