00001
00002
00003
00004 #include "global.h"
00005 #include "math.h"
00006 #include "globmat.h"
00007 #include "genfile.h"
00008 #include "adaptivity.h"
00009 #include "intpoints.h"
00010 #include "stdlib.h"
00011 #include "elastisomat.h"
00012 #include "creep.h"
00013 #include "creep_dpl.h"
00014
00015
00016 dplmat::dplmat (void)
00017 {
00018 q1 = 0.0;
00019
00020 e28=30.0e9;
00021 fc=35.8e6;
00022 ro = 2500.0;
00023 wc=0.43;
00024 sc=3.4;
00025 gc=1.98;
00026 a1 = 1.05;
00027
00028 tb_time = 0.0;
00029 th_time = 0.0;
00030 napproxtime = 0;
00031 nRetTime = 0;
00032 type_rt = 0;
00033 ft_flag = 0;
00034 ft = 0.0;
00035 ft_ratio = 1.0e-5;
00036
00037 e0 = 0.0;
00038
00039 previoustime = 0.0;
00040 actualtime = 0.0;
00041 dtb = 0.0;
00042 tb_age_dt = tb_age = tbl_age = tbh_age = maxtimeb = 0.0;
00043 napptimeb = 0;
00044
00045 retTime=NULL;
00046 emu=NULL;
00047 timeMax=(Mp->timecon.endtime ())/86400.0;
00048 }
00049
00050
00051 dplmat::~dplmat (void)
00052 {
00053 delete [] retTime;
00054 }
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 void dplmat::read (XFILE *in)
00065 {
00066 long i;
00067
00068 xfscanf(in,"%ld",&type_e);
00069
00070 if (type_e == 1){xfscanf (in,"%lf ",&e28);}
00071
00072 e0 = 1.5*e28/6.89476*1.0e-3;
00073 e28 = e28/6.89476*1.0e-3;
00074
00075 xfscanf (in,"%lf %lf %lf %lf %lf %lf",&fc,&ro,&wc,&sc,&gc,&a1);
00076
00077
00078 fc = fc/6.89476*1.0e-3;
00079
00080 ro = ro/16.03;
00081
00082 xfscanf (in,"%lf %lf %ld %ld %ld",
00083 &tb_time,&th_time,&napproxtime,&nRetTime,&type_rt);
00084
00085 tb_time = tb_time/86400.0;
00086 th_time = th_time/86400.0;
00087
00088 retTime = new double [nRetTime];
00089 for (i=0;i<nRetTime;i++){
00090 retTime[i]=0.0;
00091 }
00092
00093 if (type_rt==1){
00094 for (i=0;i<nRetTime;i++)
00095 xfscanf (in,"%lf",&retTime[i]);
00096 }
00097 }
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 void dplmat::print (FILE *out)
00108 {
00109 long i;
00110
00111 fprintf(out," %ld",type_e);
00112
00113 if (type_e == 1){fprintf (out," %e ",e28);}
00114
00115 fprintf (out," %lf %lf %lf %lf %lf %lf",fc,ro,wc,sc,gc,a1);
00116
00117 fprintf (out," %lf %lf %ld %ld %ld",
00118 tb_time,th_time,napproxtime,nRetTime,type_rt);
00119
00120 if (type_rt==1){
00121 for (i=0;i<nRetTime;i++)
00122 fprintf (out," %lf",retTime[i]);
00123 }
00124 }
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 void dplmat::compute_ages (long ipp,long ido)
00136 {
00137
00138 if(Mp->time == previoustime)
00139 dtb = Mp->timecon.initialtimeincr ()/86400.0;
00140 else
00141 dtb = (Mp->time - previoustime)/86400.0;
00142 actualtime = Mp->time/86400.0;
00143 tbh_age = actualtime - th_time;
00144 tbl_age = actualtime - tb_time + dtb/2.0;
00145 tb_age = actualtime - tb_time;
00146 napptimeb = give_napproxtime(ipp);
00147
00148 maxtimeb = Mp->timecon.endtime ()/86400.0;
00149 tb_age_dt = tb_age + dtb;
00150
00151 if (tb_age <= 0.0){
00152 fprintf (stderr,"\n Age of concrete must be greater than zero!!!");
00153 fprintf (stderr,"\n Age of concrete = %e, Actual time = %e, Time of end of concrete casting = %e; (Age of concrete = Actual time - Time of end of concrete casting)",tb_age,actualtime,tb_time);
00154 print_err("\n In function compute_ages ", __FILE__, __LINE__, __func__);
00155 exit(0);
00156 }
00157 }
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 void dplmat::give_ages (double &t_age_dt,double &t_age,double &tl_age,double &th_age,double &dt,double &maxtime,long &napptime,long ipp)
00175 {
00176 t_age_dt = tb_age_dt;
00177 t_age = tb_age;
00178 tl_age = tbl_age;
00179 th_age = tbh_age;
00180 dt = dtb;
00181 maxtime = maxtimeb;
00182 napptime = napptimeb;
00183 }
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 long dplmat::give_nceqother (long ipp)
00194 {
00195 long nc,nceqother;
00196
00197 nc=Mm->ip[ipp].ncompstr;
00198
00199 nceqother = nc + nc;
00200 nceqother = nceqother + nc + nc;
00201 nceqother = nceqother + nRetTime;
00202 nceqother = nceqother + nc*nRetTime;
00203 nceqother = nceqother + nc;
00204 nceqother = nceqother + nc;
00205 nceqother = nceqother + 1;
00206 nceqother = nceqother + nc;
00207 nceqother = nceqother + 1;
00208
00209 return(nceqother);
00210 }
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220 long dplmat::give_ncother (long ipp)
00221 {
00222 long nc,ncother;
00223
00224 nc=Mm->ip[ipp].ncompstr;
00225
00226 ncother = nc;
00227
00228 return(ncother);
00229 }
00230
00231
00232
00233
00234
00235
00236
00237 long dplmat::give_nret_time (void)
00238 {
00239 return(nRetTime);
00240 }
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252 void dplmat::give_rettimes (vector &rettimes,long n_ret_times,long ipp)
00253 {
00254 long i;
00255 double m,mm;
00256
00257 if (n_ret_times != nRetTime){
00258 print_err("\n Wrong number of ret. times", __FILE__, __LINE__, __func__);
00259 exit(0);
00260 }
00261
00262 if (type_rt==1){
00263 }
00264 else
00265 {
00266 m = log10(2.0*timeMax);
00267
00268 retTime[0]=1.0e-9;
00269 retTime[1]=1.0;
00270 mm=1./(nRetTime-2);
00271
00272 for (i=2;i<nRetTime-1;i++){
00273 retTime[i]=pow(10.,(i-1)*mm*m);
00274 }
00275 retTime[nRetTime -1]=2.0*timeMax;
00276 }
00277
00278 for (i=0;i<nRetTime;i++){
00279 rettimes.a[i]=retTime[i];
00280 }
00281 }
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294 void dplmat::store_emu_eqother(vector &e_mu,long n_ret_times,long ipp,long ido)
00295 {
00296 long i;
00297 long nc;
00298
00299 nc=Mm->ip[ipp].ncompstr;
00300
00301 if (n_ret_times != nRetTime){
00302 print_err("\n Wrong number of ret. times", __FILE__, __LINE__, __func__);
00303 exit(0);
00304 }
00305
00306 for (i=0;i<nRetTime;i++){
00307 Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc)+ i] = e_mu.a[i];
00308 }
00309 }
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322 void dplmat::give_emu_eqother(vector &e_mu,long n_ret_times,long ipp,long ido)
00323 {
00324 long i;
00325 long nc;
00326
00327 nc=Mm->ip[ipp].ncompstr;
00328
00329 if (n_ret_times != nRetTime){
00330 print_err("\n Wrong number of ret. times", __FILE__, __LINE__, __func__);
00331 exit(0);
00332 }
00333
00334 for (i=0;i<nRetTime;i++){
00335 e_mu.a[i] = Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc)+ i];
00336 }
00337 }
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349 void dplmat::store_ym_eqother(double ym,long ipp,long ido)
00350 {
00351 long n_ret_times;
00352 long nc;
00353
00354 nc=Mm->ip[ipp].ncompstr;
00355 n_ret_times = give_nret_time ();
00356
00357 Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc+nc)] = ym;
00358 }
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370 double dplmat::give_ym_eqother(long ipp,long ido)
00371 {
00372 long n_ret_times;
00373 long nc;
00374 double ym;
00375
00376 nc=Mm->ip[ipp].ncompstr;
00377 n_ret_times = give_nret_time ();
00378
00379 ym = Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc+nc)];
00380
00381 return(ym);
00382 }
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394 void dplmat::store_ym_old_eqother(double ym,long ipp,long ido)
00395 {
00396 long n_ret_times;
00397 long nc;
00398
00399 nc=Mm->ip[ipp].ncompstr;
00400 n_ret_times = give_nret_time ();
00401
00402 Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc+nc+1+nc)] = ym;
00403 }
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415 double dplmat::give_ym_old_eqother(long ipp,long ido)
00416 {
00417 long n_ret_times;
00418 long nc;
00419 double ym;
00420
00421 nc=Mm->ip[ipp].ncompstr;
00422 n_ret_times = give_nret_time ();
00423
00424 ym = Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc+nc+1+nc)];
00425
00426 return(ym);
00427 }
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439 void dplmat::give_hidden_strains_eqother(matrix &gamma_mu,long ipp,long ido)
00440 {
00441 long i,j,ii;
00442 long n_ret_times;
00443 long nc;
00444
00445 nc=Mm->ip[ipp].ncompstr;
00446 n_ret_times = give_nret_time ();
00447
00448 ii = 0;
00449 for (i=0;i<n_ret_times;i++){
00450 for (j=0;j<nc;j++){
00451 gamma_mu[j][i]=Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times)+ ii];
00452 ii++;
00453 }
00454 }
00455 }
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467 void dplmat::store_hidden_strains_eqother(matrix &gamma_mu,long ipp,long ido)
00468 {
00469 long i,j,ii;
00470 long n_ret_times;
00471 long nc;
00472
00473 nc=Mm->ip[ipp].ncompstr;
00474 n_ret_times = give_nret_time ();
00475
00476 ii = 0;
00477 for (i=0;i<n_ret_times;i++){
00478 for (j=0;j<nc;j++){
00479 Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times)+ ii] = gamma_mu[j][i];
00480 ii++;
00481 }
00482 }
00483 }
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495 void dplmat::give_stresses_eqother(vector &sigma,long ipp,long ido)
00496 {
00497 long i;
00498 long nc;
00499
00500 nc=Mm->ip[ipp].ncompstr;
00501
00502 for (i=0;i<nc;i++){
00503 sigma[i] = Mm->ip[ipp].eqother[ido+(nc)+i];
00504 }
00505 }
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517 void dplmat::store_stresses_eqother(vector &sigma,long ipp,long ido)
00518 {
00519 long i;
00520 long nc;
00521
00522 nc=Mm->ip[ipp].ncompstr;
00523
00524 for (i=0;i<nc;i++){
00525 Mm->ip[ipp].eqother[ido+(nc)+i] = sigma[i];
00526 }
00527 }
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539 void dplmat::give_stresses_other(vector &sigma,long ipp,long ido)
00540 {
00541 long i;
00542 long nc;
00543
00544 nc=Mm->ip[ipp].ncompstr;
00545
00546 for (i=0;i<nc;i++){
00547 sigma[i] = Mm->ip[ipp].eqother[ido+(nc)+i];
00548 }
00549 }
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561 void dplmat::store_stresses_other(vector &sigma,long ipp,long ido)
00562 {
00563 long i;
00564 long nc;
00565
00566 nc=Mm->ip[ipp].ncompstr;
00567
00568 for (i=0;i<nc;i++){
00569 Mm->ip[ipp].eqother[ido+(nc)+i] = sigma[i];
00570 }
00571 }
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583 void dplmat::give_dstresses_eqother(vector &dsigma,long ipp,long ido)
00584 {
00585 long i;
00586 long nc;
00587
00588 nc=Mm->ip[ipp].ncompstr;
00589
00590 for (i=0;i<nc;i++){
00591 dsigma[i] = Mm->ip[ipp].eqother[ido+(nc+nc+nc)+i];
00592 }
00593 }
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605 void dplmat::store_dstresses_eqother(vector &dsigma,long ipp,long ido)
00606 {
00607 long i;
00608 long nc;
00609
00610 nc=Mm->ip[ipp].ncompstr;
00611
00612 for (i=0;i<nc;i++){
00613 Mm->ip[ipp].eqother[ido+(nc+nc+nc)+i] = dsigma[i];
00614 }
00615 }
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627 void dplmat::give_strains_eqother(vector &eps,long ipp,long ido)
00628 {
00629 long i;
00630 long nc;
00631
00632 nc=Mm->ip[ipp].ncompstr;
00633
00634 for (i=0;i<nc;i++){
00635 eps[i] = Mm->ip[ipp].eqother[ido+(0)+i];
00636 }
00637 }
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649 void dplmat::store_strains_eqother(vector &eps,long ipp,long ido)
00650 {
00651 long i;
00652 long nc;
00653
00654 nc=Mm->ip[ipp].ncompstr;
00655
00656 for (i=0;i<nc;i++){
00657 Mm->ip[ipp].eqother[ido+(0)+i] = eps[i];
00658 }
00659 }
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671 void dplmat::give_creepdstrains_eqother(vector &deps_cr,long ipp,long ido)
00672 {
00673 long i;
00674 long n_ret_times;
00675 long nc;
00676
00677 nc=Mm->ip[ipp].ncompstr;
00678 n_ret_times = give_nret_time ();
00679
00680 for (i=0;i<nc;i++){
00681 deps_cr[i] = Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times)+i];
00682 }
00683 }
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695 void dplmat::store_creepdstrains_eqother(vector &deps_cr,long ipp,long ido)
00696 {
00697 long i;
00698 long n_ret_times;
00699 long nc;
00700
00701 nc=Mm->ip[ipp].ncompstr;
00702 n_ret_times = give_nret_time ();
00703
00704 for (i=0;i<nc;i++){
00705 Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times)+i] = deps_cr[i];
00706 }
00707 }
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717 long dplmat::give_napproxtime(long ipp)
00718 {
00719 return(napproxtime);
00720 }
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733 double dplmat::double_power_law(double tt,double t,long ipp,long ido)
00734 {
00735 double ee,a,n,m,fi;
00736 double x,ag,ac,jt;
00737
00738 if (type_e == 1){
00739 ee = 600000.0/e28;
00740 }
00741 else {
00742 ee = (0.09+1/(1.7*(0.00005*ro*ro*fc/1000.0)*(0.00005*ro*ro*fc/1000.0)));
00743 }
00744
00745 m=0.28+1/(fc*fc/1000.0/1000.0);
00746 a=1./(40.0*wc);
00747 ag=(sc+gc)/gc;
00748 ac=sc+gc;
00749 x=(2.1*ac/pow(sc,1.4)+0.1*pow((fc/1000.0),1.5)*pow(wc,1./3.)*pow(ag,2.2))*a-4.0;
00750 if (x <= 4.0)
00751 n=0.12;
00752 else
00753 n=.12+(0.07*pow(x,6.)/(5130.0+pow(x,6.)));
00754
00755 fi=0.5*pow(10.0,(3.0*n))/(pow(28.0,-m)+a);
00756
00757 q1 = ee;
00758 jt = fi*ee*(pow(tt,-m)+a)*pow((t-tt),n);
00759
00760 q1 = q1/6.89476*1.0e-3*1.0e-6;
00761 jt = jt/6.89476*1.0e-3*1.0e-6;
00762
00763 return(jt);
00764 }
00765
00766
00767
00768
00769
00770
00771
00772 double dplmat::give_q1()
00773 {
00774 return(q1);
00775 }
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787 double dplmat::creep_give_actual_ft (long ipp,long im,long ido)
00788 {
00789 long imat;
00790 double q,e_0,e_t,fft;
00791
00792 imat=Mm->ip[ipp].idm[Mm->ip[ipp].gemid()];
00793
00794 q = creep_matstiffchange (ipp,im,ido);
00795
00796 e_0=Mm->eliso[imat].e;
00797 e_t = q*e_0;
00798
00799 if(ft_flag == 0)
00800 fft = ft;
00801 else
00802 fft = ft_ratio*e_t;
00803
00804 return (fft);
00805 }
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817 void dplmat::addirrstrains_eqother (vector &deps,long ipp, long ido)
00818 {
00819 long i;
00820 long n_ret_times;
00821 long nc;
00822
00823 nc=Mm->ip[ipp].ncompstr;
00824 n_ret_times = give_nret_time ();
00825
00826 for (i=0;i<deps.n;i++){
00827 Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc)+i] = Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc)+i] + deps[i];
00828 }
00829 }
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841 void dplmat::giveirrstrains_eqother (long ipp, long ido, vector &epscr)
00842 {
00843 long i;
00844 long n_ret_times;
00845 long nc;
00846
00847 nc=Mm->ip[ipp].ncompstr;
00848
00849 n_ret_times = give_nret_time ();
00850
00851 for (i=0;i<epscr.n;i++){
00852 epscr[i] = Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc)+i];
00853 }
00854 }
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866 void dplmat::store_agstrains_eqother(long ipp,long ido,vector &eps_ag)
00867 {
00868 long i;
00869 long n_ret_times,nc;
00870
00871
00872 nc=Mm->ip[ipp].ncompstr;
00873
00874 n_ret_times = give_nret_time ();
00875
00876 for (i=0;i<nc;i++){
00877 Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc+nc+1)+i] = eps_ag[i];
00878 }
00879 }
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891 void dplmat::give_agstrains_eqother(long ipp,long ido,vector &eps_ag)
00892 {
00893 long i;
00894 long n_ret_times,nc;
00895
00896 nc=Mm->ip[ipp].ncompstr;
00897 n_ret_times = give_nret_time ();
00898
00899 for (i=0;i<nc;i++){
00900 eps_ag[i] = Mm->ip[ipp].eqother[ido+(nc+nc+nc+nc+n_ret_times+nc*n_ret_times+nc+nc+1)+i];
00901 }
00902 }
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914 double dplmat::get_othervalue(long compother,long ipp)
00915 {
00916 double other;
00917
00918
00919 switch (compother){
00920 case 0:{
00921 other = 0.0;
00922 break;
00923 }
00924 default:{
00925 print_err("\n Unknown type of component is required in ", __FILE__, __LINE__, __func__);
00926 }
00927 }
00928 return (other);
00929
00930 }
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941 void dplmat::print_othervalue_name(FILE *out,long compother)
00942 {
00943
00944 switch (compother){
00945 case 0:{
00946 fprintf (out,"eps_x ()");
00947 break;
00948 }
00949 default:{
00950 print_err("\n Unknown type of component is required in ", __FILE__, __LINE__, __func__);
00951 }
00952 }
00953 }