CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Analytical solution to validate code (https://www.cfd-online.com/Forums/main/78462-analytical-solution-validate-code.html)

lost.identity July 22, 2010 06:55

Analytical solution to validate code
 
Hi

I'm trying to validate my code written in spherical coordinates with some small analytical test cases.

I've already tested it with pure diffusion (in spherical coordinates). But now I want to test it with a pure convection.

The equation I'm interested in solving is (spherically symmetric, only radial dependence required)

\frac{\partial{\phi}}{\partial{t}}  + \frac{1}{r^2}\frac{\partial}{\partial{r}}(r^2u_r\phi) = 0

where u_r is the radial velocity and \phi is the scalar variable.

This is different to the linear advection equation since I'm not assuming that the velocity is constant.

Does anyone know how I could obtain an analytical solution to the above equation or would it be better to just check it with a linear advection equation?

DoHander July 22, 2010 10:28

You should be able to obtain an analytical solution if for example you take u_{r} as being constant.

Or you can try to assume an analytical variation for this, say:

u_{r}=1/r^{2}

Once you've picked an expression in r for u_{r} you can differentiate and try to find solutions of the form:

\Phi = F(r)T(t)

If you are lucky you should be able to find a series solution for your function.

Do

ptb July 22, 2010 19:38

Not to be too nit-picky but I think technically you are verifying your code. One really powerful tool for code verification is the method of manufactured solutions. Two good articles to get started are:

P. J. Roache, Code Verification by the Method of Manufactured Solutions, Journal Fluids Engineering, Vol 124 pp4-10 March 2002

K. Salari and P. Knupp, Code Verification by the Method of Manufactured Solutions, Sandia Report SAND2000-1444, June 2000

Good luck.


All times are GMT -4. The time now is 14:43.