WWW.DISSERS.RU

    !


Pages:     | 1 |   ...   | 7 | 8 ||

double FrKCl_1 [16] = {379.11,386.66,394.96,404.06,414.01,424.88, 436.75,449.67,463.73,479.01,495.6,513.6,533.12,554.25,577.12,601.86};

//NaCl double FrNaCl_C2_1[16] = {-1834.6,-1869.3,-1903.8,-1937.9,-1971.6, -2004.7,-2037.1,-2068.7,-2099.2,-2128.7,-2156.9,-2183.6,-2208.7,-2232.1, -2253.6,-2273};

double FrNaCl_C_1 [16] = {9656.3,9853.6,10052,10250,10449,10647, 10845,11041,11235,11428,11617,11803,11985,12162,12334,12500};

double FrNaCl_1 [16] = {251.93,257.95,264.1,270.38,276.78,283.31, 289.94,296.66,303.48,310.38,317.33,324.34,331.38,338.43,345.47,352.48};

//Resonance frequency, C = 1 - //KCl double FrKCl_C2_2 [16] = {-218.5,-233.81,-249.54,-265.68,-282.19, -299.04,-316.18,-333.57,-351.16,-368.88,-386.66,-404.43,-422.11,-439.59, -456.79,-473.59};

double FrKCl_C_2 [16] = {8136.5,8308.7,8480.6,8651.6,8821.3,8989.2, 9154.9,9317.7,9477,9632.2,9782.6,9927.4,10066,10197,10320,10435};

double FrKCl_2 [16] = {2083.1,2162.7,2250,2345.4,2449.5,2562.8, 2686.1,2819.8,2964.5,3121.1,3290,3472,3667.6,3877.7,4102.8,4343.5};

//NaCl double FrNaCl_C2_2[16] = {-165.21,-153.63,-140.04,-124.27,-106.13, -85.394,-61.859,-35.292,-5.4489,27.923,65.09,106.33,151.92,202.15, 257.33,317.75};

double FrNaCl_C_2 [16] = 6733.5,6851.4,6965.5,7075.1,7179.5,7277.8,7369.3,7452.9,7527.8, 7592.8,7646.9,7688.7,7717.2,7730.9,7728.4,7708.4};

double FrNaCl_2 [16] = {1661.7,1704.1,1749.8,1799,1851.9,1909, 1970.5,2036.9,2108.6,2186.2,2270,2360.6,2458.8,2565,2680,2804.5};

float ConcUp,ConcLow,C,ResFreq;

int Temp,Index;

isError = 0;

CString Str;

UpdateData(true);

UpdateData(false);

sscanf((LPCTSTR)m_ConcUp, _T("%gX"), &ConcUp);

sscanf((LPCTSTR)m_ConcLow, _T("%gX"), &ConcLow);

sscanf((LPCTSTR)m_Temp, _T("%dX"), &Temp);

//Checking input data if((ConcLow > 4) || (ConcUp > 4) ||(Temp > 40)) isError = 1;

if((ConcLow < 0.009) || (ConcUp < 0.009) ||(Temp < 25)) isError = 1;

if(ConcUp < ConcLow) isError = 1;

