Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Problem # 1:   Write a finite-difference program to estimate contaminant concentration in a 1D channel, described in your notes

Problem # 1:   Write a finite-difference program to estimate contaminant concentration in a 1D channel, described in your notes

Computer Science

Problem # 1:  

Write a finite-difference program to estimate contaminant concentration in a 1D channel, described in your notes. Do this in steps:

Note: Use C = 0 everywhere to start. The diffusion coefficient is given as 0.01 m*m/s.

1. For ? = 0 & ? = 0. Diffusion only. Plot the solution for ? = 4 s and ? = 10 s. Also plot the analytical solution on this graph.

2. Set ? = 0.05 m/s, and again compare the finite-difference and analytical solution for ? = 4 s and ? = 10 s.

3. Now add the effect of the decay coefficient ? = 0.09/s and plot the finite-difference solution. (The analytical solution is only for study state, which will take quite long. So you must use your judgment about how to do this. Assume you have to persuade your client that your model is providing the correct solution. One suggestion: Try changing   ? = 0.5 /s (why??), and run the code until ? = 13 s. Not quite steady, but slow change! Now compare with the analytical steady state solution.)

4. Set ? = 0, increase ? till you violate the stability criterion. What happens? Set ? = 0 and ? = 0. Increase ?? till you violate the stability criterion. What happens?

 

Problem # 2:  

Write a random-walk code to solve the same problems as above.

1. For ? = 0 & ? = 0. Diffusion only. Plot the solution for ? = 4 s and ? = 10 s. Also plot the analytical solution on this graph.

2. Set ? = 0.05 m/s, and again compare the finite-difference and analytical solution for ? = 4 s and ? = 10 s.

3. Now add the effect of the decay coefficient ? = 0.09/s and plot the finite-difference solution. (The analytical solution is only for study state, which will take quite long. So you must use your judgment about how to do this. Assume you have to persuade your client that your model is providing the correct solution. One suggestion: Try changing   ? = 0.5 /s (why??), and run the code until ? = 13 s. Not quite steady, but slow change! Now compare with the analytical steady state solution.)

4. Set ? = 0, increase ? till you violate the stability criterion. What happens? Set ? = 0 and ? = 0. Increase ?? till you violate the stability criterion. What happens?

 

 

 

Some Additional Notes from the Professor:

For the FD and analytical solutions. First please model the problem given using the info in your notes, continuous release of contaminant at x = 1, with advection, and also decay. For u = 0.05 m/s and no decay, the conc should form skewed curves (distorted bell-shaped curves leaning in one direction) with a peak at ~ 40 gm/m3 after 4 sec and 60 gm/m3 after 10 sec. If you include the decay of 0.09/s, the peaks drop to ~35 and 48 gm/m3.

 

Note, the problem does not satisfy the requirements of the three analytical solutions, so a direct comparison is not possible.

For instance, the actual scenario (given in the notes) has a continuous release. So the Finite Diff model must be developed for that. This would be general, obviously, in terms of steady/unsteady, any type of source, with/without decay & advection, etc. Any of these can be turned on (& values specified) or off.

However, if you have to prove to a client the FD model is acceptable, you will need to validate it against the analytical solution, which has restrictions (e.g. "initial" source, not a continuous one, for instance).  So how to adapt? Limit yourself to the restrictions of the analytical case & use the FD model to simulate that case.

Use your judgment. e.g. say the source of 1gm/s comes in only for 1 sec and then stops. Now you can apply the analytical solution to this 1 gm of initial contaminant dispersing. Then go to FD code, and turn off the source after 1 second. Then the two cases would be similar, right? But, be careful:  the two solutions would be offset by 1 sec. for these reasons, right? i.e. 3 second after the release for the analytical solution would correspond to the t = 4 sec solution in the FD case.

Also, for dispersion only and the analytical case, the solution would be symmetrical. But introducing the source in the FD model at x = 1 would put the boundaries at asymmetric distances, and the application of the BC's would be asymmetric. So how could you simulate the analytical case? Just to show the general FD model works, shift the source to the middle of the channel!

Option 1

Low Cost Option
Download this past answer in few clicks

22.99 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions