1D advection-diffusion-need to check my code; any suggestions?

  • Context: Undergrad 
  • Thread starter Thread starter bzz77
  • Start date Start date
  • Tags Tags
    1d Code Suggestions
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 5K views
bzz77
Messages
33
Reaction score
0
1D advection-diffusion--need to check my code; any suggestions?

Hi everyone:

I am teaching myself transport/programming, and have created a simple program for 1-D advection-diffusion (constant velocity, diffusion coefficient, central differencing, Crank-Nicolson).

I would like to check that my code is working properly and would appreciate any advice about how to go about this. I have not been successful on Google at finding code that others have written... If anyone can direct me or provide advice about getting an analytical solution, I would be very grateful. An EXCEL-based spreadsheet or a Matlab or a c++ implementation would be useful; I am not a Fortran or C user.
 
Physics news on Phys.org


probably the best way is to find a textbook problem and see if your solution agrees with the book's.