Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please let me know if you need any more information. I'll edit or post the same question with the information Calculating the flow in a

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

Please let me know if you need any more information. I'll edit or post the same question with the information

Calculating the flow in a rectangular channel for a variety of construction materials and slopes Background The design of a rectangular channel must take into account a range of factors. For example, if you use the Manning formula, which this assignment will be, width, depth, slope of the actual channel and the material of construction are what you have to take into account. Figure 1: An open channel in north western Victoria An example of an open channel can be seen in Figure 1. In the picture shown, this channel is taking water through an orchard. This assignment is limited to a rectangular channel shape and flows will be calculated using the Manning Equation'. Flow direction rise. b run Figure 2: Channel cross section Figure 3: Channel longitudinal Manning is a relatively simple equation with the required parameters illustrated in Figures 2 & 3. The formula gives you the velocity of the flow, which if in turn is multiplied by the channel cross sectional area will give you the flow rate. Manning Equation velocity=(-_R.6750.5 ) where A R. = Hydraulic Radius= P where A=area=bxy P=wetted perimeter =b+2 y and S=bed slope = rise run and 2 n=Manning roughness factor Now to get the flow rate, the calculated velocity is simply multiplied by the area, the same area as calculated for Rh. flow rate=(bxy) 12 Depth (m) -> 10 Please enter the slope parameters: Rise (m) -> 1 Run (m) -> 100 The channel 10 12 Material slope 0.01 0.06 0.11 0.16 0.21 Asphalt 1810.13 | 4433.90 Cast Iron 17235.91 18061.06 Concrete - * 24255.48 24848.61 Gravel * 15473.59 15727.69 Natural ch* 6843.48 6928.08 | 7240.53 | 19607.46 25994.31 | 16223.95 | 7094.24 10078.39 121721.60 127623.89 | 16941.11 | 7336.44 |12926.94 124255.48 29657.72 | 17852.57 | 7647.44 Figure 4: Example App output For example, as can be seen in Figure 4, the first material of construction is Asphalt. The channel has an initial bed slope of 0.01 and for this pair a flow rate is calculated. The slope is then incremented by 0.05, 0.06, the flow calculated again, the slope incremented by 0.05, 0.11, flow calculated and so on. This is repeated for each of the five materials that are in the parameter file. n.b. Figure 4 is only an example. The app must be able to handle different materials and different slopes, providing the correct flow rates. Programming Tasks Your task is to develop a working C program that will: Automatically open a data file that contains the Manning roughness values. There should be five entries, one per line, in this file. Each line will consist of a name for the material and the associated roughness. The name of the file is up to the developer but should reflect the contents of the file. Open then read the data file. If the file is not found, appropriate action should be taken. Ask the user for the appropriate geometric values, channel width & depth, rise and run. There should be range checking on the depth only. The user must enter a positive number. Draw a shape, using stars and dashes that gives an indication of the size of the channel. Refer to Figure 4. In this example, you will see that the input width is 12m hence there are 12 stars between the walls. The depth is 10m hence there are 10 stars from the base to the water surface. The water surface consists of stars and dashes. There should be one star above the water surface. The dimensions of the channel should also be labelled approximately as shown in the figure. Obviously the size & shape will change depending upon the entered channel dimensions. A table should be created that has the slope as the X axis and the materials as they axis, refer to the bottom section of Figure 4. None of the information in the table shall be hard coded it should all be either read from the data file or calculated. If the name of a material is changed in the file, the entry in the Y axis will change. If the initial slope is changed, due to different data entry, then the slope values will also change. The flow rates will to be calculated for each material/slope pair. The channel shape and the results table will need to be written to both the screen and a text file. The text file shall be named the AdventuresOfZorro.txt. The opening of the results file must be checked to ensure it is successful. If not successful, an error message output and appropriate action taken. You should demonstrate good programming practise, making use of functions and return values. As files are being opened, care should be taken to ensure the opening has actually succeeded. Magic Numbers should not be used. The code should be well laid out and consistent in format. Variable names are expected to provide an indication of their purpose. Surface Material Asbestos cement Asphalt Brass Brick and cement mortar sewers Canvas Cast or Ductile iron, new Clay tile Concrete - steel forms Concrete (Cement) - finished Concrete - wooden forms Concrete - centrifugally spun Copper Corrugated metal Earth, smooth Earth channel - clean Earth channel - gravelly Earth channel - weedy Earth channel - stony, cobbles Floodplains - pasture, farmland Floodplains - light brush Floodplains - heavy brush Floodplains - trees Galvanized iron Glass Gravel, firm Lead Masonry Metal - corrugated Natural streams - clean and straight Natural streams - major rivers Natural streams - sluggish with deep pools Natural channels, very poor condition Plastic Polyethylene PE - Corrugated with smooth inner walls Polyethylene PE - Corrugated with corrugated inner walls Polyvinyl Chloride PVC - with smooth inner walls Rubble Masonry Steel - Coal-tar enamel Steel - smooth Steel - New unlined Steel - Riveted Vitrified clay sewer pipe Wood - planed Wood - unplaned Wood stave pipe, small diameter Wood stave pipe, large diameter Manning's Roughness Coefficient -n- 0.011 0.016 0.011 0.015 0.012 0.012 0.014 0.011 0.012 0.015 0.013 0.011 0.022 0.018 0.022 0.025 0.030 0.035 0.035 0.050 0.075 0.15 0.016 0.010 0.023 0.011 0.025 0.022 0.030 0.035 0.040 0.060 0.009 0.009 -0.015 0.018 -0.025 0.009 -0.011 0.017 -0.022 0.010 0.012 0.011 0.019 0.013 -0.015 0.012 0.013 0.011 -0.012 0.012 -0.013 Calculating the flow in a rectangular channel for a variety of construction materials and slopes Background The design of a rectangular channel must take into account a range of factors. For example, if you use the Manning formula, which this assignment will be, width, depth, slope of the actual channel and the material of construction are what you have to take into account. Figure 1: An open channel in north western Victoria An example of an open channel can be seen in Figure 1. In the picture shown, this channel is taking water through an orchard. This assignment is limited to a rectangular channel shape and flows will be calculated using the Manning Equation'. Flow direction rise. b run Figure 2: Channel cross section Figure 3: Channel longitudinal Manning is a relatively simple equation with the required parameters illustrated in Figures 2 & 3. The formula gives you the velocity of the flow, which if in turn is multiplied by the channel cross sectional area will give you the flow rate. Manning Equation velocity=(-_R.6750.5 ) where A R. = Hydraulic Radius= P where A=area=bxy P=wetted perimeter =b+2 y and S=bed slope = rise run and 2 n=Manning roughness factor Now to get the flow rate, the calculated velocity is simply multiplied by the area, the same area as calculated for Rh. flow rate=(bxy) 12 Depth (m) -> 10 Please enter the slope parameters: Rise (m) -> 1 Run (m) -> 100 The channel 10 12 Material slope 0.01 0.06 0.11 0.16 0.21 Asphalt 1810.13 | 4433.90 Cast Iron 17235.91 18061.06 Concrete - * 24255.48 24848.61 Gravel * 15473.59 15727.69 Natural ch* 6843.48 6928.08 | 7240.53 | 19607.46 25994.31 | 16223.95 | 7094.24 10078.39 121721.60 127623.89 | 16941.11 | 7336.44 |12926.94 124255.48 29657.72 | 17852.57 | 7647.44 Figure 4: Example App output For example, as can be seen in Figure 4, the first material of construction is Asphalt. The channel has an initial bed slope of 0.01 and for this pair a flow rate is calculated. The slope is then incremented by 0.05, 0.06, the flow calculated again, the slope incremented by 0.05, 0.11, flow calculated and so on. This is repeated for each of the five materials that are in the parameter file. n.b. Figure 4 is only an example. The app must be able to handle different materials and different slopes, providing the correct flow rates. Programming Tasks Your task is to develop a working C program that will: Automatically open a data file that contains the Manning roughness values. There should be five entries, one per line, in this file. Each line will consist of a name for the material and the associated roughness. The name of the file is up to the developer but should reflect the contents of the file. Open then read the data file. If the file is not found, appropriate action should be taken. Ask the user for the appropriate geometric values, channel width & depth, rise and run. There should be range checking on the depth only. The user must enter a positive number. Draw a shape, using stars and dashes that gives an indication of the size of the channel. Refer to Figure 4. In this example, you will see that the input width is 12m hence there are 12 stars between the walls. The depth is 10m hence there are 10 stars from the base to the water surface. The water surface consists of stars and dashes. There should be one star above the water surface. The dimensions of the channel should also be labelled approximately as shown in the figure. Obviously the size & shape will change depending upon the entered channel dimensions. A table should be created that has the slope as the X axis and the materials as they axis, refer to the bottom section of Figure 4. None of the information in the table shall be hard coded it should all be either read from the data file or calculated. If the name of a material is changed in the file, the entry in the Y axis will change. If the initial slope is changed, due to different data entry, then the slope values will also change. The flow rates will to be calculated for each material/slope pair. The channel shape and the results table will need to be written to both the screen and a text file. The text file shall be named the AdventuresOfZorro.txt. The opening of the results file must be checked to ensure it is successful. If not successful, an error message output and appropriate action taken. You should demonstrate good programming practise, making use of functions and return values. As files are being opened, care should be taken to ensure the opening has actually succeeded. Magic Numbers should not be used. The code should be well laid out and consistent in format. Variable names are expected to provide an indication of their purpose. Surface Material Asbestos cement Asphalt Brass Brick and cement mortar sewers Canvas Cast or Ductile iron, new Clay tile Concrete - steel forms Concrete (Cement) - finished Concrete - wooden forms Concrete - centrifugally spun Copper Corrugated metal Earth, smooth Earth channel - clean Earth channel - gravelly Earth channel - weedy Earth channel - stony, cobbles Floodplains - pasture, farmland Floodplains - light brush Floodplains - heavy brush Floodplains - trees Galvanized iron Glass Gravel, firm Lead Masonry Metal - corrugated Natural streams - clean and straight Natural streams - major rivers Natural streams - sluggish with deep pools Natural channels, very poor condition Plastic Polyethylene PE - Corrugated with smooth inner walls Polyethylene PE - Corrugated with corrugated inner walls Polyvinyl Chloride PVC - with smooth inner walls Rubble Masonry Steel - Coal-tar enamel Steel - smooth Steel - New unlined Steel - Riveted Vitrified clay sewer pipe Wood - planed Wood - unplaned Wood stave pipe, small diameter Wood stave pipe, large diameter Manning's Roughness Coefficient -n- 0.011 0.016 0.011 0.015 0.012 0.012 0.014 0.011 0.012 0.015 0.013 0.011 0.022 0.018 0.022 0.025 0.030 0.035 0.035 0.050 0.075 0.15 0.016 0.010 0.023 0.011 0.025 0.022 0.030 0.035 0.040 0.060 0.009 0.009 -0.015 0.018 -0.025 0.009 -0.011 0.017 -0.022 0.010 0.012 0.011 0.019 0.013 -0.015 0.012 0.013 0.011 -0.012 0.012 -0.013

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Distinguish between formal and informal reports.

Answered: 1 week ago