Click here to Skip to main content
15,885,278 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
vinnzy15-Feb-05 13:43
vinnzy15-Feb-05 13:43 
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
Ravi Bhavnani15-Feb-05 15:13
professionalRavi Bhavnani15-Feb-05 15:13 
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
A.Sal16-Feb-05 0:17
A.Sal16-Feb-05 0:17 
Generalhelp with the operator overloading Pin
Flydian15-Feb-05 13:16
Flydian15-Feb-05 13:16 
GeneralRe: help with the operator overloading Pin
Bob Ciora16-Feb-05 1:34
Bob Ciora16-Feb-05 1:34 
Generalproblem returning arrays Pin
aaadetos15-Feb-05 13:05
aaadetos15-Feb-05 13:05 
GeneralRe: problem returning arrays Pin
John R. Shaw15-Feb-05 13:32
John R. Shaw15-Feb-05 13:32 
GeneralRe: problem returning arrays Pin
aaadetos15-Feb-05 16:12
aaadetos15-Feb-05 16:12 
thank you very much. now i'm in a new fix. the ffg code returns just the 1st values of the array, t[0] and pwf[0]..viz:
<br />
#include <math><br />
#include "stdafx.h"<br />
#include <fstream><br />
#include <iomanip><br />
#include <iostream><br />
using namespace std;<br />
<br />
const double PI = 3.141592653589793238462643383279502884197;<br />
double q = 1000;//STB/D<br />
double pi = 5000;//psia<br />
double rw = 0.25;//ft<br />
double h = 100;//ft<br />
double por = 0.2;<br />
double k = 200;//md<br />
double ct = 0.00003;//psi-1<br />
double Bo = 1.2;//RB/STB<br />
double visc = 1.3;//cp<br />
double C = 0.5;//RB/psi<br />
double S = 10;<br />
double tp = 200;//hrs<br />
double delta_t = 200;//hrs<br />
double a0,a1,a2,a3,a4,a5,b1,b2,b3,b4,c1,c2,c3,c4;<br />
double a[50],b[50],c[50],expint;<br />
<br />
double t[50],qsf[50],alpha,x[50],EI[50],beta[50],pd[50],pwf[50];<br />
<br />
double time_hr()<br />
{<br />
	double N=49.0;<br />
	for (int i=0;i<50;i++)<br />
	{<br />
		t[i] = 0.01*exp((i/N)*log(200/0.01));<br />
	}<br />
	return t[i];<br />
}<br />
<br />
//In the Presence of Wellbore Storage<br />
double wbs()<br />
{<br />
	a0 = -0.57721566;<br />
	a1 = 0.99999193;<br />
	a2 = -0.24991055;<br />
	a3 = 0.05519968;<br />
	a4 = -0.00976004;<br />
	a5 = 0.00107857;<br />
<br />
	b1 = 8.5733287401;<br />
	b2 = 18.059016973;<br />
	b3 = 8.6347608925;<br />
	b4 = 0.2677737343;<br />
<br />
	c1 = 9.5733223454;<br />
	c2 = 25.6329561486;<br />
	c3 = 21.0996530827;<br />
	c4 = 3.9584969228;<br />
<br />
	int N = 49;<br />
	alpha = (4/(3*PI*C))*(k*h/visc);<br />
	<br />
	for (int i=0;i<50;i++)<br />
	{<br />
		t[i] = 0.01*exp((i/N)*log(200/0.01));<br />
		qsf[i] = q*(1-exp(-1*alpha*t[i]));<br />
		x[i] = (948*por*visc*ct*pow(rw,2))/(k*t[i]);<br />
<br />
		if (x[i]<=0.01)<br />
		{<br />
			EI[i] = log(x[i])+0.5772;<br />
		}<br />
		else<br />
		{<br />
			a[i] = pow(x[i],4)+(b1*pow(x[i],3))+(b2*pow(x[i],2))+(b3*x[i])+b4;<br />
			b[i] = pow(x[i],4)+(c1*pow(x[i],3))+(c2*pow(x[i],2))+(c3*x[i])+c4;<br />
			EI[i]= (1/(x[i]*exp(x[i])))*a[i]/b[i];<br />
		}<br />
<br />
		beta[i] = (-0.5*EI[i])+S;<br />
		pd[i] = (1-(1/exp(alpha*t[i])))*beta[i];<br />
		pwf[i] = pi-((141.2*q*visc*Bo*pd[i])/(k*h));<br />
	}<br />
	return pwf[i];<br />
}<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
//	printf("Hello World!\n");<br />
	ofstream outputdeck;<br />
	outputdeck.open("output.txt", ios::out);<br />
	<br />
	outputdeck<<"Type A: With Wellbore Storage.\n";<br />
	outputdeck<<"Time"<<setw(5)<<"Pwf"<<setw(5)<<endl;<br />
	wbs();<br />
	time_hr();<br />
	for(int i=0;i<50;i++)<br />
	{<br />
		outputdeck<<t[i]<<setw(10)<<pwf[i]<<endl;<br />
	}<br />
<br />
<br />
<br />
	return 0;<br />
}<br />
also, when i called the fxns in reverse order, viz:
<br />
time_hr();<br />
wbs();
t[i] displayed correctly, but pwf[i] still returns pwf[0]. Please help!
GeneralRe: problem returning arrays Pin
$8816-Feb-05 20:30
$8816-Feb-05 20:30 
GeneralRe: problem returning arrays Pin
Branislav17-Feb-05 0:19
Branislav17-Feb-05 0:19 
GeneralRe: problem returning arrays Pin
aaadetos22-Feb-05 1:27
aaadetos22-Feb-05 1:27 
GeneralRe: problem returning arrays Pin
Branislav22-Feb-05 22:56
Branislav22-Feb-05 22:56 
GeneralRe: problem returning arrays Pin
$8816-Feb-05 0:14
$8816-Feb-05 0:14 
GeneralRe: problem returning arrays Pin
Anonymous22-Feb-05 1:23
Anonymous22-Feb-05 1:23 
GeneralRe: problem returning arrays Pin
$8822-Feb-05 2:17
$8822-Feb-05 2:17 
GeneralPrecompiled Headers Pin
JWood15-Feb-05 12:38
JWood15-Feb-05 12:38 
GeneralRe: Precompiled Headers Pin
Selvam R15-Feb-05 22:27
professionalSelvam R15-Feb-05 22:27 
GeneralRe: Precompiled Headers Pin
ionzarate16-Feb-05 2:56
ionzarate16-Feb-05 2:56 
QuestionWindow's Client RECT in Screen Coordinates? Pin
InflatableGarfield15-Feb-05 12:22
InflatableGarfield15-Feb-05 12:22 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
Ravi Bhavnani15-Feb-05 12:34
professionalRavi Bhavnani15-Feb-05 12:34 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
ThatsAlok15-Feb-05 18:09
ThatsAlok15-Feb-05 18:09 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
InflatableGarfield15-Feb-05 22:09
InflatableGarfield15-Feb-05 22:09 
GeneralwaveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 11:39
anaknakal15-Feb-05 11:39 
GeneralRe: waveInOpen and waveInProc problem. Pin
vinnzy15-Feb-05 18:53
vinnzy15-Feb-05 18:53 
GeneralRe: waveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 20:46
anaknakal15-Feb-05 20:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.