Develop a collection of functions to solve simple conduction

Develop a collection of functions to solve simple conduction problems using various forms of the formula H = kA(T_2 - T_1)/X where H is the rate of heat transfer in watts, k is the coefficient of thermal conductivity for the particular substance. A is the cross-sectional area in m2 (square meters), T2 and T1 are the kelvin temperatures on the two sides of the conductor, and X is the thickness of the conductor in meters. Define a function for each variable in the formula. For example, function calc_h would compute the rate of heat transfer. calc_k would figure the coefficient of thermal conductivity, calc_a would find the cross-sectional area, and so on. Develop a driver function that interacts with the user in the following way: Respond to the prompts with the data known. For the unknown quantity, enter a question mark (?). Rate of heat transfer (watts) >> 755.0Coefficient of thermal conductivity (W/m-K) >> 0.8Cross-s H = kA(T2 - T1)/x Temperature on the other side is 274 K.

Solution

#include <stdio.h>
#include <string.h>
void cal_h();
void cal_k();
void cal_a();
int main(void)
{
   cal_h();
   cal_k();
   cal_a();

return 0;
}
void cal_h()
{
   int t1,t2;
   double k,a,x,h;
printf(\"Calculate the rate of rate transfer ?\");
   printf(\"\ Enter Temperature (T1 in kelvin)>>\");
   scanf(\"%d\",&t1);
   printf(\"Enter Temperature (T2 in kelvin)>>\");
   scanf(\"%d\",&t2);
   printf(\"Enter Coefficient of Thermal Conductivity >>\");
   scanf(\"%lf\",&k);
   printf(\"Enter Cross-sectional area >>\");
   scanf(\"%lf\",&a);
   printf(\"Enter Thickness of Conductor >>\");
   scanf(\"%lf\",&x);
h=(k*a*(t2-t2))/x;
   printf(\"The Rate of heat transfer is %.2f watts\",h);  
  
}
void cal_k()
{
   int t1,t2;
   double k,a,x,h;
   printf(\"Calculate coefficient of Thermalconductivity ?\ \");
   printf(\"Enter rate of heat transfer >>\");
   scanf(\"%lf\",&h);
   printf(\"\ Enter Temperature (T1 in kelvin)>>\");
   scanf(\"%d\",&t1);
   printf(\"Enter Temperature (T2 in kelvin)>>\");
   scanf(\"%d\",&t2);
   printf(\"Enter Cross-sectional area >>\");
   scanf(\"%lf\",&a);
   printf(\"Enter Thickness of Conductor >>\");
   scanf(\"%lf\",&x);
   k=(h*x)/(a*(t2-t1));
   printf(\"The coefficient of Thermalconductivity is %.2f \",k);
}
void cal_a()
{
   int t1,t2;
   double k,a,x,h;
printf(\"Calculate the cross-sectional area ?\ \");
  
printf(\"Enter rate of heat transfer >>\");
   scanf(\"%lf\",&h);
   printf(\"\ Enter Temperature (T1 in kelvin)>>\");
   scanf(\"%d\",&t1);
   printf(\"Enter Temperature (T2 in kelvin)>>\");
   scanf(\"%d\",&t2);
   printf(\"Enter Coefficient of Thermal Conductivity >>\");
   scanf(\"%lf\",&k);

   printf(\"Enter Thickness of Conductor >>\");
   scanf(\"%lf\",&x);
a=(h*x)/(k*(t2-t1));
   printf(\"The cross-sectional area is %.2f watts\",a);
}

_________________

 Develop a collection of functions to solve simple conduction problems using various forms of the formula H = kA(T_2 - T_1)/X where H is the rate of heat transf
 Develop a collection of functions to solve simple conduction problems using various forms of the formula H = kA(T_2 - T_1)/X where H is the rate of heat transf

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site