proteus  1.8.1
C/C++/Fortran libraries
Macros | Functions
analyticalSolutions

A C library of analytical solutions to differential equations for use in verification. More...

Macros

#define max(a, b)   (((a)>(b))?(a):(b))
 

Functions

int diffusionSin1D (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Sinusoidal 1D diffusion. More...
 
int diffusionSin2D (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Sinusoidal 2D diffusion. More...
 
int diffusionSin3D (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Sinusoidal 3D diffusion. More...
 
int diffusionSin1D_r (int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
 Sinusoidal 1D diffusion (reaction) More...
 
int diffusionSin2D_r (int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
 Sinusoidal 2D diffusion (reaction) More...
 
int diffusionSin3D_r (int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
 Sinusoidal 3D diffusion (reaction) More...
 
int LinearAD_DiracIC (int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
 Linear Advective Diffusion Dirac Initial Condition. More...
 
int LinearAD_DiracIC_advectiveVelocity (int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
 Linear Advective Diffusion Dirac Initial Condition(advective velocity) More...
 
int LinearAD_DiracIC_diffusiveVelocity (int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
 Linear Advective Diffusion Dirac Initial Condition(diffusive velocity) More...
 
int LinearAD_DiracIC_du (int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
 Linear Advective Diffusion Dirac Initial Condition (du) More...
 
int LinearAD_DiracIC_totalVelocity (int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
 Linear Advective Diffusion Dirac Initial Condition(total velocity) More...
 
int LinearAD_SteadyState (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Linear Advection-Diffusion Steady State. More...
 
int LinearADR_Decay_DiracIC (int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
 Linear Avection Diffusion Reaction Decay Dirac Initial Condition. More...
 
int LinearADR_Decay_DiracIC_dr (int *iwork, double *rwork, int nPoints, double T, double *x, double *u, double *dr)
 Linear Avection Diffusion Reaction Decay Dirac Initial Condition (dr) More...
 
int LinearADR_Decay_DiracIC_r (int *iwork, double *rwork, int nPoints, double T, double *x, double *u, double *r)
 Linear Avection Diffusion Reaction Decay Dirac Initial Condition (reaction) More...
 
int LinearADR_Sine (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Linear Avection Diffusion Reaction Sine function. More...
 
int LinearADR_Sine_advectiveVelocity (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Linear Avection Diffusion Reaction Sine function (advective velocity) More...
 
int LinearADR_Sine_diffusiveVelocity (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Linear Avection Diffusion Reaction Sine function (diffusive velocity) More...
 
int LinearADR_Sine_dr (int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *dr)
 Linear Avection Diffusion Reaction Sine function (dr) More...
 
int LinearADR_Sine_du (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Linear Avection Diffusion Reaction Sine function (du) More...
 
int LinearADR_Sine_r (int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
 Linear Avection Diffusion Reaction Sine function (reaction) More...
 
int LinearADR_Sine_totalVelocity (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Linear Avection Diffusion Reaction Sine function (total velocity) More...
 
int NonlinearAD_SteadyState (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Nonlinear Advection-Diffusion Steady State. More...
 
int NonlinearADR_Decay_DiracIC (int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
 Non Linear Avection Diffusion Reaction Decay Dirac Initial Condition. More...
 
int NonlinearADR_Decay_DiracIC_dr (int *iwork, double *rwork, int nPoints, double T, double *x, double *u, double *dr)
 Non Linear Avection Diffusion Reaction Decay Dirac Initial Condition (dr) More...
 
int NonlinearADR_Decay_DiracIC_r (int *iwork, double *rwork, int nPoints, double T, double *x, double *u, double *r)
 Non Linear Avection Diffusion Reaction Decay Dirac Initial Condition (reaction) More...
 
int NonlinearDAE (int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
 Nonlinear Differential-algebraic equations. More...
 
int NonlinearDAE_f (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Nonlinear Differential-algebraic equations. More...
 
int PlanePoiseuilleFlow_u (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Poiseuille Flow between two parallel fixed plates with constant seperation (width). More...
 
int PoiseuillePipeFlow (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Poiseuille Flow through a circular pipe. More...
 
int PoiseuillePipeFlow_P (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Poiseuille Flow through a circular pipe. More...
 
int poissonsEquationExp1D (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Poisson Exponential Equation 1D. More...
 
int poissonsEquationExp2D (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Poisson Exponential Equation 2D. More...
 
int poissonsEquationExp3D (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Poisson Exponential Equation 3D. More...
 
int poissonsEquationExp3D_dr (int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *dr)
 Poisson Exponential Equation 3D (dr) More...
 
int poissonsEquationExp1D_r (int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
 Poisson Exponential Equation 1D (reaction) More...
 
int poissonsEquationExp2D_r (int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
 Poisson Exponential Equation 2D (reaction) More...
 
int poissonsEquationExp3D_r (int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
 Poisson Exponential Equation 3D (reaction) More...
 
int STflowSphere_P (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Stokes Flow around moving Sphere. More...
 
int STflowSphere_Vx (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Stokes Flow around moving Sphere. More...
 
int STflowSphere_Vy (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Stokes Flow around moving Sphere. More...
 
int STflowSphere_Vz (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Stokes Flow around moving Sphere.
More...
 
void coords (double vx, double vy, double vz, double xS, double yS, double zS, double *x, double *r, double *theta, double *norm_v, double *eR, double *eTHETA)
 
void vel (double rS, double norm_v, double r, double theta, double *vR, double *vTHETA)
 
double uOfX_df (double nlC, double lu)
 
double uOfX_f (double a, double b, double nlC, double nlD, double x, double lu)
 
double f (double C, double b, double a, int q, int r)
 
double df (double C, double b, double a, int q, int r)
 
int PlaneCouetteFlow_u (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Couette Flow between two parallel plates. One moving relative to the other with constant seperation (width). More...
 

Detailed Description

Macro Definition Documentation

◆ max

#define max (   a,
 
)    (((a)>(b))?(a):(b))

Definition at line 14 of file analyticalSolutions.h.

Function Documentation

◆ coords()

void coords ( double  vx,
double  vy,
double  vz,
double  xS,
double  yS,
double  zS,
double *  x,
double *  r,
double *  theta,
double *  norm_v,
double *  eR,
double *  eTHETA 
)

Definition at line 2093 of file analyticalSolutions.c.

◆ df()

double df ( double  C,
double  b,
double  a,
int  q,
int  r 
)

Definition at line 2209 of file analyticalSolutions.c.

◆ diffusionSin1D()

int diffusionSin1D ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iwork[0]angular frequency, \( \omega_x \)
rworkNOT USED
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[ -\Delta u = f \]

\[ f = -(2 \pi \omega_x)^2 \sin(2 \pi \omega_x x) \]

Returns
status code

Definition at line 84 of file analyticalSolutions.c.

◆ diffusionSin1D_r()

int diffusionSin1D_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u,
double *  r 
)
Parameters
iwork[0]x-component angular frequency, \( \omega_x \)
rworkNOT USED
nPoints- total number of points
tNOT USED
xinput array
uNOT USED
routput array

\[ -\Delta u = -r \]

\[ r = (2 \pi \omega_x)^2 \sin(2 \pi \omega_x x) \]


Returns
status code

Definition at line 172 of file analyticalSolutions.c.

◆ diffusionSin2D()

int diffusionSin2D ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iwork[0]x-component angular frequency, \( \omega_x \)
iwork[1]y-component angular frequency, \( \omega_y \)
rworkNOT USED
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[ -\Delta u = f \]

\[ f = -(2\pi\omega_x)^2\sin(2 \pi \omega_x x) -(2 \pi \omega_y)^2\sin(2 \pi \omega_y y)\]

Returns
status code

Definition at line 111 of file analyticalSolutions.c.

◆ diffusionSin2D_r()

int diffusionSin2D_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u,
double *  r 
)
Parameters
iwork[0]x-component angular frequency, \( omega_x \)
iwork[1]y-component angular frequency, \( omega_y \)
rworkNOT USED
nPoints- total number of points
tNOT USED
xinput array
uNOT USED
routput array

\[-\Delta u = -r \]

\[r= (2\pi\omega_x)^2\sin(2 \pi \omega_x x)+(2 \pi \omega_y)^2\sin(2 \pi \omega_y y)\]

Returns
status code

Definition at line 200 of file analyticalSolutions.c.

◆ diffusionSin3D()

int diffusionSin3D ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iwork[0]x-component angular frequency, \( \omega_x \)
iwork[1]y-component angular frequency, \( \omega_y \)
iwork[2]z-component angular frequency, \( \omega_z \)
rworkNOT USED
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[ -\Delta u = f \]

\[ f = -(2\pi\omega_x)^2\sin(2\pi\omega_x x) -(2\pi\omega_y)^2\sin(2\pi\omega_y y)-(2\pi\omega_z)^2sin(2 \pi \omega_z z)\]

Returns
status code

Definition at line 141 of file analyticalSolutions.c.

◆ diffusionSin3D_r()

int diffusionSin3D_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u,
double *  r 
)
Parameters
iwork[0]x-component angular frequency, \( omega_x \)
iwork[1]y-component angular frequency, \( omega_y \)
iwork[2]z-component angular frequency, \( omega_z \)
rworkNOT USED
nPoints- total number of points
tNOT USED
xinput array
uNOT USED
routput array

\[-\Delta u = -r \]

\[r=(2\pi\omega_x)^2\sin(2\pi\omega_x x) +(2\pi\omega_y)^2\sin(2\pi\omega_y y)+(2\pi\omega_z)^2sin(2 \pi \omega_z z)\]

Returns
status code

Definition at line 231 of file analyticalSolutions.c.

◆ f()

double f ( double  C,
double  b,
double  a,
int  q,
int  r 
)

Definition at line 2185 of file analyticalSolutions.c.

◆ LinearAD_DiracIC()

int LinearAD_DiracIC ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

The exact solution of

\[ u_t + \nabla \cdot (b u - a \nabla u) = 0\]

on an infinite domain with dirac initial data

\[u_0 = \int u_0 \delta(x - x_0)\]

also returns advective, diffusive, and total flux

Returns
status code

Definition at line 273 of file analyticalSolutions.c.

◆ LinearAD_DiracIC_advectiveVelocity()

int LinearAD_DiracIC_advectiveVelocity ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
nPointstotal number of points
tNOT USED
xinput array
foutput array, vector

The exact solution of

\[ u_t + \nabla \cdot (b u - a \nabla u) = 0\]

on an infinite domain with dirac initial data

\[u_0 = \int u_0 \delta(x - x_0)\]

Returns
status code

Definition at line 337 of file analyticalSolutions.c.

◆ LinearAD_DiracIC_diffusiveVelocity()

int LinearAD_DiracIC_diffusiveVelocity ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
nPointstotal number of points
tNOT USED
xinput array
foutput array, vector

The exact solution of

\[ u_t + \nabla \cdot (b u - a \nabla u) = 0\]

on an infinite domain with dirac initial data

\[u_0 = \int u_0 \delta(x - x_0)\]

Returns
status code

Definition at line 381 of file analyticalSolutions.c.

◆ LinearAD_DiracIC_du()

int LinearAD_DiracIC_du ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
nPointstotal number of points
tNOT USED
xinput array
foutput array, vector

The exact solution of

\[ u_t + \nabla \cdot (b u - a \nabla u) = 0\]

on an infinite domain with dirac initial data

\[u_0 = \int u_0 \delta(x - x_0)\]

also returns advective, diffusive, and total flux

Returns
status code

Definition at line 423 of file analyticalSolutions.c.

◆ LinearAD_DiracIC_totalVelocity()

int LinearAD_DiracIC_totalVelocity ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
nPointstotal number of points
tNOT USED
xinput array
foutput array, vector

The exact solution of

\[ u_t + \nabla \cdot (b u - a \nabla u) = 0\]

on an infinite domain with dirac initial data

\[u_0 = \int u_0 \delta(x - x_0)\]

Returns
status code

Definition at line 471 of file analyticalSolutions.c.

◆ LinearAD_SteadyState()

int LinearAD_SteadyState ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]\( b \)
rwork[1]\( a \)
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[(bu - au_x)_x = 0\]

\[ u(0) = 1\]

\[ u(1) = 0\]

Returns
status code

Definition at line 508 of file analyticalSolutions.c.

◆ LinearADR_Decay_DiracIC()

int LinearADR_Decay_DiracIC ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
rwork[10]\( c \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

The exact solution of

\f[ u_t + \nabla \cdot(bu - a \nabla u) + cu= 0 \f]

on an infinite domain with Dirac initial data.
Also returns the fluxes (by inheritance).
Returns
status code

Definition at line 566 of file analyticalSolutions.c.

◆ LinearADR_Decay_DiracIC_dr()

int LinearADR_Decay_DiracIC_dr ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  u,
double *  dr 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
rwork[10]\( c \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array
droutput array

The exact solution of

\f[ u_t + \nabla \cdot(bu - a \nabla u) + cu= 0 \f]

on an infinite domain with Dirac initial data.
Also returns the fluxes (by inheritance).
Returns
status code

Definition at line 613 of file analyticalSolutions.c.

◆ LinearADR_Decay_DiracIC_r()

int LinearADR_Decay_DiracIC_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  u,
double *  r 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
rwork[10]\( c \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array
routput array

The exact solution of

\f[ u_t + \nabla \cdot(bu - a \nabla u) + cu= 0 \f]

on an infinite domain with Dirac initial data.
Also returns the fluxes (by inheritance).
Returns
status code

Definition at line 652 of file analyticalSolutions.c.

◆ LinearADR_Sine()

int LinearADR_Sine ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0:2]\( \omega[0:2] \)
rwork[3]\( \omega_0 \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

An exact solution and source term for

\[ \nabla \cdot (\vec b u - \ddot a \nabla u) + c u + d = 0 \]

where

\[ u(x) = sin(\vec \omega \cdot \vec x + \omega_0) = sin(Ax - b)\]

\[r(u,x) = - ((\ddot a \vec \omega) \cdot \vec \omega) u - (\vec b \cdot \vec \omega) cos(Ax - b)\]

\[ = c u + D cos(Ax - b) \]

\[ = cu + d \]

also returns the advective, diffusive, and total velocity at a point.

Returns
status code

Definition at line 691 of file analyticalSolutions.c.

◆ LinearADR_Sine_advectiveVelocity()

int LinearADR_Sine_advectiveVelocity ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0:2]\( \omega[0:2] \)
rwork[3]\( \omega_0 \)
rwork[4:6]\( b[0:2] \)
rwork[7:15]\( a[0:3,0:3] \)
rwork[16]\( c \)
nPointstotal number of points
tNOT USED
xinput array
foutput array (vector)

An exact solution and source term for

\[ \nabla \cdot (\vec b u - \ddot a \nabla u) + c u + d = 0 \]

where

\[ u(x) = sin(\vec \omega \cdot \vec x + \omega_0) = sin(Ax - b)\]

\[r(u,x) = - ((\ddot a \vec \omega) \cdot \vec \omega) u - (\vec b \cdot \vec \omega) cos(Ax - b)\]

\[ = c u + D cos(Ax - b) \]

\[ = cu + d \]

returns the advective velocity at a point.

Returns
status code

Definition at line 749 of file analyticalSolutions.c.

◆ LinearADR_Sine_diffusiveVelocity()

int LinearADR_Sine_diffusiveVelocity ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0:2]\( \omega[0:2] \)
rwork[3]\( \omega_0 \)
rwork[4:6]\( b[0:2] \)
rwork[7:15]\( a[0:3,0:3] \)
rwork[16]\( c \)
nPointstotal number of points
tNOT USED
xinput array
foutput array (vector)

An exact solution and source term for

\[ \nabla \cdot (\vec b u - \ddot a \nabla u) + c u + d = 0 \]

where

\[ u(x) = sin(\vec \omega \cdot \vec x + \omega_0) = sin(Ax - b)\]

\[r(u,x) = - ((\ddot a \vec \omega) \cdot \vec \omega) u - (\vec b \cdot \vec \omega) cos(Ax - b)\]

\[ = c u + D cos(Ax - b) \]

\[ = cu + d \]

returns the diffusive velocity at a point.

Returns
status code

Definition at line 802 of file analyticalSolutions.c.

◆ LinearADR_Sine_dr()

int LinearADR_Sine_dr ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u,
double *  dr 
)
Parameters
iworkNOT USED
rwork[0:2]\( \omega[0:2] \)
rwork[3]\( \omega_0 \)
rwork[4:6]\( b[0:2] \)
rwork[7:15]\( a[0:3,0:3] \)
rwork[16]\( c \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array
droutput array

An exact solution and source term for

\[ \nabla \cdot (\vec b u - \ddot a \nabla u) + c u + d = 0 \]

where

\[ u(x) = sin[\vec \omega \cdot \vec x + \omega_0) ] = sin(Ax - b) \f \f[r(u,x) = - ((\ddot a \vec \omega) \cdot \vec \omega) u - (\vec b \cdot \vec \omega) cos(Ax - b)\]

\[ = c u + D cos(Ax - b) \]

\[ = cu + d \]

also returns the advective, diffusive, and total velocity at a point.

Returns
status code

Definition at line 851 of file analyticalSolutions.c.

◆ LinearADR_Sine_du()

int LinearADR_Sine_du ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0:2]\( \omega[0:2] \)
rwork[3]\( \omega_0 \)
nPointstotal number of points
tNOT USED
xinput array
foutput array (vector)

An exact solution and source term for

\[ \nabla \cdot (\vec b u - \ddot a \nabla u) + c u + d = 0 \]

where

\[ u(x) = sin(\vec \omega \cdot \vec x + \omega_0) = sin(Ax - b)\]

\[r(u,x) = - ((\ddot a \vec \omega) \cdot \vec \omega) u - (\vec b \cdot \vec \omega) cos(Ax - b)\]

\[ = c u + D cos(Ax - b) \]

\[ = cu + d \]

also returns the advective, diffusive, and total velocity at a point.

Returns
status code

Definition at line 890 of file analyticalSolutions.c.

◆ LinearADR_Sine_r()

int LinearADR_Sine_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u,
double *  r 
)
Parameters
iworkNOT USED
rwork[0:2]\( \omega[0:2] \)
rwork[3]\( \omega_0 \)
rwork[4:6]\( b[0:2] \)
rwork[7:15]\( a[0:3,0:3] \)
rwork[16]\( c \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array
routput array

An exact solution and source term for

\[ \nabla \cdot (\vec b u - \ddot a \nabla u) + c u + d = 0 \]

where

\[ u(x) = sin(\vec \omega \cdot \vec x + \omega_0) = sin(Ax - b)\]

\[r(u,x) = - ((\ddot a \vec \omega) \cdot \vec \omega) u - (\vec b \cdot \vec \omega) cos(Ax - b)\]

\[ = c u + D cos(Ax - b) \]

\[ = cu + d \]

also returns the advective, diffusive, and total velocity at a point.

Returns
status code

Definition at line 938 of file analyticalSolutions.c.

◆ LinearADR_Sine_totalVelocity()

int LinearADR_Sine_totalVelocity ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0:2]\( \omega[0:2] \)
rwork[3]\( \omega_0 \)
rwork[4:6]\( b[0:2] \)
rwork[7:15]\( a[0:3,0:3] \)
rwork[16]\( c \)
nPointstotal number of points
tNOT USED
xinput array
foutput array (vector)

An exact solution and source term for

\[ \nabla \cdot (\vec b u - \ddot a \nabla u) + c u + d = 0 \]

where

\[ u(x) = sin(\vec \omega \cdot \vec x + \omega_0) = sin(Ax - b)\]

\[r(u,x) = - ((\ddot a \vec \omega) \cdot \vec \omega) u - (\vec b \cdot \vec \omega) cos(Ax - b)\]

\[ = c u + D cos(Ax - b) \]

\[ = cu + d \]

returns the total velocity at a point.

Returns
status code

Definition at line 997 of file analyticalSolutions.c.

◆ NonlinearAD_SteadyState()

int NonlinearAD_SteadyState ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]\( q \)
rwork[1]\( r \)
rwork[2]\( b \)
rwork[3]\( a \)
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[(bu^q - a(u^r)_x)_x = 0\]

\[ u(0) = 1\]

\[ u(1) = 0\]

Returns
status code

Definition at line 1036 of file analyticalSolutions.c.

◆ NonlinearADR_Decay_DiracIC()

int NonlinearADR_Decay_DiracIC ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
rwork[10]\( c \)
rwork[11]\( d \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array
droutput array

The approximate analytical solution of

\f[ u_t + \nabla \cdot(bu - a \nabla u) + cu^d= 0 \f]

on an infinite domain with Dirac initial data.
Also returns the fluxes (by inheritance).
Returns
status code

Definition at line 1164 of file analyticalSolutions.c.

◆ NonlinearADR_Decay_DiracIC_dr()

int NonlinearADR_Decay_DiracIC_dr ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  u,
double *  dr 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
rwork[10]\( c \)
rwork[11]\( d \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array
droutput array

The approximate analytical solution of

\f[ u_t + \nabla \cdot(bu - a \nabla u) + cu^d= 0 \f]

on an infinite domain with Dirac initial data.
Also returns the fluxes (by inheritance).
Returns
status code

Definition at line 1216 of file analyticalSolutions.c.

◆ NonlinearADR_Decay_DiracIC_r()

int NonlinearADR_Decay_DiracIC_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  u,
double *  r 
)
Parameters
iworkNOT USED
rwork[0:2]\( b[0:2] \)
rwork[3]\( n \)
rwork[4]\( a \)
rwork[5]\( tStart \)
rwork[6]\( u_0 \)
rwork[7:9]\( x_0[0:2] \)
rwork[10]\( c \)
rwork[11]\( d \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array
routput array

The approximate analytical solution of

\f[ u_t + \nabla \cdot(bu - a \nabla u) + cu^d= 0 \f]

on an infinite domain with Dirac initial data.
Also returns the fluxes (by inheritance).
Returns
status code

Definition at line 1257 of file analyticalSolutions.c.

◆ NonlinearDAE()

int NonlinearDAE ( int *  iwork,
double *  rwork,
int  nPoints,
double  T,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]\( a \)
rwork[1]\( p \)
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[u_t = - a*max(u,0)^p\]

\[u(0) = 1\]

Returns
status code

Definition at line 1287 of file analyticalSolutions.c.

◆ NonlinearDAE_f()

int NonlinearDAE_f ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  f 
)
Parameters
iworkNOT USED
rwork[0]\( a \)
rwork[1]\( p \)
nPoints- total number of points
tNOT USED
xinput array
foutput array, vector

\[u_t = - a*max(u,0)^p\]

\[u(0) = 1\]

Returns
status code

Definition at line 1330 of file analyticalSolutions.c.

◆ PlaneCouetteFlow_u()

int PlaneCouetteFlow_u ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]velocity of moving plate in the x-dir, \( vx \)
rwork[1]width between plates, \( h \)
rwork[2]x-axis offset, \( xs \)
rwork[3]y-axis offset, \( ys \)
rwork[4]z-axis offset, \( zs \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

x-momentum equation

\[ \nabla^2 u_x = 0 \]

\[ u(y) = \frac{vx}{h} * y\]

\[ u(0) = 0 \]

\[ u(h) = vx \]

Axis of origin: at bottom plate

Returns
status code

Definition at line 36 of file analyticalSolutions.c.

◆ PlanePoiseuilleFlow_u()

int PlanePoiseuilleFlow_u ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]width between the plates, \( h \)
rwork[1]viscosity of fluid, \( \mu \)
rwork[2]the pressure gradient, \( \nabla p \) (neg)
rwork[3]the rate of flow per unit width, \( q \)
rwork[4]x-axis offset, \( xs \)
rwork[5]y-axis offset, \( ys \)
rwork[6]z-axis offset, \( zs \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

x-momentum equation

\[ (\nabla p + \mu \nabla^2 u)_x = 0 \]

\[ u(y) = 4 u_{max} y (\frac{h-y}{h^2}) \]

\[ u(0) = u(h) = 0 \]

\[ u(h/2) = u_{max} \]

\[u_{max} = \frac{-\nabla p}{8 \mu} h^2 = \frac{3}{2} \frac{q}{h} \]

\( u_{max} \) = maximum velocity at the centerline
Axis of origin: at bottom plate

Returns
status code

Definition at line 1380 of file analyticalSolutions.c.

◆ PoiseuillePipeFlow()

int PoiseuillePipeFlow ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]radius of pipe, \( R \)
rwork[1]viscosity of fluid, \( \mu \)
rwork[2]the pressure gradient, \( \nabla p \) (neg)
rwork[3]the rate of flow, \( Q \)
rwork[4]x-axis offset, \( xs \)
rwork[5]y-axis offset, \( ys \)
rwork[6]z-axis offset, \( zs \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

x-momentum equation

\[ (\nabla p + \mu \nabla^2 u)_x = 0 \]

\[ u(r) = u_{max} (1 - \frac{r^2}{R^2}) \]

\[ u(0) = u_{max} \]

\[ u(R) = 0 \]

\[ u_{max} = -\nabla p \frac{R^2}{4 \mu}= \frac{2Q}{\pi R^2}\]

\( u_{max} \) = maximum velocity at the centerline
Axis of origin: at center of pipe

Returns
status code

Definition at line 1466 of file analyticalSolutions.c.

◆ PoiseuillePipeFlow_P()

int PoiseuillePipeFlow_P ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]radius of pipe, \( R \)
rwork[1]viscosity of fluid, \( \mu \)
rwork[2]the pressure gradient, \( \nabla p \) (neg)
rwork[3]the rate of flow, \( Q \)
rwork[3]the length of pipe, \( L \)
rwork[4]x-axis offset, \( xs \)
rwork[5]y-axis offset, \( ys \)
rwork[6]z-axis offset, \( zs \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

\[ p - p_0 = -\nabla p L(1-x)\]

\( p_0 =p(L)\) = 0, the atmospheric pressure at the outflow
Axis of origin: at center of pipe

Returns
status code

Definition at line 1554 of file analyticalSolutions.c.

◆ poissonsEquationExp1D()

int poissonsEquationExp1D ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]\( K \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

\[-u_{xx} - f = 0\]

\[u = K x(1-x)y(1-y)z(1-z)e^{x^2 + y^2 + z^2}\]

\[f = -K \{[y(1-y)z(1-z)][4x^3 - 4x^2 + 6x - 2]+ [x(1-x)z(1-z)][4y^3 - 4y^2 + 6y - 2]+ [x(1-x)y(1-y)][4z^3 - 4z^2 + 6z - 2]\}e^{x^2 + y^2 + z^2}\]

Returns
status code

Definition at line 1620 of file analyticalSolutions.c.

◆ poissonsEquationExp1D_r()

int poissonsEquationExp1D_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u,
double *  r 
)
Parameters
iworkNOT USED
rwork[0]\( K \)
nPointstotal number of points
tNOT USED
xinput array
uNOT USED
routput array

\[-u_{xx} - f = 0\]

\[u = K x(1-x)y(1-y)z(1-z)e^{x^2 + y^2 + z^2}\]

\[f = -K \{[y(1-y)z(1-z)][4x^3 - 4x^2 + 6x - 2]+ [x(1-x)z(1-z)][4y^3 - 4y^2 + 6y - 2]+ [x(1-x)y(1-y)][4z^3 - 4z^2 + 6z - 2]\}e^{x^2 + y^2 + z^2}\]

Returns
status code

Definition at line 1754 of file analyticalSolutions.c.

◆ poissonsEquationExp2D()

int poissonsEquationExp2D ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]\( K \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

\[-u_{xx} - f = 0\]

\[u = K x(1-x)y(1-y)z(1-z)e^{x^2 + y^2 + z^2}\]

\[f = -K \{[y(1-y)z(1-z)][4x^3 - 4x^2 + 6x - 2]+ [x(1-x)z(1-z)][4y^3 - 4y^2 + 6y - 2]+ [x(1-x)y(1-y)][4z^3 - 4z^2 + 6z - 2]\}e^{x^2 + y^2 + z^2}\]

Returns
status code

Definition at line 1659 of file analyticalSolutions.c.

◆ poissonsEquationExp2D_r()

int poissonsEquationExp2D_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u,
double *  r 
)
Parameters
iworkNOT USED
rwork[0]\( K \)
nPointstotal number of points
tNOT USED
xinput array
uNOT USED
routput array

\[-u_{xx} - f = 0\]

\[u = K x(1-x)y(1-y)z(1-z)e^{x^2 + y^2 + z^2}\]

\[f = -K \{[y(1-y)z(1-z)][4x^3 - 4x^2 + 6x - 2]+ [x(1-x)z(1-z)][4y^3 - 4y^2 + 6y - 2]+ [x(1-x)y(1-y)][4z^3 - 4z^2 + 6z - 2]\}e^{x^2 + y^2 + z^2}\]

Returns
status code

Definition at line 1787 of file analyticalSolutions.c.

◆ poissonsEquationExp3D()

int poissonsEquationExp3D ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]\( K \)
nPointstotal number of points
tNOT USED
xinput array
uoutput array

\[-u_{xx} - f = 0\]

\[u = K x(1-x)y(1-y)z(1-z)e^{x^2 + y^2 + z^2}\]

\[f = -K \{[y(1-y)z(1-z)][4x^3 - 4x^2 + 6x - 2]+ [x(1-x)z(1-z)][4y^3 - 4y^2 + 6y - 2]+ [x(1-x)y(1-y)][4z^3 - 4z^2 + 6z - 2]\}e^{x^2 + y^2 + z^2}\]

Returns
status code

Definition at line 1690 of file analyticalSolutions.c.

◆ poissonsEquationExp3D_dr()

int poissonsEquationExp3D_dr ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u,
double *  dr 
)
Parameters
iworkNOT USED
rwork[0]\( K \)
nPointstotal number of points
tNOT USED
xinput array
uNOT USED
droutput array

\[-u_{xx} - f = 0\]

\[u = K x(1-x)y(1-y)z(1-z)e^{x^2 + y^2 + z^2}\]

\[f = -K \{[y(1-y)z(1-z)][4x^3 - 4x^2 + 6x - 2]+ [x(1-x)z(1-z)][4y^3 - 4y^2 + 6y - 2]+ [x(1-x)y(1-y)][4z^3 - 4z^2 + 6z - 2]\}e^{x^2 + y^2 + z^2}\]

Returns
status code

Definition at line 1724 of file analyticalSolutions.c.

◆ poissonsEquationExp3D_r()

int poissonsEquationExp3D_r ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  X,
double *  u,
double *  r 
)
Parameters
iworkNOT USED
rwork[0]\( K \)
nPointstotal number of points
tNOT USED
xinput array
uNOT USED
routput array

\[-u_{xx} - f = 0\]

\[u = K x(1-x)y(1-y)z(1-z)e^{x^2 + y^2 + z^2}\]

\[f = -K \{[y(1-y)z(1-z)][4x^3 - 4x^2 + 6x - 2]+ [x(1-x)z(1-z)][4y^3 - 4y^2 + 6y - 2]+ [x(1-x)y(1-y)][4z^3 - 4z^2 + 6z - 2]\}e^{x^2 + y^2 + z^2}\]

Returns
status code

Definition at line 1822 of file analyticalSolutions.c.

◆ STflowSphere_P()

int STflowSphere_P ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]Sphere's x-component of velocity, \( vx \)
rwork[1]Sphere's y-component of velocity, \( vy \)
rwork[2]Sphere's z-component of velocity, \( vz \)
rwork[3]Sphere's radius, \( rs \)
rwork[4]Sphere's center x-component, \( xs \)
rwork[5]Sphere's center y-component, \( ys \)
rwork[6]Sphere's center z-component, \( zs \)
rwork[7]viscosity of fluid, \( mu \)
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[ \nabla p = \mu \nabla^2 u \]

\[ p = \frac{(-3 * rs * \mu \| \vec v\| cos\theta)}{2r^2}\]

Returns
status code

Definition at line 1864 of file analyticalSolutions.c.

◆ STflowSphere_Vx()

int STflowSphere_Vx ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
rwork[0]Sphere's x-component of velocity, \( vx \)
rwork[1]Sphere's y-component of velocity, \( vy \)
rwork[2]Sphere's z-component of velocity, \( vz \)
rwork[3]Sphere's radius, \( rs \)
rwork[4]Sphere's center x-component, \( xs \)
rwork[5]Sphere's center y-component, \( ys \)
rwork[6]Sphere's center z-component, \( zs \)
rwork[7]viscosity of fluid, \( mu \)
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[ \nabla p = \mu \nabla^2 u \]

\[ v^r = \|\vec v \| cos\theta(1-\frac{3rs}{2r} + \frac{rs^3}{2r^3})\]

\[ v^\theta = -\|\vec v \| sin\theta(1-\frac{3rs}{4r} - \frac{rs^3}{4r^3})\]

\[v^r(r>rs) = 0\]

\[v^\theta(r>rs) = 0\]

\[e^R = \frac{\vec x}{\|\vec x \|} ; \{ x_x = x - xs;x_y = y-ys; x_z = z-zs\} \]

\[e^\theta = (e^R - \frac{\vec v}{\|\vec v \|}) - [(e^R - \frac{\vec v}{\|\vec v \|}) \cdot e^R]e^R\]

\[u_x = v^r e^R_x + v^\theta e^\theta_x \]

Returns
status code

Definition at line 1929 of file analyticalSolutions.c.

◆ STflowSphere_Vy()

int STflowSphere_Vy ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]Sphere's x-component of velocity, \( vx \)
rwork[1]Sphere's y-component of velocity, \( vy \)
rwork[2]Sphere's z-component of velocity, \( vz \)
rwork[3]Sphere's radius, \( rs \)
rwork[4]Sphere's center x-component, \( xs \)
rwork[5]Sphere's center y-component, \( ys \)
rwork[6]Sphere's center z-component, \( zs \)
rwork[7]viscosity of fluid, \( mu \)
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[ \nabla p = \mu \nabla^2 u \]

\[ v^r = \|\vec v \| cos\theta(1-\frac{3rs}{2r} + \frac{rs^3}{2r^3})\]

\[ v^\theta = -\|\vec v \| sin\theta(1-\frac{3rs}{4r} - \frac{rs^3}{4r^3})\]

\[v^r(r>rs) = 0\]

\[v^\theta(r>rs) = 0\]

\[e^R = \frac{\vec x}{\|\vec x \|} ; \{ x_x = x - xs;x_y = y-ys; x_z = z-zs\} \]

\[e^\theta = (e^R - \frac{\vec v}{\|\vec v \|}) - [(e^R - \frac{\vec v}{\|\vec v \|}) \cdot e^R]e^R\]

\[u_y = v^r e^R_y + v^\theta e^\theta_y \]

Returns
status code

Definition at line 1992 of file analyticalSolutions.c.

◆ STflowSphere_Vz()

int STflowSphere_Vz ( int *  iwork,
double *  rwork,
int  nPoints,
double  t,
double *  x,
double *  u 
)
Parameters
iworkNOT USED
rwork[0]Sphere's x-component of velocity, \( vx \)
rwork[1]Sphere's y-component of velocity, \( vy \)
rwork[2]Sphere's z-component of velocity, \( vz \)
rwork[3]Sphere's radius, \( rs \)
rwork[4]Sphere's center x-component, \( xs \)
rwork[5]Sphere's center y-component, \( ys \)
rwork[6]Sphere's center z-component, \( zs \)
rwork[7]viscosity of fluid, \( mu \)
nPoints- total number of points
tNOT USED
xinput array
uoutput array

\[ \nabla p = \mu \nabla^2 u \]

\[ v^r = \|\vec v \| cos\theta(1-\frac{3rs}{2r} + \frac{rs^3}{2r^3})\]

\[ v^\theta = -\|\vec v \| sin\theta(1-\frac{3rs}{4r} - \frac{rs^3}{4r^3})\]

\[v^r(r>rs) = 0\]

\[v^\theta(r>rs) = 0\]

\[e^R = \frac{\vec x}{\|\vec x \|} ; \{ x_x = x - xs;x_y = y-ys; x_z = z-zs\} \]

\[e^\theta = (e^R - \frac{\vec v}{\|\vec v \|}) - [(e^R - \frac{\vec v}{\|\vec v \|}) \cdot e^R]e^R\]

\[u_z = v^r e^R_z + v^\theta e^\theta_z \]

Returns
status code

Definition at line 2055 of file analyticalSolutions.c.

◆ uOfX_df()

double uOfX_df ( double  nlC,
double  lu 
)

Definition at line 2177 of file analyticalSolutions.c.

◆ uOfX_f()

double uOfX_f ( double  a,
double  b,
double  nlC,
double  nlD,
double  x,
double  lu 
)

Definition at line 2181 of file analyticalSolutions.c.

◆ vel()

void vel ( double  rS,
double  norm_v,
double  r,
double  theta,
double *  vR,
double *  vTHETA 
)

Definition at line 2163 of file analyticalSolutions.c.