1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#include <iostream>
#include <math.h>
#include <cmath>
#include "func.h"
using namespace std;
float Rayleigh(float, float, float, float );
float Nusselt(float);
float HeatT(float, float, float);
int main()
{
float itf;
float ot;
float H;
float L;
float itk;
float B;
float ra;
float A;
cout<<"Enter the temperature of the house(F): ";
cin>>itf;
cout<<"Enter the temperature of the environment(K): ";
cin>>ot;
cout<<"Enter the height of the house(ft): ";
cin>>H;
cout<<"Enter the length of the house(ft): ";
cin>>L;
itk = Fahr2Kel(itf);
B = 1/ot;
A = L*H;
float z;
z = Rayleigh(B, itk, ot, L);
cout<<"The Rayleigh Number is: "<< z;
float y;
y = Nusselt(ra);
cout<<"The Nusselt Number is: "<<y;
float x;
x = HeatT(A, itk, ot);
cout<<"The heat transfer rate is: "<<x;
return 0;
}
float Rayleigh(float B, float itk, float ot, float L)
{
float ra;
ra = (9.81* B *(itk-ot)*pow(L,3)*0.7)/(0.00000000023716);
return ra;
}
float Nusselt(float ra)
{
float Nu;
Nu = 0.59*(pow(ra,0.25));
return Nu;
}
float HeatT(float A, float itk, float ot)
{
float Q;
Q = A*(itk-ot);
return Q;
}
|