if(!IsError) { if(Temp == 25) Index = 0;

if(Temp == 26) Index = 1;

if(Temp == 27) Index = 2;

if(Temp == 28) Index = 3;

if(Temp == 29) Index = 4;

if(Temp == 30) Index = 5;

if(Temp == 31) Index = 6;

if(Temp == 32) Index = 7;

if(Temp == 33) Index = 8;

if(Temp == 34) Index = 9;

if(Temp == 35) Index = 10;

if(Temp == 36) Index = 11;

if(Temp == 37) Index = 12;

if(Temp == 38) Index = 13;

if(Temp == 39) Index = 14;

if(Temp == 40) Index = 15;

CStdioFile *FileOut;

FileOut = new CStdioFile("C:\\111.txt", CFile::modeCreate);

FileOut->Close();

if (FileOut->Open((LPCTSTR)("C:\\111.txt"), CFile::modeWrite)) { if(m_Solution.GetCurSel() == 0) { //Solution = KCl Str.Format(" ( KCl)\n");

FileOut->WriteString((LPCTSTR)Str);

Str.Format(" %d \n\n",Temp);

FileOut->WriteString((LPCTSTR)Str);

Str.Format("C, / Fr, \n");

FileOut->WriteString((LPCTSTR)Str);

C = ConcLow;

while(C <= ConcUp) { if(C<=1) ResFreq = SquareEquation(FrKCl_C2_1[Index],FrKCl_C_1[Index], FrKCl_1[Index],C);

if(C>1) ResFreq = SquareEquation(FrKCl_C2_2[Index],FrKCl_C_2[Index], FrKCl_2[Index],C);

Str.Format("%1.2f %5.3f\n",C,ResFreq);

FileOut->WriteString((LPCTSTR)Str);

C += 0.01;

} } if(m_Solution.GetCurSel() == 1) { //Solution = NaCl Str.Format(" ( NaCl)\n");

FileOut->WriteString((LPCTSTR)Str);

Str.Format(" %d \n\n",Temp);

FileOut->WriteString((LPCTSTR)Str);

Str.Format("C, / Fr, \n");

FileOut->WriteString((LPCTSTR)Str);

C = ConcLow;

while(C <= ConcUp) { if(C<=1) ResFreq = SquareEquation(FrNaCl_C2_1[Index],FrNaCl_C_1[Index], FrNaCl_1[Index],C);

if(C>1) ResFreq = SquareEquation(FrNaCl_C2_2[Index],FrNaCl_C_2[Index], FrNaCl_2[Index],C);

Str.Format("%1.2f %5.3f\n",C,ResFreq);

FileOut->WriteString((LPCTSTR)Str);

C += 0.01;

} } FileOut->Close();

UpdateData(false);

} CDialog::OnOK();

} else AfxMessageBox(_T(" !"));

} FreqCalc.cpp double CFreqCalc::SquareEquation(double a,double b,double c, double t) { return(a*t*t+b*t+c);

} void CFreqCalc::OnOK() { // TODO: Add extra validation here //Activity coefficients double GammaKCl_t2[40] = {-1e-17,-2e-5,-2e-5,-2e-5,-4e-5,-3e-5, -4e-5,-3e-5,-4e-5,-1e-5,-8e-6,-9e-6,-1e-5,-1e-5,-1e-5,-2e-5,-2e-5,-2e-5, -2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5, -3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5};

double GammaKCl_t[40] = {-0.0003,0.0011,0.0009,0.0011,0.0024,0.0019, 0.0026,0.0018,0.0025,0.0006,0.0005,0.0006,0.0008,0.0009,0.0010,0.0011, 0.0012,0.0013,0.0014,0.0015,0.0016,0.0017,0.0018,0.0018,0.0019,0.0019, 0.0020,0.0020,0.0021,0.0021,0.0021,0.0021,0.0022,0.0022,0.0022,0.0022, 0.0021,0.0021,0.0021,0.0021};

double GammaKCl[40] = {0.7779,0.7030,0.6780,0.6510,0.6153,0.6097, 0.5873,0.5908,0.5721,0.5955,0.5913,0.5858,0.5807,0.5758,0.5712,0.5668, 0.5627,0.5589,0.5554,0.5522,0.5492,0.5465,0.5441,0.5419,0.5400,0.5384, 0.5371,0.5360,0.5352,0.5347,0.5345,0.5345,0.5348,0.5354,0.5362,0.5374, 0.5388,0.5405,0.5424,0.5446};

double GammaNaCl_t2[40] = {-2e-6,-5e-6,-7e-6,-8e-6,-8e-6,-9e-6,-1e-5, -1e-5,-1e-5,-1e-5,-1e-5,-1e-5,-2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-3e-5, -3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-4e-5,-4e-5, -4e-5,-4e-5,-4e-5,-4e-5,-4e-5,-4e-5,-4e-5};

double GammaNaCl_t[40] = {0.0002,0.0001,0.0003,0.0004,0.0005,0.0006,0.0006,0.0007,0.0007,0.0007, 0.0010,0.0011,0.0013,0.0014,0.0015,0.0017,0.0018,0.0019,0.0020,0.0021, 0.0022,0.0023,0.0024,0.0025,0.0026,0.0026,0.0027,0.0028,0.0028,0.0029, 0.0029,0.0030,0.0030,0.0031,0.0031,0.0031,0.0032,0.0032,0.0032,0.0032};

double GammaNaCl[40] = {0.7799,0.7345,0.7092,0.6917,0.6785,0.6678,0.6590,0.6514,0.6447,0.6389, 0.6370,0.6351,0.6335,0.6324,0.6316,0.6312,0.6311,0.6315,0.6322,0.6334, 0.6349,0.6367,0.6390,0.6416,0.6446,0.6480,0.6518,0.6560,0.6605,0.6654, 0.6707,0.6764,0.6825,0.6889,0.6957,0.7029,0.7105,0.7185,0.7268,0.7356};

//Dynamic viscosity coefficients double ViscKCl_t2[40] = {0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002, 0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002, 0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002, 0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002};

double ViscKCl_t[40] = {-0.0331,-0.0328,-0.0324,-0.0322,-0.0317,-0.0314, -0.0311,-0.0308,-0.0304,-0.0301,0.0303,-0.0301,-0.0299,-0.0296,-0.0294, -0.0292,-0.0290,-0.0288,-0.0286,-0.0284,-0.0282,-0.0280,-0.0278,-0.0276, -0.0275,-0.0273,-0.0272,-0.0270,-0.0269,-0.0267,0.0266,-0.0265,-0.0264, -0.0263,-0.0262,-0.0261,-0.0260,-0.0259,-0.0258,-0.0257};

double ViscKCl[40] = {1.5692,1.5632,1.5553,1.5511,1.5428,1.5368,1.5314, 1.5253,1.5192,1.5138,1.5116,1.5071,1.5028,1.4987,1.4949,1.4913,1.4879,1.4847,1.4818,1.4791,1.4766,1.4744,1.4724,1.4706,1.,1.4678,1.4667,1.4658,1.4652,1.4648,1.4646,1.4647,1.4650,1.4655,1.4663,1.4673,1.4685, 1.4699,1.4716,1.4735};

double ViscNaCl_t2[40] = {0.0003,0.0003,0.0003,0.0003,0.0003,0.0003, 0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003, 0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003, 0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003,0.0003, 0.0003,0.0004,0.0004,0.0004};

double ViscNaCl_t[40] = {-0.0342,-0.0342,-0.0343,-0.0343,-0.0344, -0.0345,-0.0346,-0.0347,-0.0349,-0.0351,-0.0352,-0.0354,-0.0357,-0.0359, -0.0361,-0.0364,-0.0367,-0.0370,-0.0373,-0.0377,-0.0380,-0.0384,-0.0388, -0.0392,-0.0397,-0.0401,-0.0406,-0.0411,-0.0416,-0.0421,-0.0426,-0.0432, -0.0438,-0.0443,-0.0450,-0.0456,-0.0462,-0.0469,-0.0476,-0.0483};

double ViscNaCl[40] = {1.5936,1.6015,1.6100,1.6192,1.6289,1.6392, 1.6501,1.6616,1.6737,1.6864,1.6997,1.7136,1.7280,1.7431,1.7587,1.7750, 1.7918,1.8092,1.8272,1.8458,1.8651,1.8848,1.9052,1.9262,1.9478,1.9699, 1.9927,2.0161,2.0400,2.0645,2.0897,2.1154,2.1417,2.1686,2.1961,2.2242, 2.2529,2.2821,2.3120,2.3424};

//Density double DensKCl_t2[40] = {-6e-7, 2e-6, 1e-6,-1e-7,-1e-6,-3e-6,-4e-6,-5e-6, -6e-6,-4e-6, -8e-6,-9e-6,-1e-5,-1e-5,-1e-5,-1e-5,-1e-5,-2e-5,-2e-5,-2e-5, -2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-2e-5,-3e-5,-3e-5,-3e-5, -3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5,-3e-5};

double DensKCl_t[40] = {-0.0003,-0.0005,-0.0004,-0.0003,-0.0003,-0.0002, -0.0001,-0.00005,-0.00004,-0.0001,0.0002,0.0002,0.0003,0.0004,0.0004, 0.0005,0.0006,0.0006,0.0007,0.0007,0.0008,0.0008,0.0009,0.0009,0.0010, 0.0010,0.0011,0.0011,0.0012,0.0012,0.0012,0.0013,0.0013,0.0013,0.0014, 0.0014,0.0014,0.0015,0.0015,0.0015};

double DensKCl[40] = {1.0096,1.0180,1.0211,1.0242,1.0275,1.0305, 1.0337,1.0369,1.0398,1.0469,1.0462,1.0493,1.0524,1.0554,1.0585,1.0616, 1.0647,1.0677,1.0708,1.0738,1.0769,1.0799,1.0829,1.0860,1.0890,1.0920, 1.0950,1.0980,1.1009,1.1039,1.1069,1.1099,1.1128,1.1158,1.1187,1.1216, 1.1246,1.1275,1.1304,1.1333};

double DensNaCl_t2[40] = { 1e-7,-7e-7,-2e-6,-2e-6,-3e-6,-4e-6,-4e-6, -5e-6,-5e-6,-6e-6,-6e-6,-7e-6,-7e-6,-8e-6,-8e-6,-8e-6,-9e-6,-9e-6,-9e-6,-9e-6, -9e-6,-9e-6,-9e-6,-9e-6,-9e-6,-9e-6,-9e-6,-9e-6,-8e-6,-8e-6,-8e-6,-7e-6,-7e-6, -6e-6,-6e-6,-5e-6,-5e-6,-4e-6,-4e-6,-3e-6};

double DensNaCl_t[40] = {-0.0003,-0.0003,-0.0002,-0.0002,-0.0001, -0.0001,-6e-5,-03e-5,7e-6,4e-5,7e-5,9e-5,0.0001,0.0001,0.0002,0.0002, 0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002,0.0002, 0.0002, 0.0002, 0.0001, 0.0001,9e-5,7e-5,4e-5,7e-6,-3e-5,-6e-5,-0.0001, -0.0001,-0.0002,-0.0002};

double DensNaCl[40] = {1.0073,1.0106,1.0139,1.0173,1.0206,1.0240, 1.0274,1.0307,1.0341,1.0375,1.0410,1.0444,1.0478,1.0513,1.0547,1.0582, 1.0617,1.0651,1.0686,1.0721,1.0756,1.0792,1.0827,1.0863,1.0898,1.0934, 1.0969,1.1005,1.1041,1.1077,1.1113,1.1150,1.1186,1.1222,1.1259,1.1296, 1.1332,1.1369,1.1406,1.1443};

double Conc[40] = {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5, 1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5, 3.6,3.7,3.8,3.9,4.0};

int TempDelta,TempLow,TempUp,i;//,k;

double Mk,Ma,Fr,Gamma,Eta,Ro,LambdaPlus,LambdaMinus,Pi,T;

isError = 0;

Pi = 3.1415926535897932384626433832795;

CString Str;

UpdateData(true);

UpdateData(false);

sscanf((LPCTSTR)m_TempDelta, _T("%dX"), &TempDelta);

sscanf((LPCTSTR)m_TempLow, _T("%dX"), &TempLow);

sscanf((LPCTSTR)m_TempUp, _T("%dX"), &TempUp);

//Checking input data if((TempDelta >= 150) || (TempLow >= 150) ||(TempUp >= 150)) isError = 1;

if((TempDelta < 0) || (TempLow < 0) ||(TempUp < 0)) isError = 1;

if(TempUp < TempLow) isError = 1;

if(!IsError) { //CFile File;

CStdioFile *FileOut;

FileOut = new CStdioFile("C:\\111.txt", CFile::modeCreate);

FileOut->Close();

if (FileOut->Open((LPCTSTR)("C:\\111.txt"), CFile::modeWrite)) { if(m_Solution.GetCurSel() == 0) { //Solution = KCl Str.Format(" ( KCl)\n");

FileOut->WriteString((LPCTSTR)Str);

Str.Format("C, / T,C Mk,/ Ma,/ Fr,\n");

FileOut->WriteString((LPCTSTR)Str);

T = TempLow;

while(T <= TempUp) { for(i = 0;i <= 39;i ++) { Gamma = SquareEquation(GammaKCl_t2[i],GammaKCl_t[i],GammaKCl[i],T);

Mk = 0.039102+0.018015*sqrt(10.8/(0.018015*Gamma*Conc[i]*(10.8+7.96)));

Ma = 0.035453+0.018015*sqrt(7.96/(0.018015*Gamma*Conc[i]*(10.8+7.96)));

LambdaPlus = SquareEquation(0.0027,1.2802,40.221,T);

LambdaMinus = SquareEquation(0.0036,1.3507,40.628,T);

Ro = SquareEquation(DensKCl_t2[i],DensKCl_t[i],DensKCl[i],T);

Eta = SquareEquation(ViscKCl_t2[i],ViscKCl_t[i],ViscKCl[i],T);

Fr = (Ro/Eta)*0.03162278*sqrt((96484.56*96484.56*Gamma*Conc[i]*LambdaPlus)/(Pi*Ma*Mk*LambdaMinus));

Str.Format("%1.1f %1.0f %5.4f %5.4f %f\n",Conc[i],T,Mk,Ma,Fr);

FileOut->WriteString((LPCTSTR)Str);

} T += TempDelta;

} } if(m_Solution.GetCurSel() == 1) { //Solution = NaCl Str.Format(" ( NaCl)\n\n");

FileOut->WriteString((LPCTSTR)Str);

Str.Format("C, / T,C Mk,/ Ma,/ Fr,\n");

// Str.Format(" --- --- \n");

FileOut->WriteString((LPCTSTR)Str);

T = TempLow;

while(T <= TempUp) { for(i = 0;i <= 39;i ++) { Gamma = SquareEquation(GammaNaCl_t2[i],GammaNaCl_t[i], GammaNaCl[i],T);

Mk = 0.022991+0.018015*sqrt(14.7/(0.018015*Gamma*Conc[i]*(14.7+7.96)));

Ma = 0.035453+0.018015*sqrt(7.96/(0.018015*Gamma*Conc[i]*(14.7+7.96)));

LambdaPlus = SquareEquation(0.0024,0.9607,25.402,T);

LambdaMinus = SquareEquation(0.0036,1.3507,40.628,T);

Ro = SquareEquation(DensNaCl_t2[i],DensNaCl_t[i],DensNaCl[i],T);

Eta = SquareEquation(ViscNaCl_t2[i],ViscNaCl_t[i],ViscNaCl[i],T);

Fr = (Ro/Eta)*0.03162278*sqrt((96484.56*96484.56*Gamma*Conc[i]* LambdaPlus)/(Pi*Ma*Mk*LambdaMinus));

Str.Format("%1.1f %1.0f %5.4f %5.4f %f\n",Conc[i],T,Mk,Ma,Fr);

FileOut->WriteString((LPCTSTR)Str);

} T += TempDelta;

} } FileOut->Close();

UpdateData(false);

} CDialog::OnOK();

} else AfxMessageBox(_T(" !"));} . 1. ... 2. .. 2.1. .. 2.2. 2.3. ... 2.4. 3. . 3.1. .. 3.2. .. 4. - ר . 4.1. . 4.2. ... .. ...

Pages:     | 1 |   ...   | 7 | 8 ||










2011 www.dissers.ru -

, .
, , , , 1-2 .