One major source of electricity is hydroelectric generation, in which flowing water is redirected to turn a turbine generator. The power generated by this water flow is given by this formula: P = rho times Q times H times g P is the power generated by the water flow (watts = J/s = kg-m^2/s^2-1/s). rho is the water density (kg/m^3). Q is the volume flow rate (m^3/s). g is the acceleration caused by gravity (9.81 m/s^2). H is the distance (in m) water falls on its way to the generator, known as the head. a. Using this formula, write, compile, and run a C++ program that determines the watts generated by a head of 14 meters of water flowing at 20 m^3/s. The density of water is 998 kg/m^3 at 20 degree C. b. After verifying that your program is working correctly, use it to determine and display a table of the watts generated by a head of 10 to 28 meters of water, in 2-meter increments, flowing at 20 m^3/s.
Hydroelectric generation is an important source of electricity, where the power is generated by redirecting the flow of water to turn a turbine generator. This power can be calculated using the formula P = ρQHg, where P represents the power generated by the water flow, ρ is the water density, Q is the volume flow rate, H is the distance (head) that the water falls, and g is the acceleration due to gravity.
To determine the watts generated by a head of 14 meters of water flowing at 20 m^3/s, we can plug in the given values into the formula:
P = ρQHg
P = (998 kg/m^3) * (20 m^3/s) * (14 m) * (9.81 m/s^2)
By solving this equation, we can calculate the power generated by the water flow.
To implement this calculation in a C++ program, we can write a code snippet as below:
“`cpp
#include
int main() {
double rho = 998; // water density (kg/m^3)
double Q = 20; // volume flow rate (m^3/s)
double H = 14; // head (m)
double g = 9.81; // acceleration due to gravity (m/s^2)
double P = rho * Q * H * g; // calculate power
std::cout << "The power generated by a head of 14 meters of water flowing at 20 m^3/s is: " << P << " watts." << std::endl;
return 0;
}
```
After compiling and running this program, you will obtain the result for the power generated.
To determine a table of watts generated by heads ranging from 10 to 28 meters of water, in 2-meter increments, flowing at 20 m^3/s, we can modify the code to include a loop:
```cpp
#include
int main() {
double rho = 998; // water density (kg/m^3)
double Q = 20; // volume flow rate (m^3/s)
double g = 9.81; // acceleration due to gravity (m/s^2)
for (int H = 10; H <= 28; H += 2) { double P = rho * Q * H * g; // calculate power std::cout << "The power generated by a head of " << H << " meters of water flowing at 20 m^3/s is: " << P << " watts." << std::endl; } return 0; } ``` This updated program will calculate and display the table of watts generated for different head values, as requested.
Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.
Click Here to Make an Order Click Here to Hire a Writer