proteus.AnalyticalSolutions module
Classes representing analytical solutions of differential and partial differential equations.
- class proteus.AnalyticalSolutions.AS_base[source]
Bases:
object
The base class for general analytical solutions, u(x,y,z,t)
For basic error calculations only the
uOfXT()
member need be overridden. The vectorized member functions such asgetUOfXT()
are provided for future optimizations but are implemented inAS_base
in a simple, inefficient way.- rOfUX(u, x)[source]
Return the reaction term for the (manufactured) solution at a 3D point, X, and a time, T
- drOfUX(u, x)[source]
Return the derivative of the reaction term for the (manufactured) solution at a 3D point, X, and a time, T
- getDUOfXT(X, T, DU)[source]
Set the gradient of the solution, DU, at an array of 3D points, X, and a time, T
- getDROfUX(X, T, DR)[source]
Set the derivative of the reaction term, DR, at an array of 3D points, X, and a time, T
- getAdvectiveFluxOfXT(X, T, F)[source]
Set the advective flux, F, at an array of 3D points, X, and a time, T
- class proteus.AnalyticalSolutions.DAE_base[source]
Bases:
proteus.AnalyticalSolutions.AS_base
The base class for differential-algebraic equation solutions
To use this class override
uOfT()
- class proteus.AnalyticalSolutions.NonlinearDAE(a, p)[source]
Bases:
proteus.AnalyticalSolutions.DAE_base
The exact solution of the simple nonlinear DAE
Set the coefficients a and p
- class proteus.AnalyticalSolutions.SteadyState[source]
Bases:
proteus.AnalyticalSolutions.AS_base
Based class for steady-state solutions u(x)
Override
uOfX()
to define steady state solutions.
- class proteus.AnalyticalSolutions.LinearAD_SteadyState(b=1.0, a=0.5)[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
The solution of the steady linear advection-diffusion equation
The boundary value problem is
- class proteus.AnalyticalSolutions.NonlinearAD_SteadyState(b=1.0, q=2, a=0.5, r=1)[source]
Bases:
proteus.AnalyticalSolutions.LinearAD_SteadyState
The solution of a steady nonlinear advection-diffusion equation
The boundary value problem is
Currently \(q=1,r=2\), and \(r=2,q=1\) are implemented
- class proteus.AnalyticalSolutions.LinearADR_Sine(b=array([1., 0., 0.]), a=array([[0.01, 0., 0.], [0., 0.01, 0.], [0., 0., 0.01]]), c=1.0, omega=array([6.28318531, 0., 0.]), omega0=0.0)[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
An exact solution and source term for
\[\nabla \cdot (\mathbf{b} u - \mathbf{a} \nabla u) + c u + d = 0\]The solution and source are
\begin{eqnarray} u(x) &=& \sin[\mathbf{\omega} \cdot \mathbf{x} + \omega_0) ] = \sin(Ax - b) \\ r(u,x) &=& - ((\mathbf{a} \mathbf{\omega}) \cdot \mathbf{\omega}) u \\ & & - (\mathbf{b} \cdot \omega) \cos(Ax - b) \\ &=& c u + D \cos(Ax - b) \\ &=& cu + d \end{eqnarray}also returns the advective, diffusive, and total flux at a point.
Set the coefficients a,b,c,omega, and omega0
- rOfUX(u, x)[source]
Return the reaction term for the (manufactured) solution at a 3D point, X, and a time, T
- class proteus.AnalyticalSolutions.PoissonsEquation(K=10.0, nd=3)[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
Manufactured solution of Poisson’s equation
\[- \Delta u - f = 0\]where u and f are given by
\begin{eqnarray} 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} \end{eqnarray}
- class proteus.AnalyticalSolutions.LinearAD_DiracIC(n=1.0, b=array([1., 0., 0.]), a=0.01, tStart=0.0, u0=0.1, x0=array([0., 0., 0.]))[source]
Bases:
proteus.AnalyticalSolutions.AS_base
The exact solution of
\[u_t + \nabla \cdot (b u - a \nabla u) = 0\]on an infinite domain with dirac initial data
\[u0 = \int u0 \delta(x - x0)\]also returns advective, diffusive, and total flux
- class proteus.AnalyticalSolutions.LinearADR_Decay_DiracIC(n=1.0, b=array([1., 0., 0.]), a=0.01, c=1.0, tStart=0.0, u0=0.1, x0=array([0., 0., 0.]))[source]
Bases:
proteus.AnalyticalSolutions.LinearAD_DiracIC
The exact solution of
\[u_t + \nabla \cdot (bu - a \nabla u) + cu= 0\]on an infinite domain with Dirac initial data. Also returns the fluxes (by inheritance).
- class proteus.AnalyticalSolutions.NonlinearADR_Decay_DiracIC(n=1.0, b=array([1., 0., 0.]), a=0.01, c=1.0, d=2.0, tStart=0.0, u0=0.1, x0=array([0., 0., 0.]))[source]
Bases:
proteus.AnalyticalSolutions.LinearADR_Decay_DiracIC
The approximate analytical solution of
\[u_t + \nabla \cdot (bu - a \nabla u) + cu^d= 0\]on an infinite domain with Dirac initial data. Also returns the fluxes (by inheritance).
- class proteus.AnalyticalSolutions.PlaneCouetteFlow_u(plateSeperation=1.0, upperPlateVelocity=0.01, origin=[0.0, 0.0, 0.0])[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
The exact solution for the u component of velocity in plane Couette Flow
- class proteus.AnalyticalSolutions.PlaneCouetteFlow_v(plateSeperation=1.0, upperPlateVelocity=0.01, origin=[0.0, 0.0, 0.0])[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
The exact solution for the v component of velocity in plane Couette Flow
- class proteus.AnalyticalSolutions.PlaneCouetteFlow_p(plateSeperation=1.0, upperPlateVelocity=0.01, origin=[0.0, 0.0, 0.0])[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
The exact solution for the v component of velocity in plane Couette Flow
- class proteus.AnalyticalSolutions.PlanePoiseuilleFlow_u(plateSeperation=1.0, mu=1.0, grad_p=1.0, q=0.0, origin=[0.0, 0.0, 0.0])[source]
- class proteus.AnalyticalSolutions.PlanePoiseuilleFlow_v(plateSeperation=1.0, mu=1.0, grad_p=1.0, q=0.0, origin=[0.0, 0.0, 0.0])[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
The exact solution for the v component of velocity in plane Poiseuille Flow
- class proteus.AnalyticalSolutions.PlanePoiseuilleFlow_p(plateSeperation=1.0, mu=1.0, grad_p=1.0, q=0.0, origin=[0.0, 0.0, 0.0])[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
The exact solution for the v component of velocity in plane Poiseuille Flow
- class proteus.AnalyticalSolutions.Buckley_Leverett_RiemannSoln(coefficients, uLeft=1.0, uRight=0.0, t0=0.0, x0=0.0, T=0.5, ftol=1e-08, useShallowCopyCoef=True)[source]
- class proteus.AnalyticalSolutions.PlaneBase(plane_theta=0.0, plane_phi=1.5707963267948966, v_theta=1.5707963267948966, v_phi=None, v_norm=1.0, mu=1.0, grad_p=1.0, L=[1.0, 1.0, 1.0])[source]
Bases:
proteus.AnalyticalSolutions.SteadyState
The exact solution for the u component of velocity in plane Poiseuille Flow
- class proteus.AnalyticalSolutions.PlanePoiseuilleFlow_u2(plane_theta=0.0, plane_phi=1.5707963267948966, v_theta=1.5707963267948966, v_phi=None, v_norm=1.0, mu=1.0, grad_p=1.0, L=[1.0, 1.0, 1.0])[source]
Bases:
proteus.AnalyticalSolutions.PlaneBase
The exact solution for the u component of velocity in plane Poiseuille Flow
- class proteus.AnalyticalSolutions.PlanePoiseuilleFlow_v2(plane_theta=0.0, plane_phi=1.5707963267948966, v_theta=1.5707963267948966, v_phi=None, v_norm=1.0, mu=1.0, grad_p=1.0, L=[1.0, 1.0, 1.0])[source]
Bases:
proteus.AnalyticalSolutions.PlaneBase
The exact solution for the v component of velocity in plane Poiseuille Flow
- class proteus.AnalyticalSolutions.PlanePoiseuilleFlow_w2(plane_theta=0.0, plane_phi=1.5707963267948966, v_theta=1.5707963267948966, v_phi=None, v_norm=1.0, mu=1.0, grad_p=1.0, L=[1.0, 1.0, 1.0])[source]
Bases:
proteus.AnalyticalSolutions.PlaneBase
The exact solution for the v component of velocity in plane Poiseuille Flow
- class proteus.AnalyticalSolutions.PlanePoiseuilleFlow_p2(plane_theta=0.0, plane_phi=1.5707963267948966, v_theta=1.5707963267948966, v_phi=None, v_norm=1.0, mu=1.0, grad_p=1.0, L=[1.0, 1.0, 1.0])[source]
Bases:
proteus.AnalyticalSolutions.PlaneBase
The exact solution for the v component of velocity in plane Poiseuille Flow
- class proteus.AnalyticalSolutions.VortexDecay_u(n=2, Re=100.0)[source]
Bases:
proteus.AnalyticalSolutions.AS_base
The exact solution for the u component of velocity in the vortex decay problem
- class proteus.AnalyticalSolutions.VortexDecay_v(n=2, Re=100.0)[source]
Bases:
proteus.AnalyticalSolutions.AS_base
The exact solution for the u component of velocity in the vortex decay problem
- class proteus.AnalyticalSolutions.VortexDecay_p(n=2, Re=100.0)[source]
Bases:
proteus.AnalyticalSolutions.AS_base
The exact solution for the u component of velocity in the vortex decay problem