2
/*****************************************************************************
4
* MODULE: Grass PDE Numerical Library
5
* AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006
6
* soerengebbert <at> gmx <dot> de
8
* PURPOSE: upwinding stabilization algorithms
9
* part of the gpde library
11
* COPYRIGHT: (C) 2000 by the GRASS Development Team
13
* This program is free software under the GNU General Public
14
* License (>=v2). Read the file COPYING that comes with GRASS
17
*****************************************************************************/
20
#include <grass/N_pde.h>
23
/*! \brief full upwinding stabilization algorithm
25
* The arguments are values to compute the local peclet number
27
* \param sprod double -- the scalar produkt between the velocity vector and the normal vector between two points
28
* \param distance double -- distance between two points
29
* \param D double -- diffusion/dispersion tensor part between two points
31
* \return the weighting factor
33
double N_full_upwinding(double sprod, double distance, double D)
40
/*compute the local peclet number */
41
z = sprod * distance / D;
53
/*! \brief exponential upwinding stabilization algorithm
55
* The arguments are values to compute the local peclet number
57
* \param sprod double -- the scalar produkt between the velocity vector and the normal vector between two points
58
* \param distance double -- distance between two points
59
* \param D double -- diffusion/dispersion tensor part between two points
61
* \return the weighting factor
63
double N_exp_upwinding(double sprod, double distance, double D)
70
/*compute the local peclet number */
71
z = sprod * distance / D;
74
return (1 - (1 / z) * (1 - (z / (exp(z) - 1))));