Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The vapor pressure of a species is a measure of its volatility. If a substance h

ID: 3801767 • Letter: T

Question

The vapor pressure of a species is a measure of its volatility. If a substance has a high vapor pressure at a given temperature, its volatility is greater (that is, more of that substance is in the gas phase). It is important to know vapor pressure for many engineering applications, especially relating to separation of two substances. Two equations that may be used to estimate the vapor pressure of pure substances are the Clausius-Clapeyron equation (1) and the empirical Antoine equation (2): lnp^*=-(_V)/RT+D (1) where p* is the vapor pressure of the pure species in mm Hg, _V is the specific enthalpy of the species in question, R is the universal gas constant, T is the temperature in Kelvin, and D is a species-specific constant; and log_10 p^*=A-B/(T-C) where p* is the vapor pressure of the pure species in bar, T is the temperature in Kelvin, and A, B, and C are species-specific constants. For this program, estimate the pressure for benzene at any temperature. Define D in the Clausius-Clapeyron equation as a symbolic constant in your program, and use 18.69. Also define A, B, and C in the Antoine equation as symbolic constants in your program and use the values 4.01814, 1203.835, and -53.226, respectively. ASSIGNMENT: Write a C program that will allow the user to enter the temperature T in °C. Once the user enters the initial value, the program will compute the vapor pressure using both equations. Before performing the calculations, you will need to convert from °C to degrees Kelvin. Use the following equation to help you. degreesK=degreesC+273.15 Report both vapor pressures in bar. To convert from mm Hg to bar, use the following relation: 1 bar=750.061683 mmHg As a hint, you can use the exp() function to return the value of e raised to the ()th power. Your program output will look like the illustration shown on the next page. Use your PC’s cursor to determine the horizontal and vertical spacing for the output format. OUTPUT FORMAT: ******************************************** VAPOR PRESSURE Enter temperature in degrees C: x RESULTS Temperature = xxx.xx K Vapor Pressure: By Clausius-Clapeyron = x.xxxx bar By Antoine = x.xxxx bar ******************************************** 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 first assignment would be 1_1_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_1_elmer_fudd_2 or 1_1_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.

Explanation / Answer

C code:


#include<stdio.h>
#include<math.h>

#define D 18.69

#define A 4.01814
#define B 1203.835
#define C -53.226
int main()
{
   float temp;
   printf("Enter the temperature in degree C:");
   scanf("%f",&temp);
   temp=temp+273.15;
   float enthalpy;
   printf("Enter the specic entahlpy(in J/g): ");
   scanf("%f",&enthalpy);
   double ans1,ans2;
   ans1 = enthalpy/8.3147*temp;
   ans2 = pow(10,(A-B)/(temp-C));
   ans1 = ans1/750.061683;
   printf("******************************************* ");
printf("Temperature = %f Kelvins ",temp);
   printf("Vapour Pressure: ");
   printf("By Clausius-Clapeyron = %lf bar ",ans1);
   printf("By Antoine = %lf bar ",ans2);
   printf("******************************************* ");
   return 0;
  
}

Output:

Enter the temperature in degree C:12
Enter the specic entahlpy(in J/g): 234.8
*******************************************
Temperature = 285.000000 Kelvins
Vapour Pressure:
By Clausius-Clapeyron = 10.729992 bar
By Antoine = 0.000284 bar
*******************************************