proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
analyticalSolutions

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

Macros

#define max(a, b)

Functions

int diffusionSin1D (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Sinusoidal 1D diffusion.
int diffusionSin2D (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Sinusoidal 2D diffusion.
int diffusionSin3D (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Sinusoidal 3D diffusion.
int diffusionSin1D_r (int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
 Sinusoidal 1D diffusion (reaction).
int diffusionSin2D_r (int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
 Sinusoidal 2D diffusion (reaction).
int diffusionSin3D_r (int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
 Sinusoidal 3D diffusion (reaction).
int LinearAD_DiracIC (int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
 Linear Advective Diffusion Dirac Initial Condition.
int LinearAD_DiracIC_advectiveVelocity (int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
 Linear Advective Diffusion Dirac Initial Condition(advective velocity).
int LinearAD_DiracIC_diffusiveVelocity (int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
 Linear Advective Diffusion Dirac Initial Condition(diffusive velocity).
int LinearAD_DiracIC_du (int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
 Linear Advective Diffusion Dirac Initial Condition (du).
int LinearAD_DiracIC_totalVelocity (int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
 Linear Advective Diffusion Dirac Initial Condition(total velocity).
int LinearAD_SteadyState (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Linear Advection-Diffusion Steady State.
int LinearADR_Decay_DiracIC (int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
 Linear Avection Diffusion Reaction Decay Dirac Initial Condition.
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).
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).
int LinearADR_Sine (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Linear Avection Diffusion Reaction Sine function.
int LinearADR_Sine_advectiveVelocity (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Linear Avection Diffusion Reaction Sine function (advective velocity).
int LinearADR_Sine_diffusiveVelocity (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Linear Avection Diffusion Reaction Sine function (diffusive velocity).
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).
int LinearADR_Sine_du (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Linear Avection Diffusion Reaction Sine function (du).
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).
int LinearADR_Sine_totalVelocity (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Linear Avection Diffusion Reaction Sine function (total velocity).
int NonlinearAD_SteadyState (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Nonlinear Advection-Diffusion Steady State.
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.
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).
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).
int NonlinearDAE (int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
 Nonlinear Differential-algebraic equations.
int NonlinearDAE_f (int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
 Nonlinear Differential-algebraic equations.
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).
int PoiseuillePipeFlow (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Poiseuille Flow through a circular pipe.
int PoiseuillePipeFlow_P (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Poiseuille Flow through a circular pipe.
int poissonsEquationExp1D (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Poisson Exponential Equation 1D.
int poissonsEquationExp2D (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Poisson Exponential Equation 2D.
int poissonsEquationExp3D (int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
 Poisson Exponential Equation 3D.
int poissonsEquationExp3D_dr (int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *dr)
 Poisson Exponential Equation 3D (dr).
int poissonsEquationExp1D_r (int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
 Poisson Exponential Equation 1D (reaction).
int poissonsEquationExp2D_r (int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
 Poisson Exponential Equation 2D (reaction).
int poissonsEquationExp3D_r (int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
 Poisson Exponential Equation 3D (reaction).
int STflowSphere_P (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Stokes Flow around moving Sphere.
int STflowSphere_Vx (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Stokes Flow around moving Sphere.
int STflowSphere_Vy (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Stokes Flow around moving Sphere.
int STflowSphere_Vz (int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
 Stokes Flow around moving Sphere.
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).

Detailed Description

Macro Definition Documentation

◆ max

#define max ( a,
b )
Value:
(((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 )
extern

Definition at line 2093 of file analyticalSolutions.c.

◆ df()

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

Definition at line 2209 of file analyticalSolutions.c.

◆ diffusionSin1D()

int diffusionSin1D ( int * iwork,
double * rwork,
int nPoints,
double t,
double * x,
double * u )
extern
Parameters
-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 )
extern
Parameters
-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 )
extern
Parameters
-x-component angular frequency, \( \omega_x \)
iworky-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 )
extern
Parameters
-x-component angular frequency, \( omega_x \)
iworky-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 )
extern
Parameters
-x-component angular frequency, \( \omega_x \)
iworky-component angular frequency, \( \omega_y \)
rworkz-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 )
extern
Parameters
-x-component angular frequency, \( omega_x \)
iworky-component angular frequency, \( omega_y \)
rworkz-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 )
extern

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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
u\( u_0 \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
f\( u_0 \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
f\( u_0 \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
f\( u_0 \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
f\( u_0 \)
-\( 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 )
extern
Parameters
iworkNOT USED
-\( b \)
iwork\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
u\( u_0 \)
-\( x_0[0:2] \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
u\( u_0 \)
-\( x_0[0:2] \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
u\( u_0 \)
-\( x_0[0:2] \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( \omega[0:2] \)
nPoints\( \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 )
extern
Parameters
iworkNOT USED
rwork\( \omega[0:2] \)
nPoints\( \omega_0 \)
f\( b[0:2] \)
-\( a[0:3,0:3] \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( \omega[0:2] \)
nPoints\( \omega_0 \)
f\( b[0:2] \)
-\( a[0:3,0:3] \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( \omega[0:2] \)
nPoints\( \omega_0 \)
u\( b[0:2] \)
-\( a[0:3,0:3] \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( \omega[0:2] \)
nPoints\( \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 )
extern
Parameters
iworkNOT USED
rwork\( \omega[0:2] \)
nPoints\( \omega_0 \)
u\( b[0:2] \)
-\( a[0:3,0:3] \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( \omega[0:2] \)
nPoints\( \omega_0 \)
f\( b[0:2] \)
-\( a[0:3,0:3] \)
-\( 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 )
extern
Parameters
iworkNOT USED
-\( q \)
iwork\( r \)
rwork\( b \)
nPoints\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
u\( u_0 \)
-\( x_0[0:2] \)
-\( c \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
u\( u_0 \)
-\( x_0[0:2] \)
-\( c \)
-\( 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 )
extern
Parameters
iworkNOT USED
rwork\( b[0:2] \)
nPoints\( n \)
T\( a \)
x\( tStart \)
u\( u_0 \)
-\( x_0[0:2] \)
-\( c \)
-\( 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 )
extern
Parameters
iworkNOT USED
-\( a \)
iwork\( 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 )
extern
Parameters
iworkNOT USED
-\( a \)
iwork\( 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
-velocity of moving plate in the x-dir, \( vx \)
iworkwidth between plates, \( h \)
rworkx-axis offset, \( xs \)
nPointsy-axis offset, \( ys \)
tz-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 )
extern
Parameters
iworkNOT USED
-width between the plates, \( h \)
iworkviscosity of fluid, \( \mu \)
rworkthe pressure gradient, \( \nabla p \) (neg)
nPointsthe rate of flow per unit width, \( q \)
tx-axis offset, \( xs \)
xy-axis offset, \( ys \)
uz-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 )
extern
Parameters
iworkNOT USED
-radius of pipe, \( R \)
iworkviscosity of fluid, \( \mu \)
rworkthe pressure gradient, \( \nabla p \) (neg)
nPointsthe rate of flow, \( Q \)
tx-axis offset, \( xs \)
xy-axis offset, \( ys \)
uz-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 )
extern
Parameters
iworkNOT USED
-radius of pipe, \( R \)
iworkviscosity of fluid, \( \mu \)
rworkthe pressure gradient, \( \nabla p \) (neg)
nPointsthe rate of flow, \( Q \)
nPointsthe length of pipe, \( L \)
tx-axis offset, \( xs \)
xy-axis offset, \( ys \)
uz-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 )
extern
Parameters
iworkNOT USED
-\( 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 )
extern
Parameters
iworkNOT USED
-\( 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 )
extern
Parameters
iworkNOT USED
-\( 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 )
extern
Parameters
iworkNOT USED
-\( 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 )
extern
Parameters
iworkNOT USED
-\( 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 )
extern
Parameters
iworkNOT USED
-\( 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 )
extern
Parameters
iworkNOT USED
-\( 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 )
extern
Parameters
iworkNOT USED
-Sphere's x-component of velocity, \( vx \)
iworkSphere's y-component of velocity, \( vy \)
rworkSphere's z-component of velocity, \( vz \)
nPointsSphere's radius, \( rs \)
tSphere's center x-component, \( xs \)
xSphere's center y-component, \( ys \)
uSphere's center z-component, \( zs \)
-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 )
extern
Parameters
-Sphere's x-component of velocity, \( vx \)
iworkSphere's y-component of velocity, \( vy \)
rworkSphere's z-component of velocity, \( vz \)
nPointsSphere's radius, \( rs \)
tSphere's center x-component, \( xs \)
xSphere's center y-component, \( ys \)
uSphere's center z-component, \( zs \)
-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 )
extern
Parameters
iworkNOT USED
-Sphere's x-component of velocity, \( vx \)
iworkSphere's y-component of velocity, \( vy \)
rworkSphere's z-component of velocity, \( vz \)
nPointsSphere's radius, \( rs \)
tSphere's center x-component, \( xs \)
xSphere's center y-component, \( ys \)
uSphere's center z-component, \( zs \)
-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 )
extern
Parameters
iworkNOT USED
-Sphere's x-component of velocity, \( vx \)
iworkSphere's y-component of velocity, \( vy \)
rworkSphere's z-component of velocity, \( vz \)
nPointsSphere's radius, \( rs \)
tSphere's center x-component, \( xs \)
xSphere's center y-component, \( ys \)
uSphere's center z-component, \( zs \)
-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 )
extern

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 )
extern

Definition at line 2181 of file analyticalSolutions.c.

◆ vel()

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

Definition at line 2163 of file analyticalSolutions.c.