2006/08/11 | 第一个应用程序(C++):计算古油柱高度
类别(程序语言) | 评论(0) | 阅读(106) | 发表于 17:38
根据驱替压力或孔喉半径预测下伏古油柱的高度。

参考文献:
Keyu Liu etc(2006).Quantitative estimate of residual or palaeo-oil column height


 
//the program has been used to
//to find out the paleo-oil column height under a sample point
//written by Zeng H.S 2006/08/11
#include <iostream>
using namespace std;
main()
{
  double p,rw,ro,height,radius,it,delta_factor;//"it" means intefacial tention
  float g=9.817,m=1.45;
  unsigned int choose_n;
  cout<<"According to your data, choose 1 or 2:"<<endl
   <<"1)I have Pc(psi) already."<<endl
    <<"2)I have only throat radius(micro-meter)."<<endl;
  cin>>choose_n;
  cout<<"You have chosen "<<choose_n<<endl
   <<"Now let\'s begin:"<<endl
    <<"----------------------------------------------"<<endl;
  if(choose_n==2)
  {
    cout<<"Please enter the mean throat radius(micro-meter): "<<endl<<endl
     <<"radius=";
cin>>radius;
cout<<"Please enter interfacial tension factor: "<<endl
<<"if you can not sure what it is, enter 370 dynes/cm"<<endl
      <<"as its default"<<endl<<endl
<<"Delta_factor(dynes/cm)=";
cin>>delta_factor;
delta_factor=delta_factor/1000; //transfered to unit N/m
radius=radius/1000000;
    p=2*delta_factor*m/radius/10000; //Pc (psi)

  }
  else if(choose_n==1)
  {
    cout<<"Please enter the Pc(psi): "<<endl<<"Pc=";
cin>>p;
  }
  
  cout<<endl<<"please enter Ro,Rw(g/cm^3)"<<endl
   <<"|note: If you don\'t know please"<<endl
   <<"enter 1.006 and 0.85 as defaults: "<<endl;
cout<<"Rw=";
  cin>>rw;
  cout<<"Ro=";
  cin>>ro;
  rw=rw*1000;
  ro=ro*1000;
  height=p*10000/(rw-ro)/g/m;
  cout<<"Results: "<<endl;
  cout<<"----------------------------------------------"<<endl;
  cout<<"Rw="<<rw/1000<<"g/cm^3;"<<"Ro="<<ro/1000<<"g/cm^3"<<endl;
  cout<<"Pc= "<<p<<"psi"<<endl;
  cout<<"paleo-oil column height= "<<height<<"m"<<endl;
  cout<<"----------------------------------------------"<<endl;
  cout<<"the end of the program, please press any key to quit"<<endl
   <<"see you next time ^___^)"<<endl;
  system("pause");//stop to checking answer  
}

0

评论Comments

日志分类
首页[227]
+随笔[68]
学习札记[67]
科研工具[44]
文献摘译[2]
程序语言[20]
网络技巧[26]
--[0]