00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <stdio.h>
00010 #include <stdlib.h>
00011 #include <math.h>
00012 #include "constrel.h"
00013 #include "o30bazant.h"
00014
00015 o30bazmat::o30bazmat()
00016 {
00017 mw = 18.01528;
00018 ma = 28.9645;
00019 gasr = 8314.41;
00020
00021 t0 = 273.15;
00022 t00 = 293.15;
00023 p0 = 101325.0;
00024 tcr = 647.3;
00025
00026 w1 = 98.0;
00027 c1 = 510.0;
00028
00029
00030 phi0 = 0.1;
00031 aphi = 5.0e-5;
00032
00033
00034 k0 = 1.0e-21;
00035 ak = 5.0e-3;
00036
00037
00038 scr = 1.0;
00039 ag = 1.0;
00040
00041
00042 sir = 0.2;
00043 aw = 2.0;
00044 bw = 6.0;
00045
00046
00047 lambdas0 = 1.67;
00048 alam = -0.25/300.0;
00049
00050
00051 ac = 0.35;
00052 cps0 = 940.0;
00053
00054
00055 hydren = 0.5e+6;
00056
00057 finv = 0.4;
00058
00059 fste = 0.24;
00060
00061
00062 dld = 3.0E-2;
00063
00064
00065 emod0 = 3.4e+10;
00066
00067
00068 vcoeff = 0.2;
00069
00070
00071 betas = 9.0e-6;
00072
00073
00074 alpha = 0.5;
00075
00076
00077
00078
00079 at = 0.8;
00080 bt = 20000.0;
00081
00082 acc = 1.5;
00083
00084 ddbw0 = 1.0e-20;
00085 }
00086 o30bazmat::~o30bazmat()
00087 {}
00088
00089
00090
00091
00092
00093
00094
00095
00096 double o30bazmat::sat(double pc,double t)
00097 {
00098 double sw,rh,tamb,tem,tt1,mt1,fcm,mt;
00099 state_eq tt;
00100
00101 tamb= 25.0;
00102 rh = tt.get_rh(pc,t);
00103
00104
00105 if (t < tcr){
00106 tem = t - 273.15;
00107 if (tem < tamb)
00108 tem = tamb;
00109 }
00110 else
00111 tem = tcr - 273.15;
00112
00113
00114 tt1 = ((tem+10.0)/(25.0+10.0))*((tem+10.0)/(25.0+10.0));
00115 mt1 = 1.04 - (tt1/(24.0+tt1));
00116 if(t < tcr){
00117 fcm = (tcr-t)/(tcr-298.15);
00118 mt = mt1*fcm;
00119 if(mt < 1.0e-4)
00120 mt = 1.0e-4;
00121 }
00122 else{
00123 fcm = 0.0;
00124 mt = 1.0e-4;
00125 }
00126
00127
00128
00129 sw = exp(log(rh)/mt);
00130
00131 if(sw < 0.0)
00132 {
00133 sw=0.0;
00134 fprintf (stderr,"\n\n Uprava saturace");
00135 }
00136
00137 return(sw);
00138 }
00139
00140
00141
00142
00143
00144
00145
00146
00147 double o30bazmat::dsat_dpc(double pc,double t)
00148 {
00149 double dsw_dpc;
00150 double sw,rh,tamb,tem,tt1,mt1,fcm,mt;
00151 double ssmh,drhdc,dsdc;
00152 state_eq tt;
00153
00154 tamb= 25.0;
00155 rh = tt.get_rh(pc,t);
00156 drhdc = tt.get_drh_dpc(pc,t);
00157
00158
00159 if (t < tcr){
00160 tem = t - 273.15;
00161 if (tem < tamb)
00162 tem = tamb;
00163 }
00164 else
00165 tem = tcr - 273.15;
00166
00167 tt1 = ((tem+10.0)/(25.0+10.0))*((tem+10.0)/(25.0+10.0));
00168 mt1 = 1.04 - (tt1/(24.0+tt1));
00169 if(t < tcr){
00170 fcm = (tcr-t)/(tcr-298.15);
00171 mt = mt1*fcm;
00172 if(mt<1.0e-4)
00173 mt=1.0e-4;
00174 }
00175 else{
00176 fcm = 0.0;
00177 mt = 1.0e-4;
00178 }
00179
00180
00181
00182
00183 sw = sat(pc,t);
00184
00185 ssmh = sw/mt/rh;
00186 dsdc = ssmh*drhdc;
00187
00188 dsw_dpc = dsdc;
00189
00190 return(dsw_dpc);
00191 }
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201 double o30bazmat::dsat_dt(double pc,double t)
00202 {
00203 double dsw_dt;
00204 double sw,rh,tamb,tem,tt1,mt1,fcm,mt,dtt1dt,dm1tdt,dfcmdt,dmtdt;
00205 double lnh,xfun,drhdt,ssmh,dsdt;
00206 state_eq tt;
00207
00208 tamb= 25.0;
00209 rh = tt.get_rh(pc,t);
00210 drhdt = tt.get_drh_dt(pc,t);
00211
00212
00213 if (t < tcr){
00214 tem = t - 273.15;
00215 if (tem < tamb)
00216 tem = tamb;
00217 }
00218 else
00219 tem = tcr - 273.15;
00220
00221
00222 tt1 = ((tem+10.)/(25.0+10.))*((tem+10.)/(25.0+10.));
00223 mt1 = 1.04 - (tt1/(24.+tt1));
00224 if(t < tcr){
00225 fcm = (tcr-t)/(tcr-298.15);
00226 mt = mt1*fcm;
00227 dtt1dt = 2.0*(tem+10.0)/((25.0+10.0)*(25.0+10.0));
00228 dm1tdt = -24.0*dtt1dt/((24.0+tt1)*(24.0+tt1));
00229 dfcmdt = -1.0/(tcr-298.15);
00230 if(mt<1.0e-4)
00231 mt=1.0e-4;
00232 }
00233 else{
00234 fcm = 0.0;
00235 mt = 1.0e-4;
00236 dtt1dt = 0.0;
00237 dm1tdt = 0.0;
00238 dfcmdt = 0.0;
00239 }
00240
00241 dmtdt = dm1tdt*fcm + mt1*dfcmdt;
00242
00243
00244
00245
00246 sw = sat(pc,t);
00247
00248 lnh = log(rh);
00249
00250 if(t < tcr){
00251 xfun = drhdt - rh/mt*lnh*dmtdt;
00252 ssmh = sw/mt/rh;
00253 dsdt = ssmh*xfun;
00254 }
00255 else{
00256 xfun = drhdt - rh/mt*lnh*dmtdt ;
00257 ssmh = sw/mt/rh;
00258 dsdt = 0.0;
00259 }
00260
00261 dsw_dt = dsdt;
00262
00263 return(dsw_dt);
00264 }
00265
00266
00267
00268
00269
00270
00271
00272 double o30bazmat::ssp()
00273 {
00274 return(0.55);
00275 }
00276
00277
00278
00279
00280
00281
00282
00283
00284 double o30bazmat::o30baz_phi(double t)
00285 {
00286 double phi;
00287
00288 phi = phi0 + aphi*(t - 298.15);
00289
00290 return(phi);
00291 }
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302 double o30bazmat::o30baz_kintr(double pc,double pg,double t,double dam)
00303 {
00304 double kintr,bk;
00305 state_eq tt;
00306
00307 bk = log(5.0/3.0)/log(4.0);
00308
00309 kintr = k0*exp(log(10.0)*ak*(t-298.15))*pow((pg/p0),bk);
00310
00311
00312
00313
00314
00315
00316
00317
00318 return(kintr);
00319 }
00320
00321
00322
00323
00324
00325
00326
00327
00328 double o30bazmat::o30baz_krg(double pc,double t)
00329 {
00330 double krg,s;
00331
00332 s = sat(pc,t);
00333
00334 krg = 1.0 - pow((s/scr),ag);
00335
00336 return(krg);
00337 }
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347 double o30bazmat::o30baz_krw(double pc,double t,double rh)
00348 {
00349 double krw,help,s;
00350
00351 s = sat(pc,t);
00352
00353
00354 if (rh < 0.75)
00355 krw = pow(((s-sir)/(1.0-sir)),aw);
00356 else{
00357 help = 1.0 + pow(((1.0-rh)/0.25),bw);
00358 krw = pow(help,-1.0)*pow(s,aw);
00359 }
00360
00361 return(krw);
00362 }
00363
00364
00365
00366
00367
00368
00369 double o30bazmat::o30baz_dd()
00370 {
00371 double tau,dd;
00372
00373 tau = o30baz_tau();
00374
00375 dd = tau*mw*ma/gasr;
00376
00377
00378 return(dd);
00379 }
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389 double o30bazmat::o30baz_deff(double pc,double pg,double t)
00390 {
00391
00392 double deff,dd,phi,s,cdiff,fs;
00393 state_eq tt;
00394
00395 dd = o30baz_dd();
00396 phi = o30baz_phi(t);
00397 s = sat(pc,t);
00398 cdiff = tt.get_cdiff(pc,pg,t);
00399 fs = o30baz_fs(pc,pg,t);
00400
00401 deff = dd*phi*(1.0 - s)*fs*cdiff;
00402
00403 return(deff);
00404 }
00405
00406
00407
00408
00409
00410
00411
00412 double o30bazmat::o30baz_cps(double t)
00413 {
00414 double cps;
00415
00416 if (t < tcr)
00417 cps = cps0 + ac*(t - 298.15);
00418 else
00419 cps = cps0 + ac*(tcr - 298.15);
00420
00421 return(cps);
00422 }
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433 double o30bazmat::o30baz_rhocp(double pc,double pg,double t,long ipp)
00434 {
00435 double s,phi,rhocp,rhow,rhog,rhogw,cps,cpw,cpga,cpgw,rhos;
00436 state_eq tt;
00437
00438 s = sat(pc,t);
00439 phi = o30baz_phi(t);
00440 rhow = tt.get_rhow(t);
00441 rhog = tt.get_rhog(pc,pg,t);
00442 rhogw = tt.get_rhogw(pc,t);
00443 cps = o30baz_cps(t);
00444 cpw = tt.get_cpw();
00445 cpga = tt.get_cpga();
00446 cpgw = tt.get_cpgw();
00447 rhos = o30baz_rhos(t);
00448
00449 rhocp = (1.0-phi)*rhos*cps + phi*(s*rhow*cpw + (1.0-s)*(rhog*cpga + rhogw*(cpgw-cpga)));
00450
00451 return(rhocp);
00452 }
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463 double o30bazmat::o30baz_fs(double pc,double pg,double t)
00464 {
00465 double f,fs;
00466
00467 fs = 1.0e-3;
00468 f = fs*exp(-log(10.0)*(t-298.15)/500.0);
00469
00470 return(f);
00471 }
00472
00473
00474
00475
00476
00477
00478
00479 double o30bazmat::o30baz_tau()
00480 {
00481 double tau;
00482
00483 tau = 0.5;
00484
00485 return(tau);
00486 }
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497 double o30bazmat::o30baz_lambdas(double t)
00498 {
00499 double lambdas;
00500
00501 if (t < tcr)
00502 lambdas = lambdas0 + alam*(t-298.15);
00503 else
00504 lambdas = lambdas0 + alam*(tcr-298.15);
00505
00506 return(lambdas);
00507 }
00508
00509
00510
00511
00512
00513
00514
00515
00516 double o30bazmat::o30baz_lambdaeff(double pc,double pg,double t)
00517 {
00518 double lambdaeff,lambdas,s,phi,rhow,rhos;
00519 state_eq tt;
00520
00521 s = sat(pc,t);
00522 phi = o30baz_phi(t);
00523 rhow = tt.get_rhow(t);
00524 lambdas = o30baz_lambdas(t);
00525 rhos = o30baz_rhos(t);
00526
00527 lambdaeff = lambdas*(1.0 + 4.0*phi*rhow*s/(1.0-phi)/rhos);
00528
00529 return(lambdaeff);
00530 }
00531
00532
00533
00534
00535
00536
00537
00538 double o30bazmat::o30baz_rhos(double t)
00539 {
00540 double rhos;
00541
00542 if (t < tcr)
00543 rhos = 2590.0-0.529*(t-298.15);
00544 else
00545 rhos = 2590.0-0.529*(tcr-298.15);
00546
00547 return(rhos);
00548 }
00549
00550
00551
00552
00553
00554
00555 double o30bazmat::o30baz_betas()
00556 {
00557 return(betas);
00558 }
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571 double o30bazmat::o30baz_hydw(double pc,double pg,double t)
00572 {
00573 double fhy,hydw;
00574
00575 if((t-t0)< 105.0){
00576 fhy = 0.0;
00577 }
00578 else{
00579 fhy = (1.0+sin(3.1416/2.0*(1.0-2.0*exp(-0.004*((t-t0)-105.0)))))/2.0;
00580 }
00581
00582 hydw = fste*finv*c1*fhy;
00583
00584 return(hydw);
00585 }
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595 double o30bazmat::o30baz_dehydw_dt(double pc,double pg,double t)
00596 {
00597 double dfhyt,dehydw_dt;
00598
00599 if((t-t0)< 105.0){
00600 dfhyt = 0.0;
00601 }
00602 else{
00603 dfhyt = (3.1416*0.004/2.0)*cos(3.1416/2.0*(1.0-2.0*exp(-0.004*((t-t0)-105.0))))*exp(-0.004*((t-t0)-105.0));
00604 }
00605
00606 dehydw_dt = fste*finv*c1*dfhyt;
00607
00608 return(dehydw_dt);
00609 }
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620 double o30bazmat::o30baz_hydren(double pc,double pg,double t)
00621 {
00622 return(hydren);
00623 }
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633 double o30bazmat::o30baz_fste(double pc,double pg,double t)
00634 {
00635 return(fste);
00636 }
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646 double o30bazmat::o30baz_ddbw(double pc,double pg,double t)
00647 {
00648 double ddbw;
00649
00650 ddbw = ddbw0*exp(-t/(273.15+23));
00651 if (t > tcr)
00652 ddbw = ddbw0*exp(-tcr/(273.15+23));
00653
00654 return(ddbw);
00655 }
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666 double o30bazmat::o30baz_emod()
00667 {
00668 return(emod0);
00669 }
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680 double o30bazmat::o30baz_fct(double pc,double pg,double t)
00681 {
00682 double fct,ttc;
00683
00684 ttc = t - 273.15;
00685
00686 if (ttc <= 600.0)
00687 fct = (6.0 - 8.56e-3*ttc)*1.0e6;
00688 else
00689 fct = 0.864*1.0e6;
00690
00691 return(fct);
00692 }
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704 double o30bazmat::o30baz_xk0(double pc,double pg,double t)
00705 {
00706 double xk0;
00707
00708 xk0 = 1.0e-4*(1.0 + (t-t00)/600.0);
00709
00710 return(xk0);
00711 }
00712
00713
00714
00715
00716
00717
00718
00719 double o30bazmat::o30baz_bcc()
00720 {
00721 double bcc;
00722
00723 bcc = 2000.0;
00724
00725 return(bcc);
00726 }
00727
00728
00729
00730
00731
00732
00733
00734 double o30bazmat::o30baz_alpha()
00735 {
00736 return(alpha);
00737 }
00738
00739
00740
00741
00742
00743
00744 double o30bazmat::o30baz_nu()
00745 {
00746 return(vcoeff);
00747 }
00748
00749
00750
00751
00752
00753
00754
00755
00756 void o30bazmat::read(XFILE *in)
00757 {}
00758
00759
00760
00761
00762
00763
00764
00765 void o30bazmat::print(FILE *out)
00766 {}
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781 void o30bazmat::give_reqntq(long *antq)
00782 {
00783
00784 antq[scal_iso_damage-1] = 1;
00785 }