CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

Analytical solution to validate code

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 22, 2010, 06:55
Default Analytical solution to validate code
Senior Member
Join Date: Apr 2009
Posts: 118
Rep Power: 8
lost.identity is on a distinguished road

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?
lost.identity is offline   Reply With Quote

Old   July 22, 2010, 10:28
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 10
DoHander is on a distinguished road
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:


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.

DoHander is offline   Reply With Quote

Old   July 22, 2010, 19:38
New Member
Join Date: Apr 2009
Posts: 4
Rep Power: 8
ptb is on a distinguished road
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.
ptb is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrated conjugate heat transfer solver in OpenFOAM hjasak OpenFOAM Running, Solving & CFD 168 June 27, 2013 01:56
Analytical Solution of the equation Newbie Main CFD Forum 3 August 20, 2004 03:17
Analytical Solution of 1D Convection Diffusion Eq. Suman Kumar Main CFD Forum 7 July 15, 2003 14:05
Open source CFD code development, possible? Dr. Yazid Bindar Main CFD Forum 27 July 18, 2000 00:18
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 15:34

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