//*we need to do it with C programming *//
ENGR 200 P5: CARNOT EFFICIENCY OF POWER PLANTS (if statements, loops) DUE: . U.S. Central Time POINTS: 55 INTRODUCTION: In thermodynamics, energy can be neither created nor destroyed (1st law): it is either converted to usable work or lost as waste heat. The second law of thermodynamics states that the total entropy (disorder) of a system will never decrease over time; that is, systems can only be at constant entropy or have increasing entropy. This may be restated by saying that there is an upper limit to the efficiency of the conversion of heat to work, as in a heat engine. From these principles of thermodynamics, it is clear that there is an upper limit to how efficient power generation can be at most power plants. Many power plants, including those fueled by fossil fuels, nuclear sources, geothermal sources, biomass, and solar thermal, operate by generating a source of heat (burning fossil fuels, reacting nuclear materials, using the sun’s rays, etc.), using this heat source to heat water to steam, and passing this steam through a turbine. When the turbine spins, power is generated. The maximum thermodynamic efficiency of a power plant is dictated by the temperatures of the hot reservoir (that is, the steam) and the cold reservoir (the cooling fluid in place). Ideally, the thermodynamic efficiency of the plant would be based on these temperatures, as in the Carnot cycle: η =1-T_C/T_H where η is the efficiency (unitless), TL is the temperature of the cold stream (either in Kelvin or in Rankine), and TH is the temperature of the hot stream, that is, the steam (either in Kelvin or in Rankine). You have a data file called power.txt which shows the temperatures in Kelvin of the steam (TH) and of the cooling fluid (TC) for several different power plants. This data file has a control number and is space delimited. ASSIGNMENT: Write a C program that calculates the Carnot efficiency of power plants with the provided TH and TC streams as shown in the power.txt file. The output should print as a table to the screen and to an output file called efficiency.txt. Use the “Code Sections.c” template on Blackboard to write your code. Your program output will look like the illustration shown below. Use your PC’s cursor to determine the horizontal and vertical spacing for the output format. OUTPUT FORMAT: ******************************************** POWER PLANT CARNOT EFFICIENCY STEAM TEMP COOLING TEMP EFFICIENCY xxx xxx x.xx . . . . . . . . . ******************************************** SUBMITTING ASSIGNMENTS: Once you have your program working, exit the C compiler that you are using. Make sure that your source program file name conforms to the following specifications: sn_pn_first_last where: sn is your section number (1, 2, 3, 4, 5, …) pn is the program number (1, 2, 3, 4, 5, …) first is your first name last is your last name An example for the fifth assignment would be 1_5_elmer_fudd. Submission: Submit your source program using the Assignments button in Blackboard. Remember to submit your C source program in standard ANSI C format only. No other format will be accepted. If you make changes to your program and need to resubmit, rename the file such as 1_5_elmer_fudd_2 or 1_5_elmer_fudd_3, etc. Then use the Assignments button in Blackboard to submit the new version. Only the most current submitted program version will be graded.
9 798.15 298.15 723.15 273.15 798.15 323.15 873.15 273.15 823.15 373.15 773.15 298.15 823.15 423.15 848.15 298.15 348.15 298.15
CODE:
#include <stdio.h>
#include <stdlib.h> // For exit(),atof() function
#include <string.h> //For strok()
int main()
{ //Pointer of type File: to communicate between
program and file
FILE* fp;
//Char Array to store data read from file
char line[255];
//Array to store
temperature_high,temperature_low values
float T_C[100];
float T_H[100];
//To store efficiency
float efficiency;
//Opening Power.txt in read Mode
fp = fopen("power.txt" , "r");
//Check if power.txt file is available
if(fp == NULL)
{
printf("Error Reading File
power.txt!");
exit(1);
}
//For increasing index of T_C, T_H array
int i=0;
//reading file line by line , till it gets to
end
while (fgets(line, sizeof(line), fp) !=
NULL)
{ //Splitting line w.r.t " " a
space
//Storing data before in Val1
const char* val1 =
strtok(line, " ");
//Stornig Data after space in val2
const char* val2 =
strtok(NULL, " ");
//Converting them in Float and Storing them in
respective array
T_H[i]=atof(val1);
T_C[i]=atof(val2);
//incrementing i, to store data in next iteration at
incremented index
i++;
}
//Reading Done : Closing File handler
fclose(fp);
//openin efficiency.txt in write and binary
mode
fp = fopen("efficiency.txt","wb");
if(fp == NULL)
{
printf("Error writing to file
efficiency.txt !");
exit(1);
}
printf("Efficiency :\n");
//Calculating Efficiency of each data and writing it back in
efficiency.txt
for (int j=0;j<i;j++)
{ //Calculating efficiency
efficiency=((1-T_C[j])/(T_H[j]));
printf("%f\n",efficiency);
//Writing data in efficiency.txt
fprintf(fp,"%f",efficiency);
//Writing new line after writing data in
efficiency.txt
fprintf(fp,"%s","\n");
}
//Writing Done : Closing File handler
fclose(fp);
return 0;
}
CONSOLE OUTPUT , OUTPUT FILE DATA, INPUT FILE DATA:

//*we need to do it with C programming *// ENGR 200 P5: CARNOT EFFICIENCY OF POWER...
Thermodynamics
A steam power plant operates with high pressure oft 4 MPa and hasleel receiving heat from a 700°C reservoir. The ambient air at 20°C provides cooling to maintain the water/vapor mixture in the condenser at 60°C. All components are ideal i.e., reversible) except the turbine which has an efficiency 92% of a reversible, isentropic process. Other than the irreversibility of the turbine, the power plant can be considered as a Rankine cycle. Determine the following quantities in the suggested...
A fossil-fuel steam power plant operates at about 50% of Carnot thermal efficiency. It has been suggested that the air pollution from a plant that operates at 1000 F would contribute 1/2 the pollution (per ton of coal burned) that the present system that operates at about 1500 F. The heat rejection temperature is 70 F. For the same electrical output what is the percent difference in the pollution resulting from the combustion? Assume that the thermal energy released by...
Problem 3. Rankine Cycle (90 points) A steam power plant operates with high pressure of 4 MPa and has a boiler exit at 600°C receiving heat from a 700° C reservoir. The ambient air at 20°C provides cooling to maintain the water/vapor mixture in the condenser at 60°C. All components are ideal (i.e., reversible) except the turbine which has an efficiency 92% ofa reversible isentropic process. Other than the irreversibility of the turbine, the power plant can be considered as...
Combined cycle power plants are common because of their high efficiency and scalability. They typically combine a gas turbine cycle (the Brayton Cycle) with a steam turbine cycle (the Rankine Cycle) [1]. The goal of this project is to determine the operating efficiency and profitability of a realistic combined cycle power plant. The power plant is as follows: 1. A natural gas-fired Brayton cycle with mÛ air,Br = 1.25 kg s−1 . (a) Ambient air at 1 bar and 300...
3. (40 pts) A steam power plant based on the Rankine cycle, shown in the below, operates to develop net cycle power. Saturated vapor at 8 bar enters the turbine where it expands to the condenser pressure of 1 bar. Water liquid exits the condenser 30 °C and 1 bar and it is pumped to the boiler pressure of 8 bar. Isentropic efficiencies of the turbine and pump are 80% and 60%. Assume kinetic and potential energies are negligible at...
Please need clear and good hand writing
p1 Bar : 15
p3 Bar : 0.1
O2’C : 300
nis : 88
This are the numbers for the Equation please need a clear hand
writing
bled from bêtween the Task 3 - Rankine Cycle A simple steam power plant works as follows. Water is pumped into the boiler at point (1) on the diagram. Superheated steam leaves the boiler and goes to the turbine at point (2) The steam leaving the...
4. An ideal Carnot power generation cycle using air is represented by the diagram below. The properties of the state points are given in the table below. Take the properties of air to be cp 0040.717. and RBhthe ns: and G, have been 1.004 chosen as the average values between the high temperature and low temperature processes, in order for you to not have to worry about the temperature dependence of cp and c, for this problem.) Recall that y...
I need help with this assignment in C++,
please!
*** The instructions and programming style details
are crucial for this assignment!
Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...