vba代写: CIEG 430

UNIVERSITY OF DELAWARE
Department of Civil and Environmental Engineering _____________________________________________________________________

CIEG 430

Spring 2018 Midterm Examination

Kathleen S. Boone

WATER QUALITY MODELING

Date Assigned

Date Due

15 March 2018

5 April 2018

Open Book Examination. You may use your textbook and any notes from the course. Do not cooperate with any other student or obtain help from anyone. The university catalog contains the following

The minimum sanction for cases of proven cheating is an automatic failure for

the course and/or expulsion from graduate studies at the University.

Include a statement declaring that you have not received any outside help and sign the statement. The exam will not be accepted if that statement is not included.

Submit the answers in spreadsheet form as usual both as hard copy and on Canvas. Please make sure that the printed spreadsheets are readable. Print out the VBA code as well. Improperly formatted exams will be penalized.

Problem Background

The downstream reach of the Sacramento River in California receives the treated effluent from the City of Sacramento at mile point 53, the single significant input in this region. The longitudinal profiles of flow, cross-sectional area, depth, biochemical oxygen demand and dissolved oxygen are shown below and in the attached spreadsheet for a five-day period in the fall of 1960. Assume the water temperature is 15 oC. There are flow withdrawals as shown. The table of BOD, DO, and interpolated stream data are listed below and are included in the spreadsheet.

1. Overplot the actual data and the interpolated stream data for flow, cross sectional area, and depth to check that the interpolation is a reasonable approximation.

1

CIEG 430 Boone

  1. VBA Code:
    1. Write VBA function for the O’Connor Dobbins formula reaeration the

      temperature correction and for DO saturation concentration with temperature

      correction using the equations in Chapra.

    2. Update and rewrite if necessary the VBA functions that compute the BOD and

      DO solution in a segment with constant parameters using the Euler numerical integration method. Carefully document the code. Include the equations being solved in the comments. Include a print outs of the code as part of this exam.

  2. Set up your model computation to apply the function in segments of one mile in length corresponding to the interpolated data. For each segment of the model compute the reaeration coefficient and the DO saturation concentration using the functions developed in (2)
  3. In a separate worksheet, check the code using a simple two segment model with constant parameters for each segment and the analytical solutions for BOD and DO. Use the geometry in segment 1 of the Sacramento River for the first segment and double the depth and half the flow for the second segment. Make each segment 20 miles long.

a. Program the analytical solutions as VBA functions.

  1. In a separate worksheet, set up plots of BOD5 and DO data (see plots below) that will

    be used to compare model output to data. Remember to plot experimental data as

    points and model values as lines.

  2. In a separate worksheet, fit the models to the Sacramento River data as follows: Use a

    single kd. Estimate the parameters that produce the best fit of both the BOD5 and DO data. Use an “eyeball” fit, i.e. play around with the parameters until the fits are “reasonable” for both BOD5 and DO. After approximately mile point 25, the river becomes more like an estuary and the stream model no longer applies, so ignore the data after mile point 25. Compute the RMSE of the model fit to the BOD5 and DO so that the quality of the fit can be assessed. Fit the following parameters

    1. The initial BOD5 and DO deficit concentrations at mile 60.
    2. The Sacramento treatment plant BOD5 loading rate in lbs/day at mile 53
    3. The ultimate to 5 day BOD ratio
    4. A single deoxygenation coefficient, kd (/day)
  3. Compare the values that you obtain to values that are reasonable for primary effluent. 2

CIEG 430 Boone

3

CIEG 430 Boone

4

CIEG 430 Boone