You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/3rd/SinglePhaseSolver/include/singlePhaseSolver.h

155 lines
3.4 KiB
C++

#pragma once
#include <string>
#include <vector>
struct Point {
double x, y, z;
Point(double x0, double y0)
{
x = x0;
y = y0;
}
Point() {};
std::vector<double> pointData;
// 拷贝构造函数
Point(const Point& other) {
//std::cout << "Copy constructor called" << std::endl;
x = other.x; // 复制数据
y = other.y;
z = other.z;
pointData=other.pointData;
}
};
struct Cell {
int type;
std::vector<int> pointIndices;
std::vector<double> cellData;
Cell(const Cell& other)
{
type = other.type;
pointIndices = other.pointIndices;
cellData = other.cellData;
}
Cell() {}
};
class CBoundLine
{
// DECLARE_SERIAL(CBoundLine)
public:
CBoundLine() {
nNodeNum = 8;
nboundtype = 0;
ddl = 100;
bisSel = false;
};
virtual ~CBoundLine() {};
Point pPre, pOri;
int nboundtype;
int nNodeNum;
double ddl;
int nNodeMin;
int nNodeMax;
bool bisSel;
};
class CWell
{
// DECLARE_SERIAL(CWell)
public:
CWell() {
nNodeNum = 12;
dRc = 0.1;
nFlowType = 0;
nTimeNumQ = 0;
nTimeNumP = 0;
dSkin = 0;
dC = 0.01;
dMinPress = 0.101325;
bisSel = false;
nDenseNum = 10;
dDenseRadius[0] = 1; nDenseNodeNUm[0] = 18;
dDenseRadius[1] = 10; nDenseNodeNUm[1] = 23;
dDenseRadius[2] = 50; nDenseNodeNUm[2] = 22;
dDenseRadius[3] = 100; nDenseNodeNUm[3] = 25;
dDenseRadius[4] = 500; nDenseNodeNUm[4] = 26;
dDenseRadius[5] = 1000; nDenseNodeNUm[5] = 27;
dDenseRadius[6] = 2000; nDenseNodeNUm[6] = 32;
dDenseRadius[7] = 3000; nDenseNodeNUm[7] = 34;
dDenseRadius[8] = 4000; nDenseNodeNUm[8] = 35;
dDenseRadius[9] = 5000; nDenseNodeNUm[9] = 47;
dDenseRadius[10] = 10000; nDenseNodeNUm[10] = 48;
dDenseRadius[11] = 20000; nDenseNodeNUm[11] = 48;
bisAutoChoose = false;
bisMultFlow = false;
nInComNote = 0;
};
virtual ~CWell() {};
void SetDenseValue();
public:
//void Serialize(CArchive& ar);
std::string sWellname;
Point pCenter;
int nFlowType;
int nNodeNum;
double dRc;//¾®Í²°ë¾¶
double dSkin;//±íƤϵÊý
double dC;//¾®´¢ÏµÊý
double dMinPress;//×îСÁ÷ѹ
int nTimeNumQ;
int nTimeNumP;
double pdTimeQ[100];//井为定产量生产时的时间持续段数组
double pdTimeP[100];//井为定压力生产时的时间持续段数组
double pdQ[100];//井为定产量生产时的产量数组
double pdP[100]; //井为压产量生产时的压力数组
int nNodeMin;
int nNodeMax;
bool bisSel;
int nDenseNum;//¼ÓÃÜȦ¸öÊý
double dDenseRadius[20];//¼ÓÃÜȦ°ë¾¶
int nDenseNodeNUm[20];//¼ÓÃÜȦ½ÚµãÊý
double dS;//¾àÀë±ß½ç×îСֵ
bool bisAutoChoose;//ÊÇ·ñ¾­×Ô¶¯É¸Ñ¡
bool bisMultFlow;
int nInComNote;
std::vector<int> m_NodeIndex;//all the nodes index of the wellbore
std::vector<Point> m_PressureData;//计算的井筒压力数据
};
class CBoundCir
{
// DECLARE_SERIAL(CBoundCir)
public:
CBoundCir() {
nNodeNum = 24;
nboundtype = 0;
bisSel = false;
dComKr = 10;
dComW = 3;
};
virtual ~CBoundCir() {};
public:
Point pCenter;
double dRc;
int nboundtype;
int nNodeNum;
bool bisSel;
int nNodeMin;
int nNodeMax;
int nMeshMin;
int nMeshMax;
double dComKr;
double dComW;
};
#ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport) int singlePhaseSolver(double* m_pBaseData, std::vector<Point> points, std::vector<Cell> cells, int m_nWellNum, CWell* pwells, std::vector<std::vector<Point>>& vecBP, std::vector<std::pair<double, std::vector<double>>>& vecNodePre);
#ifdef __cplusplus
}
#endif