I have the following code, which runs w/out erroe, but fails to return the proper values...
This code returns a value of 0 for every value of i. t is supposed to increase from 0.01 to 200 as i increases from 0 to 49.
Can anyone pls tell me what i'm doing wrong?
Thank you.
Code:
#include <math>
#include "stdafx.h"
#include <fstream>
#include <iomanip>
#include <iostream>
using namespace std;
const double PI = 3.141592653589793238462643383279502884197;
double q = 1000;//STB/D
double pi = 5000;//psia
double rw = 0.25;//ft
double h = 100;//ft
double por = 0.2;
double k = 200;//md
double ct = 0.00003;//psi-1
double Bo = 1.2;//RB/STB
double visc = 1.3;//cp
double C = 0.5;//RB/psi
double S = 10;
double tp = 200;//hrs
double delta_t = 200;//hrs
double a0,a1,a2,a3,a4,a5,b1,b2,b3,b4,c1,c2,c3,c4;
double a[50],b[50],c[50],expint;
double t[50],qsf[50],alpha,x[50],EI[50],beta[50],pd[50],pwf[50];
double time_hr()
{
double N=49.0;
for (int i=0;i<50;i++)
{
t[i] = 0.01*exp((i/N)*log(200/0.01));
}
return t[i];
}
int main(int argc, char* argv[])
{
// printf("Hello World!\n");
ofstream outputdeck;
outputdeck.open("output.txt", ios::out);
outputdeck<<"Type A: With Wellbore Storage.\n";
outputdeck<<"Time"<<setw(5)<<"Pwf"<<setw(5)<<endl;
for(int i=0;i<50;i++)
{
outputdeck<<t[i]<<endl
}
return 0;
}
Can anyone pls tell me what i'm doing wrong?
Thank you.