00001 #include <math.h>
00002 #include <string.h>
00003 #include <stdlib.h>
00004 #include "genfile.h"
00005 #include "global.h"
00006 #include "intpoints.h"
00007 #include "creep.h"
00008 #include "elastisomat.h"
00009 #include "creep_b3.h"
00010 #include "creep_rspec.h"
00011 #include "creepb.h"
00012 #include "creep_dpl.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 void creep_matstiff (matrix &d, long ipp,long im,long ido)
00026 {
00027 double q;
00028 q = 1.0;
00029
00030 Mm->elmatstiff (d,ipp);
00031
00032 q = creep_matstiffchange(ipp,im,ido);
00033
00034
00035 cmulm(q,d);
00036 }
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 double creep_matstiffchange (long ipp,long im,long ido)
00049 {
00050 long i;
00051 long n_ret_times,imat,napproxtime;
00052 double tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,q,delYi;
00053 double e0,et,qq,inv_v,q1,c_const,param_exp,exp_prec=-50;
00054 vector ret_times,emu;
00055
00056
00057 n_ret_times = creep_number_rettimes (ipp,im);
00058
00059
00060 allocv (n_ret_times,ret_times);
00061 fillv(0.0, ret_times);
00062 allocv (n_ret_times,emu);
00063 fillv(0.0, emu);
00064
00065 imat=Mm->ip[ipp].idm[Mm->ip[ipp].gemid()];
00066
00067 e0=Mm->eliso[imat].e;
00068
00069 switch (Mm->ip[ipp].tm[im]){
00070 case creepb3:{
00071 i=Mm->ip[ipp].idm[im];
00072
00073
00074 Mm->crb3[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00075
00076 Mm->crb3[i].give_rettimes(ret_times,n_ret_times,ipp);
00077
00078 Mm->crb3[i].give_emu_eqother(emu,n_ret_times,ipp,ido);
00079
00080 inv_v = 1.0;
00081
00082 q1 = Mm->crb3[i].give_q1();
00083
00084 c_const = 0.0;
00085 break;
00086 }
00087 case creeprs:{
00088 i=Mm->ip[ipp].idm[im];
00089
00090
00091 Mm->crrs[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00092
00093 Mm->crrs[i].give_rettimes(ret_times,n_ret_times,ipp);
00094
00095 Mm->crrs[i].give_emu_eqother(emu,n_ret_times,ipp,ido);
00096
00097 inv_v = Mm->crrs[i].give_inv_v(tl_age);
00098
00099 q1 = Mm->crrs[i].give_q1();
00100
00101 c_const = Mm->crrs[i].give_C_const();
00102 break;
00103 }
00104 case creepdpl:{
00105 i=Mm->ip[ipp].idm[im];
00106
00107
00108 Mm->crdpl[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00109
00110 Mm->crdpl[i].give_rettimes(ret_times,n_ret_times,ipp);
00111
00112 Mm->crdpl[i].give_emu_eqother(emu,n_ret_times,ipp,ido);
00113
00114 inv_v = 1.0;
00115
00116 q1 = Mm->crdpl[i].give_q1();
00117
00118 c_const = 0.0;
00119 break;
00120 }
00121 default:{
00122 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00123 }
00124 }
00125
00126
00127 et=0.;
00128 q=2./3.;
00129
00130 for (i=0;i<n_ret_times;i++){
00131 if(tb_age<0.0001){
00132 delYi=pow((0.0001+dt)/ret_times[i],q)-pow(0.0001/ret_times[i],q);
00133 }
00134 else{
00135 delYi=pow((tb_age+dt)/ret_times[i],q)-pow(tb_age/ret_times[i],q);
00136 }
00137
00138 param_exp = -delYi;
00139 if(param_exp <= exp_prec)
00140 param_exp = exp_prec;
00141
00142 et=et+(delYi-1.+exp(param_exp))/delYi/emu[i];
00143 }
00144
00145 if((Mm->ip[ipp].tm[im]) == creeprs){
00146 et = et + c_const;
00147 et = et * inv_v;
00148 }
00149
00150 et = et + q1;
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 if(et>1.e-50)
00171 et=1./et;
00172 else{
00173 print_err("stiffness modulus is zero on ip=%ld", __FILE__, __LINE__, __func__, ipp+1);
00174 abort();
00175 }
00176
00177
00178 destrv(ret_times);
00179 destrv(emu);
00180
00181
00182 qq=et/e0;
00183
00184 return(qq);
00185 }
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197 double creep_compute_actual_ym (long ipp,long im,long ido)
00198 {
00199 long i,imat;
00200 double q,e_0,e_t;
00201
00202 imat=Mm->ip[ipp].idm[Mm->ip[ipp].gemid()];
00203
00204 q = creep_matstiffchange (ipp,im,ido);
00205
00206 e_0=Mm->eliso[imat].e;
00207 e_t = q*e_0;
00208
00209 switch (Mm->ip[ipp].tm[im]){
00210 case creepb3:{
00211 i=Mm->ip[ipp].idm[im];
00212 Mm->crb3[i].store_ym_eqother(e_t,ipp,ido);
00213 break;
00214 }
00215 case creeprs:{
00216 i=Mm->ip[ipp].idm[im];
00217 Mm->crrs[i].store_ym_eqother(e_t,ipp,ido);
00218 break;
00219 }
00220 case creepdpl:{
00221 i=Mm->ip[ipp].idm[im];
00222 Mm->crdpl[i].store_ym_eqother(e_t,ipp,ido);
00223 break;
00224 }
00225 default:{
00226 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00227 }
00228 }
00229
00230 return (e_t);
00231 }
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244 double creep_give_actual_ym (long ipp,long im,long ido)
00245 {
00246 long i;
00247 double e_t;
00248
00249 switch (Mm->ip[ipp].tm[im]){
00250 case creepb3:{
00251 i=Mm->ip[ipp].idm[im];
00252 e_t = Mm->crb3[i].give_ym_eqother(ipp,ido);
00253 break;
00254 }
00255 case creeprs:{
00256 i=Mm->ip[ipp].idm[im];
00257 e_t = Mm->crrs[i].give_ym_eqother(ipp,ido);
00258 break;
00259 }
00260 case creepdpl:{
00261 i=Mm->ip[ipp].idm[im];
00262 e_t = Mm->crdpl[i].give_ym_eqother(ipp,ido);
00263 break;
00264 }
00265 default:{
00266 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00267 }
00268 }
00269
00270 return (e_t);
00271 }
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283 double creep_compute_inital_ym (long ipp,long im,long ido)
00284 {
00285 long i,imat;
00286 double q,e_0,e_t;
00287
00288 imat=Mm->ip[ipp].idm[Mm->ip[ipp].gemid()];
00289
00290 q = creep_matstiffchange (ipp,im,ido);
00291
00292 e_0=Mm->eliso[imat].e;
00293 e_t = q*e_0;
00294
00295 switch (Mm->ip[ipp].tm[im]){
00296 case creepb3:{
00297 i=Mm->ip[ipp].idm[im];
00298 Mm->crb3[i].store_ym_eqother(e_t,ipp,ido);
00299 break;
00300 }
00301 case creeprs:{
00302 i=Mm->ip[ipp].idm[im];
00303 Mm->crrs[i].store_ym_eqother(e_t,ipp,ido);
00304 break;
00305 }
00306 case creepdpl:{
00307 i=Mm->ip[ipp].idm[im];
00308 Mm->crdpl[i].store_ym_eqother(e_t,ipp,ido);
00309 break;
00310 }
00311 default:{
00312 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00313 }
00314 }
00315
00316 return (e_t);
00317 }
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329 double creep_give_actual_ft (long ipp,long im,long ido)
00330 {
00331 long i;
00332 double fft;
00333
00334 switch (Mm->ip[ipp].tm[im]){
00335 case creepb3:{
00336 i=Mm->ip[ipp].idm[im];
00337 fft = Mm->crb3[i].creep_give_actual_ft (ipp,im,ido);
00338 break;
00339 }
00340 case creeprs:{
00341 i=Mm->ip[ipp].idm[im];
00342 fft = Mm->crrs[i].creep_give_actual_ft (ipp,im,ido);
00343 break;
00344 }
00345 case creepdpl:{
00346 i=Mm->ip[ipp].idm[im];
00347 fft = Mm->crdpl[i].creep_give_actual_ft (ipp,im,ido);
00348 break;
00349 }
00350 default:{
00351 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00352 }
00353 }
00354
00355 return (fft);
00356 }
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368 double creep_give_actual_fc (long ipp,long im,long ido)
00369 {
00370 long imat;
00371 double q,e_0,e_t,ffc;
00372
00373 imat=Mm->ip[ipp].idm[Mm->ip[ipp].gemid()];
00374
00375 q = creep_matstiffchange (ipp,im,ido);
00376
00377 e_0=Mm->eliso[imat].e;
00378 e_t = q*e_0;
00379
00380
00381 ffc = e_t/1000.0;
00382
00383 return (ffc);
00384 }
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396 void creep_initmaterialmodel(long ipp,long im,long ido)
00397 {
00398 long i,j,k,n_ret_times,napproxtime;
00399 double t_age,tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,q,delYi,delYj,m0,m;
00400 double jt,ym0,exp_prec=-50;
00401 vector bpom,ret_times,emu;
00402 matrix apom,cpom;
00403
00404
00405 n_ret_times = creep_number_rettimes (ipp,im);
00406
00407
00408 allocv(n_ret_times,bpom);
00409 fillv(0.0, bpom);
00410 allocm(n_ret_times, n_ret_times, apom);
00411 fillm(0.0, apom);
00412 allocm(n_ret_times, n_ret_times, cpom);
00413 fillm(0.0, cpom);
00414 allocv (n_ret_times,ret_times);
00415 fillv(0.0, ret_times);
00416 allocv (n_ret_times,emu);
00417 fillv(0.0, emu);
00418 jt=0.0;
00419
00420
00421 q=2./3.;
00422
00423 switch (Mm->ip[ipp].tm[im]){
00424 case creepb3:{
00425 i=Mm->ip[ipp].idm[im];
00426
00427 Mm->crb3[i].previoustime = Mp->time;
00428
00429 Mm->crb3[i].initvalues(ipp, ido);
00430
00431
00432 Mm->crb3[i].compute_ages (ipp,ido);
00433 Mm->crb3[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00434
00435 Mm->crb3[i].give_rettimes(ret_times,n_ret_times,ipp);
00436 break;
00437 }
00438 case creeprs:{
00439 i=Mm->ip[ipp].idm[im];
00440
00441 Mm->crrs[i].previoustime = Mp->time;
00442
00443 Mm->crrs[i].initvalues(ipp,im,ido);
00444
00445
00446 Mm->crrs[i].compute_ages (ipp,ido);
00447 Mm->crrs[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00448
00449 Mm->crrs[i].give_rettimes(ret_times,n_ret_times,ipp);
00450 break;
00451 }
00452 case creepdpl:{
00453 i=Mm->ip[ipp].idm[im];
00454
00455 Mm->crdpl[i].previoustime = Mp->time;
00456
00457
00458 Mm->crdpl[i].compute_ages (ipp,ido);
00459 Mm->crdpl[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00460
00461 Mm->crdpl[i].give_rettimes(ret_times,n_ret_times,ipp);
00462 break;
00463 }
00464 default:{
00465 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00466 }
00467 }
00468
00469
00470 if (Mm->ip[ipp].tm[im] != creeprs){
00471 t_age=tl_age+0.0001;
00472
00473 m0 = log10(tl_age+0.0001);
00474 m = log10(2.0*timeMax);
00475 k=0;
00476
00477
00478 do{
00479
00480 switch (Mm->ip[ipp].tm[im]){
00481 case creepb3:{
00482 i=Mm->ip[ipp].idm[im];
00483
00484 jt = Mm->crb3[i].b3_law (th_age,tl_age,t_age,ipp,ido);
00485 break;
00486 }
00487 case creepdpl:{
00488 i=Mm->ip[ipp].idm[im];
00489
00490 jt = Mm->crdpl[i].double_power_law (tl_age,t_age,ipp,ido);
00491 break;
00492 }
00493 default:{
00494 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00495 }
00496 }
00497
00498 for (i=0;i<n_ret_times;i++){
00499 delYi=pow((tl_age/ret_times[i]),q)-pow((t_age/ret_times[i]),q);
00500 if(delYi <= exp_prec)
00501 delYi = exp_prec;
00502 bpom[i]=bpom[i]+(1.-exp(delYi))*jt;
00503 for (j=0;j<n_ret_times;j++){
00504 delYj= pow((tl_age/ret_times[j]),q)-pow((t_age/ret_times[j]),q);
00505 if(delYj <= exp_prec)
00506 delYj = exp_prec;
00507 apom[i][j]=apom[i][j]+(1.-exp(delYi))*(1.-exp(delYj));
00508 }
00509 }
00510 k=k+1;
00511
00512 t_age=pow(10.,m0+(m-m0)/napproxtime*k);
00513 }while (t_age <= 2.0*timeMax);
00514
00515 invm(apom,cpom,1.0e-20);
00516
00517
00518 for (i=0;i<n_ret_times;i++){
00519 for (j=0;j<n_ret_times;j++)
00520 emu[i]=emu[i]+cpom[i][j]*bpom[j];
00521
00522 emu[i]=1./emu[i];
00523 }
00524 }
00525
00526
00527 if (Mm->ip[ipp].tm[im] == creeprs){
00528 jt = Mm->crrs[i].give_J_E_mu(emu,th_age,tb_age,tb_age_dt,ipp,ido);
00529 }
00530
00531 switch (Mm->ip[ipp].tm[im]){
00532 case creepb3:{
00533 i=Mm->ip[ipp].idm[im];
00534
00535 Mm->crb3[i].store_emu_eqother(emu,n_ret_times,ipp,ido);
00536 break;
00537 }
00538 case creeprs:{
00539 i=Mm->ip[ipp].idm[im];
00540
00541 Mm->crrs[i].store_emu_eqother(emu,n_ret_times,ipp,ido);
00542 break;
00543 }
00544 case creepdpl:{
00545 i=Mm->ip[ipp].idm[im];
00546
00547 Mm->crdpl[i].store_emu_eqother(emu,n_ret_times,ipp,ido);
00548 break;
00549 }
00550 default:{
00551 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00552 }
00553 }
00554
00555
00556 ym0 = creep_compute_inital_ym (ipp,im,ido);
00557
00558
00559 destrm(apom);
00560 destrm(cpom);
00561 destrv(bpom);
00562 destrv(ret_times);
00563 destrv(emu);
00564 }
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577 void creep_updateval(long ipp,long im,long ido)
00578 {
00579 long i,j,nc,n_ret_times,napproxtime;
00580 double mu,tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,e;
00581 vector ret_times,emu,eps,sigma,sigmao,dsigma;
00582 matrix screep;
00583 strastrestate ss;
00584
00585
00586 nc=Mm->ip[ipp].ncompstr;
00587
00588 n_ret_times = creep_number_rettimes (ipp,im);
00589
00590 ss=Mm->ip[ipp].ssst;
00591
00592 mu=Mm->give_actual_nu(ipp);
00593
00594
00595 allocv (n_ret_times,ret_times);
00596 fillv(0.0, ret_times);
00597 allocv (n_ret_times,emu);
00598 fillv(0.0, emu);
00599 allocm(nc, n_ret_times,screep);
00600 fillm(0.0,screep);
00601 allocv(nc,eps);
00602 fillv(0.0,eps);
00603 allocv(nc,sigma);
00604 fillv(0.0,sigma);
00605 allocv(nc,sigmao);
00606 fillv(0.0,sigmao);
00607 allocv(nc,dsigma);
00608 fillv(0.0,dsigma);
00609
00610
00611 switch (Mm->ip[ipp].tm[im]){
00612 case creepb3:{
00613 i=Mm->ip[ipp].idm[im];
00614
00615
00616 for (j=0; j<nc; j++){
00617 eps[j]=Mm->ip[ipp].strain[j];
00618 }
00619 Mm->crb3[i].store_strains_eqother(eps,ipp,ido);
00620
00621 Mm->crb3[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00622
00623 Mm->crb3[i].updatevalues(ipp, ido);
00624
00625 Mm->crb3[i].give_rettimes(ret_times,n_ret_times,ipp);
00626
00627 Mm->crb3[i].give_hidden_strains_eqother(screep,ipp,ido);
00628
00629 Mm->crb3[i].give_stresses_eqother(sigmao,ipp,ido);
00630
00631 Mm->crb3[i].give_emu_eqother(emu,n_ret_times,ipp,ido);
00632
00633
00634 for (j=0;j<nc;j++){
00635 sigma[j] = Mm->ip[ipp].stress[j];
00636 dsigma[j] = sigma[j] - sigmao[j];
00637 }
00638 Mm->crb3[i].store_stresses_eqother(sigma,ipp,ido);
00639 break;
00640 }
00641 case creeprs:{
00642 i=Mm->ip[ipp].idm[im];
00643
00644
00645 for (j=0; j<nc; j++){
00646 eps[j]=Mm->ip[ipp].strain[j];
00647 }
00648 Mm->crrs[i].store_strains_eqother(eps,ipp,ido);
00649
00650 Mm->crrs[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00651
00652 Mm->crrs[i].updatevalues(ipp,im,ido);
00653
00654 Mm->crrs[i].give_rettimes(ret_times,n_ret_times,ipp);
00655
00656 Mm->crrs[i].give_hidden_strains_eqother(screep,ipp,ido);
00657
00658 Mm->crrs[i].give_stresses_eqother(sigmao,ipp,ido);
00659
00660 Mm->crrs[i].give_emu_eqother(emu,n_ret_times,ipp,ido);
00661
00662
00663 for (j=0;j<nc;j++){
00664 sigma[j] = Mm->ip[ipp].stress[j];
00665 dsigma[j] = sigma[j] - sigmao[j];
00666 }
00667 Mm->crrs[i].store_stresses_eqother(sigma,ipp,ido);
00668 break;
00669 }
00670 case creepdpl:{
00671 i=Mm->ip[ipp].idm[im];
00672
00673
00674 for (j=0; j<nc; j++){
00675 eps[j]=Mm->ip[ipp].strain[j];
00676 }
00677 Mm->crdpl[i].store_strains_eqother(eps,ipp,ido);
00678
00679 Mm->crdpl[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00680
00681 Mm->crdpl[i].give_rettimes(ret_times,n_ret_times,ipp);
00682
00683 Mm->crdpl[i].give_hidden_strains_eqother(screep,ipp,ido);
00684
00685 Mm->crdpl[i].give_stresses_eqother(sigmao,ipp,ido);
00686
00687 Mm->crdpl[i].give_emu_eqother(emu,n_ret_times,ipp,ido);
00688
00689
00690 for (j=0;j<nc;j++){
00691 sigma[j] = Mm->ip[ipp].stress[j];
00692 dsigma[j] = sigma[j] - sigmao[j];
00693 }
00694 Mm->crdpl[i].store_stresses_eqother(sigma,ipp,ido);
00695 break;
00696 }
00697 default:{
00698 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00699 }
00700 }
00701
00702
00703 creep_hidden_strains (screep,dsigma,emu,mu,n_ret_times,ret_times,tb_age,dt,ss);
00704
00705
00706 switch (Mm->ip[ipp].tm[im]){
00707 case creepb3:{
00708 i=Mm->ip[ipp].idm[im];
00709
00710 Mm->crb3[i].store_hidden_strains_eqother(screep,ipp,ido);
00711 e = Mm->crb3[i].give_ym_eqother(ipp,ido);
00712 Mm->crb3[i].store_ym_old_eqother(e,ipp,ido);
00713 break;
00714 }
00715 case creeprs:{
00716 i=Mm->ip[ipp].idm[im];
00717
00718 Mm->crrs[i].store_hidden_strains_eqother(screep,ipp,ido);
00719 e = Mm->crrs[i].give_ym_eqother(ipp,ido);
00720 Mm->crrs[i].store_ym_old_eqother(e,ipp,ido);
00721 break;
00722 }
00723 case creepdpl:{
00724 i=Mm->ip[ipp].idm[im];
00725
00726 Mm->crdpl[i].store_hidden_strains_eqother(screep,ipp,ido);
00727
00728 e = Mm->crdpl[i].give_ym_eqother(ipp,ido);
00729 Mm->crdpl[i].store_ym_old_eqother(e,ipp,ido);
00730 break;
00731 }
00732 default:{
00733 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00734 }
00735 }
00736
00737
00738 destrm(screep);
00739 destrv(sigma);
00740 destrv(sigmao);
00741 destrv(dsigma);
00742 destrv(ret_times);
00743 destrv(emu);
00744 }
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758 void creep_nlstressesincr (long ipp,long im,long ido)
00759 {
00760 long i,j,k,nc,n_ret_times,napproxtime;
00761 double t_age,tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,q,delYi,delYj,m0,m;
00762 double jt,ym,inv_v,q4,nonlin_func,dj,mu,param_exp,exp_prec=-50;
00763 vector bpom,ret_times,emu,deps_help,sigma,dsigma;
00764 vector deps,deps_cr,deps_sh,deps_ss;
00765 matrix apom,cpom,screep,d,c;
00766 strastrestate ss;
00767
00768
00769 nc=Mm->ip[ipp].ncompstr;
00770
00771 n_ret_times = creep_number_rettimes (ipp,im);
00772
00773 ss=Mm->ip[ipp].ssst;
00774
00775 mu=Mm->give_actual_nu(ipp);
00776
00777
00778 allocv(nc,deps);
00779 fillv(0.0,deps);
00780 allocv(nc,deps_cr);
00781 fillv(0.0,deps_cr);
00782 allocv(nc,deps_sh);
00783 fillv(0.0,deps_sh);
00784 allocv(nc,deps_ss);
00785 fillv(0.0,deps_ss);
00786 allocv(nc,dsigma);
00787 fillv(0.0,dsigma);
00788 allocv (n_ret_times,ret_times);
00789 fillv(0.0, ret_times);
00790 allocv (n_ret_times,emu);
00791 fillv(0.0, emu);
00792 allocm(nc, n_ret_times,screep);
00793 fillm(0.0,screep);
00794 allocv(n_ret_times,bpom);
00795 fillv(0.0, bpom);
00796 allocm(n_ret_times, n_ret_times, apom);
00797 fillm(0.0, apom);
00798 allocm(n_ret_times, n_ret_times, cpom);
00799 fillm(0.0, cpom);
00800 jt = 0.0;
00801
00802
00803 q=2./3.;
00804
00805
00806 switch (Mm->ip[ipp].tm[im]){
00807 case creepb3:{
00808 i=Mm->ip[ipp].idm[im];
00809
00810 Mm->crb3[i].previoustime = Mp->time-Mp->dtime;
00811
00812 Mm->crb3[i].compute_ages (ipp,ido);
00813 Mm->crb3[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00814
00815 Mm->crb3[i].give_rettimes(ret_times,n_ret_times,ipp);
00816
00817 Mm->crb3[i].give_hidden_strains_eqother(screep,ipp,ido);
00818
00819
00820 inv_v = 1.0;
00821
00822 q4 = 0.0;
00823 nonlin_func = 1.0;
00824
00825
00826
00827 Mm->crb3[i].give_deps_free (deps_sh,th_age,tb_age_dt,tb_age,dt,ipp,im,ido);
00828 Mm->crb3[i].give_deps_stressinduced (deps_ss,th_age,tb_age_dt,tb_age,sigma,ipp,im,ido);
00829
00830 Mm->crb3[i].store_irrdstrains_eqother(deps_sh,ipp,ido);
00831
00832 Mm->crb3[i].store_stressirrdstrains_eqother(deps_ss,ipp,ido);
00833
00834 Mm->crb3[i].store_hum_eqother(ipp,ido);
00835
00836 Mm->crb3[i].store_temp_eqother(ipp,ido);
00837 break;
00838 }
00839 case creeprs:{
00840 i=Mm->ip[ipp].idm[im];
00841
00842 Mm->crrs[i].previoustime = Mp->time-Mp->dtime;
00843
00844 Mm->crrs[i].compute_ages (ipp,ido);
00845 Mm->crrs[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00846
00847 Mm->crrs[i].give_rettimes(ret_times,n_ret_times,ipp);
00848
00849 Mm->crrs[i].give_hidden_strains_eqother(screep,ipp,ido);
00850
00851
00852 inv_v = Mm->crrs[i].give_inv_v(tl_age);
00853
00854 q4 = Mm->crrs[i].give_q4();
00855 nonlin_func = Mm->crrs[i].give_nonlin_func();
00856
00857
00858
00859 Mm->crrs[i].give_deps_free (deps_sh,th_age,tb_age_dt,tb_age,dt,ipp,im,ido);
00860 Mm->crrs[i].give_deps_stressinduced (deps_ss,th_age,tb_age_dt,tb_age,sigma,ipp,im,ido);
00861
00862 Mm->crrs[i].store_irrdstrains_eqother(deps_sh,ipp,ido);
00863
00864 Mm->crrs[i].store_stressirrdstrains_eqother(deps_ss,ipp,ido);
00865
00866 Mm->crrs[i].store_hum_eqother(ipp,ido);
00867
00868 Mm->crrs[i].store_temp_eqother(ipp,ido);
00869 break;
00870 }
00871 case creepdpl:{
00872 i=Mm->ip[ipp].idm[im];
00873
00874 Mm->crdpl[i].previoustime = Mp->time-Mp->dtime;
00875
00876 Mm->crdpl[i].compute_ages (ipp,ido);
00877 Mm->crdpl[i].give_ages (tb_age_dt,tb_age,tl_age,th_age,dt,timeMax,napproxtime,ipp);
00878
00879 Mm->crdpl[i].give_rettimes(ret_times,n_ret_times,ipp);
00880
00881 Mm->crdpl[i].give_hidden_strains_eqother(screep,ipp,ido);
00882
00883
00884 inv_v = 1.0;
00885
00886 q4 = 0.0;
00887 nonlin_func = 1.0;
00888 break;
00889 }
00890 default:{
00891 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00892 }
00893 }
00894
00895
00896
00897 if (Mm->ip[ipp].tm[im] != creeprs){
00898 t_age=tl_age+0.0001;
00899
00900 m0 = log10(tl_age+0.0001);
00901 m = log10(2.0*timeMax);
00902 k=0;
00903
00904
00905
00906 while (t_age <= 2.0*timeMax){
00907
00908
00909 switch (Mm->ip[ipp].tm[im]){
00910 case creepb3:{
00911 i=Mm->ip[ipp].idm[im];
00912
00913 jt = Mm->crb3[i].b3_law (th_age,tl_age,t_age,ipp,ido);
00914 break;
00915 }
00916 case creepdpl:{
00917 i=Mm->ip[ipp].idm[im];
00918
00919 jt = Mm->crdpl[i].double_power_law (tl_age,t_age,ipp,ido);
00920 break;
00921 }
00922 default:{
00923 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00924 }
00925 }
00926
00927 for (i=0;i<n_ret_times;i++){
00928 delYi=pow((tl_age/ret_times[i]),q)-pow((t_age/ret_times[i]),q);
00929 if(delYi <= exp_prec)
00930 delYi = exp_prec;
00931 bpom[i]=bpom[i]+(1.-exp(delYi))*jt;
00932 for (j=0;j<n_ret_times;j++){
00933 delYj= pow((tl_age/ret_times[j]),q)-pow((t_age/ret_times[j]),q);
00934 if(delYj <= exp_prec)
00935 delYj = exp_prec;
00936 apom[i][j]=apom[i][j]+(1.-exp(delYi))*(1.-exp(delYj));
00937 }
00938 }
00939 k=k+1;
00940
00941 t_age=pow(10.,m0+(m-m0)/napproxtime*k);
00942 }
00943
00944 invm(apom,cpom,1.0e-20);
00945
00946
00947 for (i=0;i<n_ret_times;i++){
00948 for (j=0;j<n_ret_times;j++)
00949 emu[i]=emu[i]+cpom[i][j]*bpom[j];
00950
00951 emu[i]=1./emu[i];
00952 }
00953 }
00954
00955 if (Mm->ip[ipp].tm[im] == creeprs){
00956 jt = Mm->crrs[i].give_J_E_mu(emu,th_age,tb_age,tb_age_dt,ipp,ido);
00957 }
00958
00959
00960 switch (Mm->ip[ipp].tm[im]){
00961 case creepb3:{
00962 i=Mm->ip[ipp].idm[im];
00963 Mm->crb3[i].store_emu_eqother(emu,n_ret_times,ipp,ido);
00964 break;
00965 }
00966 case creeprs:{
00967 i=Mm->ip[ipp].idm[im];
00968 Mm->crrs[i].store_emu_eqother(emu,n_ret_times,ipp,ido);
00969 break;
00970 }
00971 case creepdpl:{
00972 i=Mm->ip[ipp].idm[im];
00973 Mm->crdpl[i].store_emu_eqother(emu,n_ret_times,ipp,ido);
00974 break;
00975 }
00976 default:{
00977 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
00978 }
00979 }
00980
00981
00982 for (i=0;i<n_ret_times;i++){
00983 dj=pow((tb_age + dt)/ret_times[i],q)-pow(tb_age/ret_times[i],q);
00984 param_exp = -dj;
00985 if(param_exp < exp_prec)
00986 param_exp = exp_prec;
00987 for (j=0; j<nc; j++){
00988
00989
00990 deps_cr[j] = deps_cr[j] + nonlin_func*((1.-exp(param_exp))*(screep[j][i]*inv_v));
00991 }
00992 }
00993
00994
00995 if (Mm->ip[ipp].tm[im] == creeprs){
00996 allocv(nc,deps_help);
00997 fillv(0.0,deps_help);
00998 allocm(nc,nc,c);
00999 fillm(0.0,c);
01000 allocv(nc,sigma);
01001 fillv(0.0,sigma);
01002
01003
01004 for (j=0;j<nc;j++){
01005 sigma[j] = Mm->ip[ipp].stress[j];
01006 }
01007 unit_compl_matrix(c,mu,ss);
01008 mxv (c,sigma,deps_help);
01009 if (Mm->ip[ipp].ssst == planestress)
01010 {
01011 deps_help[3] = -mu / (1.0 - mu) * (deps_help[0]+deps_help[1]);
01012 }
01013
01014 for (j=0; j<nc; j++){
01015 deps_cr[j] = deps_cr[j] + nonlin_func*q4*dt/tl_age*deps_help[j];
01016 }
01017 destrv(deps_help);
01018 destrm(c);
01019 destrv(sigma);
01020 }
01021
01022
01023 for(i=0;i<nc;i++){
01024 deps[i]=deps_cr[i]+deps_sh[i]+deps_ss[i];
01025 }
01026
01027
01028 ym = creep_compute_actual_ym (ipp,im,ido);
01029
01030 allocm(nc,nc,d);
01031 fillm(0.0,d);
01032 creep_matstiff (d, ipp, im, ido);
01033 mxv (d,deps,dsigma);
01034 destrm(d);
01035
01036
01037 switch (Mm->ip[ipp].tm[im]){
01038 case creepb3:{
01039 i=Mm->ip[ipp].idm[im];
01040
01041 Mm->crb3[i].addirrstrains_eqother (deps,ipp,ido);
01042
01043 Mm->crb3[i].store_creepdstrains_eqother(deps_cr,ipp,ido);
01044 Mm->crb3[i].store_dstresses_eqother(dsigma,ipp,ido);
01045 break;
01046 }
01047 case creeprs:{
01048 i=Mm->ip[ipp].idm[im];
01049
01050 Mm->crrs[i].addirrstrains_eqother (deps,ipp,ido);
01051
01052 Mm->crrs[i].store_creepdstrains_eqother(deps_cr,ipp,ido);
01053 Mm->crrs[i].store_dstresses_eqother(dsigma,ipp,ido);
01054 break;
01055 }
01056 case creepdpl:{
01057 i=Mm->ip[ipp].idm[im];
01058
01059 Mm->crdpl[i].addirrstrains_eqother (deps,ipp,ido);
01060
01061 Mm->crdpl[i].store_creepdstrains_eqother(deps_cr,ipp,ido);
01062 Mm->crdpl[i].store_dstresses_eqother(dsigma,ipp,ido);
01063 break;
01064 }
01065 default:{
01066 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01067 }
01068 }
01069
01070
01071 destrm(screep);
01072 destrv(deps);
01073 destrv(deps_cr);
01074 destrv(deps_sh);
01075 destrv(deps_ss);
01076 destrv(dsigma);
01077 destrm(apom);
01078 destrm(cpom);
01079 destrv(bpom);
01080 destrv(ret_times);
01081 destrv(emu);
01082 }
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096 void creep_givestressincr (long ipp,long im,long ido,long fi,vector &sig)
01097 {
01098 long i,j,nc;
01099 vector dsigma;
01100
01101
01102 nc=Mm->ip[ipp].ncompstr;
01103
01104
01105 allocv(nc,dsigma);
01106 fillv(0.0,dsigma);
01107
01108
01109 switch (Mm->ip[ipp].tm[im]){
01110 case creepb3:{
01111 i=Mm->ip[ipp].idm[im];
01112 Mm->crb3[i].give_dstresses_eqother(dsigma,ipp,ido);
01113 break;
01114 }
01115 case creeprs:{
01116 i=Mm->ip[ipp].idm[im];
01117 Mm->crrs[i].give_dstresses_eqother(dsigma,ipp,ido);
01118 break;
01119 }
01120 case creepdpl:{
01121 i=Mm->ip[ipp].idm[im];
01122 Mm->crdpl[i].give_dstresses_eqother(dsigma,ipp,ido);
01123 break;
01124 }
01125 default:{
01126 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01127 }
01128 }
01129
01130 for (i=fi,j=0; j<sig.n; i++, j++){
01131 sig[j]=dsigma[i];
01132 }
01133
01134
01135 destrv(dsigma);
01136 }
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149 void creep_incrtotstresses (long ipp,long im,long ido,vector &dsigma)
01150 {
01151 long i,j,nc;
01152 double nu;
01153 vector eps_old,deps,depstot,deps_cr,deps_sh,deps_ss;
01154 matrix d;
01155 strastrestate ss;
01156
01157
01158 nc=Mm->ip[ipp].ncompstr;
01159
01160
01161 ss=Mm->ip[ipp].ssst;
01162
01163
01164 allocv(nc,eps_old);
01165 fillv(0.0,eps_old);
01166 allocv(nc,deps);
01167 fillv(0.0,deps);
01168 allocv(nc,depstot);
01169 fillv(0.0,depstot);
01170 allocv(nc,deps_cr);
01171 fillv(0.0,deps_cr);
01172 allocv(nc,deps_sh);
01173 fillv(0.0,deps_sh);
01174 allocv(nc,deps_ss);
01175 fillv(0.0,deps_ss);
01176
01177
01178 switch (Mm->ip[ipp].tm[im]){
01179 case creepb3:{
01180 i=Mm->ip[ipp].idm[im];
01181
01182 Mm->crb3[i].give_strains_eqother(eps_old,ipp,ido);
01183
01184 Mm->crb3[i].give_creepdstrains_eqother(deps_cr,ipp,ido);
01185
01186 Mm->crb3[i].give_irrdstrains_eqother(deps_sh,ipp,ido);
01187
01188 Mm->crb3[i].give_stressirrdstrains_eqother(deps_ss,ipp,ido);
01189 break;
01190 }
01191 case creeprs:{
01192 i=Mm->ip[ipp].idm[im];
01193
01194 Mm->crrs[i].give_strains_eqother(eps_old,ipp,ido);
01195
01196 Mm->crrs[i].give_creepdstrains_eqother(deps_cr,ipp,ido);
01197
01198 Mm->crrs[i].give_irrdstrains_eqother(deps_sh,ipp,ido);
01199
01200 Mm->crrs[i].give_stressirrdstrains_eqother(deps_ss,ipp,ido);
01201 break;
01202 }
01203 case creepdpl:{
01204 i=Mm->ip[ipp].idm[im];
01205
01206 Mm->crdpl[i].give_strains_eqother(eps_old,ipp,ido);
01207
01208 Mm->crdpl[i].give_creepdstrains_eqother(deps_cr,ipp,ido);
01209 break;
01210 }
01211 default:{
01212 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01213 }
01214 }
01215
01216
01217 nu = Mm->give_actual_nu(ipp);
01218 if (Mm->ip[ipp].ssst == planestress)
01219 {
01220 Mm->ip[ipp].strain[3] = -nu / (1.0 - nu) * (Mm->ip[ipp].strain[0]+Mm->ip[ipp].strain[1]);
01221 }
01222 for (j=0; j<nc; j++){
01223 depstot[j] = Mm->ip[ipp].strain[j] - eps_old[j];
01224 deps[j] = depstot[j] - deps_cr[j] - deps_sh[j] - deps_ss[j];
01225 }
01226
01227
01228 allocm(nc,nc,d);
01229 fillm(0.0,d);
01230 creep_matstiff (d, ipp, im, ido);
01231
01232 mxv (d,deps,dsigma);
01233 destrm(d);
01234
01235
01236 destrv(eps_old);
01237 destrv(deps);
01238 destrv(depstot);
01239 destrv(deps_cr);
01240 destrv(deps_sh);
01241 destrv(deps_ss);
01242 }
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254 void creep_aeging_strains (long ipp,long im,long ido)
01255 {
01256 long i,j,nc;
01257 vector eps_old,eps_ag_old,eps_ir_old,deps_cr,deps_sh,deps_ss;
01258 double ym_old,ym_act;
01259
01260
01261 nc=Mm->ip[ipp].ncompstr;
01262
01263
01264 allocv(nc,eps_old);
01265 fillv(0.0,eps_old);
01266 allocv(nc,eps_ir_old);
01267 fillv(0.0,eps_ir_old);
01268 allocv(nc,deps_cr);
01269 fillv(0.0,deps_cr);
01270 allocv(nc,deps_sh);
01271 fillv(0.0,deps_sh);
01272 allocv(nc,deps_ss);
01273 fillv(0.0,deps_ss);
01274 allocv(nc,eps_ag_old);
01275 fillv(0.0,eps_ag_old);
01276
01277
01278
01279 switch (Mm->ip[ipp].tm[im]){
01280 case creepb3:{
01281 i=Mm->ip[ipp].idm[im];
01282
01283 Mm->crb3[i].give_strains_eqother(eps_old,ipp,ido);
01284
01285 Mm->crb3[i].giveirrstrains_eqother(ipp,ido,eps_ir_old);
01286
01287 Mm->crb3[i].give_creepdstrains_eqother(deps_cr,ipp,ido);
01288
01289 Mm->crb3[i].give_irrdstrains_eqother(deps_sh,ipp,ido);
01290 Mm->crb3[i].give_stressirrdstrains_eqother(deps_ss,ipp,ido);
01291 for (j=0; j<nc; j++)
01292 eps_ir_old[j] = eps_ir_old[j] - deps_cr[j] - deps_sh[j] - deps_ss[j];
01293
01294 Mm->crb3[i].give_agstrains_eqother(ipp,ido,eps_ag_old);
01295
01296 ym_old = Mm->crb3[i].give_ym_old_eqother(ipp,ido);
01297
01298 ym_act = creep_give_actual_ym (ipp,im,ido);
01299 break;
01300 }
01301 case creeprs:{
01302 i=Mm->ip[ipp].idm[im];
01303
01304 Mm->crrs[i].give_strains_eqother(eps_old,ipp,ido);
01305
01306 Mm->crrs[i].giveirrstrains_eqother(ipp,ido,eps_ir_old);
01307
01308 Mm->crrs[i].give_creepdstrains_eqother(deps_cr,ipp,ido);
01309
01310 Mm->crrs[i].give_irrdstrains_eqother(deps_sh,ipp,ido);
01311 Mm->crrs[i].give_stressirrdstrains_eqother(deps_ss,ipp,ido);
01312 for (j=0; j<nc; j++)
01313 eps_ir_old[j] = eps_ir_old[j] - deps_cr[j] - deps_sh[j] - deps_ss[j];
01314
01315 Mm->crrs[i].give_agstrains_eqother(eps_ag_old,ipp,ido);
01316
01317 ym_old = Mm->crrs[i].give_ym_old_eqother(ipp,ido);
01318
01319 ym_act = creep_give_actual_ym (ipp,im,ido);
01320 break;
01321 }
01322 case creepdpl:{
01323 i=Mm->ip[ipp].idm[im];
01324
01325 Mm->crdpl[i].give_strains_eqother(eps_old,ipp,ido);
01326
01327 Mm->crdpl[i].giveirrstrains_eqother(ipp,ido,eps_ir_old);
01328
01329 Mm->crdpl[i].give_creepdstrains_eqother(deps_cr,ipp,ido);
01330
01331 for (j=0; j<nc; j++)
01332 eps_ir_old[j] = eps_ir_old[j] - deps_cr[j];
01333
01334 Mm->crdpl[i].give_agstrains_eqother(ipp,ido,eps_ag_old);
01335
01336 ym_old = Mm->crdpl[i].give_ym_old_eqother(ipp,ido);
01337
01338 ym_act = creep_give_actual_ym (ipp,im,ido);
01339 break;
01340 }
01341 default:{
01342 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01343 }
01344 }
01345
01346 for (j=0; j<nc; j++){
01347 eps_ag_old[j] = (1.0 - ym_old/ym_act)*(eps_old[j] - eps_ir_old[j]) + ym_old/ym_act*eps_ag_old[j];
01348 }
01349
01350
01351 switch (Mm->ip[ipp].tm[im]){
01352 case creepb3:{
01353 Mm->crb3[i].store_agstrains_eqother(ipp,ido,eps_ag_old);
01354 break;
01355 }
01356 case creeprs:{
01357 Mm->crrs[i].store_agstrains_eqother(eps_ag_old,ipp,ido);
01358 break;
01359 }
01360 case creepdpl:{
01361 Mm->crdpl[i].store_agstrains_eqother(ipp,ido,eps_ag_old);
01362 break;
01363 }
01364 default:{
01365 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01366 }
01367 }
01368
01369
01370 destrv(eps_old);
01371 destrv(eps_ir_old);
01372 destrv(deps_cr);
01373 destrv(deps_sh);
01374 destrv(deps_ss);
01375 destrv(eps_ag_old);
01376 }
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388 void creep_nlstresses (long ipp,long im,long ido)
01389 {
01390 long i,j,nc;
01391 vector sigma,sigmao,dsigma,eps,epsag,epscr;
01392
01393
01394 nc=Mm->ip[ipp].ncompstr;
01395
01396
01397 allocv(nc,sigma);
01398 fillv(0.0,sigma);
01399 allocv(nc,sigmao);
01400 fillv(0.0,sigmao);
01401 allocv(nc,dsigma);
01402 fillv(0.0,dsigma);
01403 allocv(nc,eps);
01404 fillv(0.0,eps);
01405 allocv(nc,epsag);
01406 fillv(0.0,epsag);
01407 allocv(nc,epscr);
01408 fillv(0.0,epscr);
01409
01410 creep_incrtotstresses(ipp, im, ido, dsigma);
01411
01412
01413 switch (Mm->ip[ipp].tm[im]){
01414 case creepb3:{
01415 i=Mm->ip[ipp].idm[im];
01416
01417 Mm->crb3[i].give_stresses_eqother(sigmao,ipp,ido);
01418
01419 for (j=0; j<nc; j++)
01420 sigma[j] = sigmao[j] + dsigma[j];
01421
01422 for (j=0;j<nc;j++){
01423 Mm->ip[ipp].stress[j] = sigma[j];
01424 }
01425 break;
01426 }
01427 case creeprs:{
01428 i=Mm->ip[ipp].idm[im];
01429
01430 Mm->crrs[i].give_stresses_eqother(sigmao,ipp,ido);
01431
01432 for (j=0; j<nc; j++)
01433 sigma[j] = sigmao[j] + dsigma[j];
01434
01435 for (j=0;j<nc;j++){
01436 Mm->ip[ipp].stress[j] = sigma[j];
01437 }
01438 break;
01439 }
01440 case creepdpl:{
01441 i=Mm->ip[ipp].idm[im];
01442
01443 Mm->crdpl[i].give_stresses_eqother(sigmao,ipp,ido);
01444
01445 for (j=0; j<nc; j++)
01446 sigma[j] = sigmao[j] + dsigma[j];
01447
01448 for (j=0;j<nc;j++){
01449 Mm->ip[ipp].stress[j] = sigma[j];
01450 }
01451 break;
01452 }
01453 default:{
01454 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01455 }
01456 }
01457
01458
01459 destrv(dsigma);
01460 destrv(sigma);
01461 destrv(sigmao);
01462 }
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476 void creep_hidden_strains (matrix &screep,vector &sig,vector &emu, double mi, long n_ret_times, vector &ret_times, double actualtime, double dt,strastrestate ss)
01477 {
01478 int i;
01479 double q,dj,pomt,pp;
01480 double param_exp,exp_prec=-50;
01481 q=2./3.;
01482 if((actualtime+dt) == dt) {
01483 }
01484 else{
01485 pomt=actualtime+dt;
01486
01487 if(ss==bar){
01488 for (i=0;i<n_ret_times;i++){
01489 dj=pow(pomt/ret_times[i],q)-pow(actualtime/ret_times[i],q);
01490 param_exp = -dj;
01491 if(param_exp < exp_prec)
01492 param_exp = exp_prec;
01493 screep[0][i]=exp(param_exp)*screep[0][i]+sig[0]*(1.-exp(param_exp))/dj/emu[i];
01494 }
01495 }
01496 else if(ss==planestress){
01497 for (i=0;i<n_ret_times;i++){
01498 dj=pow(pomt/ret_times[i],q)-pow(actualtime/ret_times[i],q);
01499 param_exp = -dj;
01500 if(param_exp < exp_prec)
01501 param_exp = exp_prec;
01502 screep[0][i]=exp(param_exp)*screep[0][i]+(sig[0]-mi*sig[1])*(1.-exp(param_exp))/dj/emu[i];
01503 screep[1][i]=exp(param_exp)*screep[1][i]+(sig[1]-mi*sig[0])*(1.-exp(param_exp))/dj/emu[i];
01504 screep[2][i]=exp(param_exp)*screep[2][i]+ sig[2]*2.*(1.+mi)*(1.-exp(param_exp))/dj/emu[i];
01505 screep[3][i]=exp(param_exp)*screep[3][i]+(-mi*sig[0]-mi*sig[1])*(1.-exp(param_exp))/dj/emu[i];
01506 }
01507 }
01508 else if(ss==planestrain){
01509 pp=1.+mi;
01510 for (i=0;i<n_ret_times;i++){
01511 dj=pow(pomt/ret_times[i],q)-pow(actualtime/ret_times[i],q);
01512 param_exp = -dj;
01513 if(param_exp < exp_prec)
01514 param_exp = exp_prec;
01515 screep[0][i]=exp(param_exp)*screep[0][i]+ pp*(sig[0]*(1.-mi)-mi*sig[1])*(1.-exp(param_exp))/dj/emu[i];
01516 screep[1][i]=exp(param_exp)*screep[1][i]+ pp*(sig[1]*(1.-mi)-mi*sig[0])*(1.-exp(param_exp))/dj/emu[i];
01517 screep[2][i]=exp(param_exp)*screep[2][i]+ pp*sig[2]*2. *(1.-exp(param_exp))/dj/emu[i];
01518 screep[3][i]=0.0;
01519 }
01520 }
01521 else if(ss==axisymm){
01522 for (i=0;i<n_ret_times;i++){
01523 dj=pow(pomt/ret_times[i],q)-pow(actualtime/ret_times[i],q);
01524 param_exp = -dj;
01525 if(param_exp < exp_prec)
01526 param_exp = exp_prec;
01527 screep[0][i]=exp(param_exp)*screep[0][i]+(sig[0]-mi*sig[1]-mi*sig[2])*(1.-exp(param_exp))/dj/emu[i];
01528 screep[1][i]=exp(param_exp)*screep[1][i]+(sig[1]-mi*sig[0]-mi*sig[2])*(1.-exp(param_exp))/dj/emu[i];
01529 screep[2][i]=exp(param_exp)*screep[2][i]+(sig[2]-mi*sig[0]-mi*sig[1])*(1.-exp(param_exp))/dj/emu[i];
01530 screep[3][i]=exp(param_exp)*screep[3][i]+ (sig[3]*2.0*(1.0+mi))*(1.-exp(param_exp))/dj/emu[i];
01531 }
01532 }
01533 else if(ss==spacestress){
01534 for (i=0;i<n_ret_times;i++){
01535 dj=pow(pomt/ret_times[i],q)-pow(actualtime/ret_times[i],q);
01536 param_exp = -dj;
01537 if(param_exp < exp_prec)
01538 param_exp = exp_prec;
01539 screep[0][i]=exp(param_exp)*screep[0][i]+(sig[0]-mi*sig[1]-mi*sig[2])*(1.-exp(param_exp))/dj/emu[i];
01540 screep[1][i]=exp(param_exp)*screep[1][i]+(sig[1]-mi*sig[0]-mi*sig[2])*(1.-exp(param_exp))/dj/emu[i];
01541 screep[2][i]=exp(param_exp)*screep[2][i]+(sig[2]-mi*sig[0]-mi*sig[1])*(1.-exp(param_exp))/dj/emu[i];
01542 screep[3][i]=exp(param_exp)*screep[3][i]+ sig[3]*(1.+mi) *(1.-exp(param_exp))/dj/emu[i];
01543 screep[4][i]=exp(param_exp)*screep[4][i]+ sig[4]*(1.+mi) *(1.-exp(param_exp))/dj/emu[i];
01544 screep[5][i]=exp(param_exp)*screep[5][i]+ sig[5]*(1.+mi) *(1.-exp(param_exp))/dj/emu[i];
01545 }
01546 }
01547 }
01548 }
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562 void creep_giveirrstrains (long ipp, long im, long ido, vector &epsir)
01563 {
01564 long i;
01565 vector epsag(epsir.n);
01566
01567 switch (Mm->ip[ipp].tm[im]){
01568 case creepb3:{
01569 i=Mm->ip[ipp].idm[im];
01570 Mm->crb3[i].giveirrstrains_eqother (ipp,ido,epsir);
01571
01572
01573 creep_aeging_strains (ipp,im,ido);
01574 Mm->crb3[i].give_agstrains_eqother(ipp,ido,epsag);
01575 addv(epsir,epsag,epsir);
01576 break;
01577 }
01578 case creeprs:{
01579 i=Mm->ip[ipp].idm[im];
01580 Mm->crrs[i].giveirrstrains_eqother (ipp,ido,epsir);
01581
01582
01583 creep_aeging_strains (ipp,im,ido);
01584 Mm->crrs[i].give_agstrains_eqother(epsag,ipp,ido);
01585 addv(epsir,epsag,epsir);
01586 break;
01587 }
01588 case creepdpl:{
01589 i=Mm->ip[ipp].idm[im];
01590 Mm->crdpl[i].giveirrstrains_eqother (ipp,ido,epsir);
01591
01592
01593 creep_aeging_strains (ipp,im,ido);
01594 Mm->crdpl[i].give_agstrains_eqother(ipp,ido,epsag);
01595 addv(epsir,epsag,epsir);
01596 break;
01597 }
01598 default:{
01599 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01600 }
01601 }
01602 }
01603
01604
01605
01606
01607
01608
01609
01610
01611
01612
01613 long creep_number_rettimes (long ipp,long im)
01614 {
01615 long i,n_ret_times;
01616
01617
01618 switch (Mm->ip[ipp].tm[im]){
01619 case creepb3:{
01620 i=Mm->ip[ipp].idm[im];
01621
01622
01623 n_ret_times = Mm->crb3[i].give_nret_time();
01624 break;
01625 }
01626 case creeprs:{
01627 i=Mm->ip[ipp].idm[im];
01628
01629
01630 n_ret_times = Mm->crrs[i].give_nret_time();
01631 break;
01632 }
01633 case creepdpl:{
01634 i=Mm->ip[ipp].idm[im];
01635
01636
01637 n_ret_times = Mm->crdpl[i].give_nret_time();
01638 break;
01639 }
01640 default:{
01641 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01642 }
01643 }
01644
01645 return(n_ret_times);
01646 }
01647
01648
01649
01650
01651
01652
01653
01654
01655
01656
01657 long creep_ncompo (long ipp,long im)
01658 {
01659 long i,ncompo;
01660
01661
01662 switch (Mm->ip[ipp].tm[im]){
01663 case creepb3:{
01664 i=Mm->ip[ipp].idm[im];
01665
01666 ncompo = Mm->crb3[i].give_nceqother (ipp);
01667 break;
01668 }
01669 case creeprs:{
01670 i=Mm->ip[ipp].idm[im];
01671
01672 ncompo = Mm->crrs[i].give_nceqother (ipp);
01673 break;
01674 }
01675 case creepdpl:{
01676 i=Mm->ip[ipp].idm[im];
01677
01678 ncompo = Mm->crdpl[i].give_nceqother (ipp);
01679 break;
01680 }
01681 default:{
01682 print_err("\n Unknown material type required in ", __FILE__, __LINE__, __func__);
01683 }
01684 }
01685
01686 return(ncompo);
01687 }
01688
01689
01690
01691
01692
01693
01694
01695
01696 void unit_compl_matrix (matrix &c,double nu,strastrestate ssst)
01697 {
01698 fillm(0.0,c);
01699
01700 switch (ssst){
01701 case bar:{
01702 c[0][0] = 1.0;
01703 break;
01704 }
01705 case plbeam:{
01706 c[0][0] = 1.0;
01707 c[1][1] = 1/(1/2.0/(1.0+nu));
01708 c[2][2] = 1.0;
01709 break;
01710 }
01711 case spacebeam:{
01712 c[0][0] = 1;
01713 c[1][1] = 1.0/(1/2.0/(1.0+nu));
01714 c[2][2] = 1.0/(1/2.0/(1.0+nu));
01715 c[3][3] = 1.0/(1/2.0/(1.0+nu));
01716 c[4][4] = 1;
01717 c[5][5] = 1;
01718 break;
01719 }
01720 case planestress:{
01721 double g;
01722
01723 g = 1.0/(2*(1.0+nu))*2.0*(1+nu);
01724
01725 c[0][0] = g; c[0][1] = -nu*g; c[0][2] = 0.0;
01726 c[1][0] = -nu*g; c[1][1] = g; c[1][2] = 0.0;
01727 c[2][0] = 0.0; c[2][1] = 0.0; c[2][2] = 1;
01728
01729 break;
01730 }
01731 case planestrain:{
01732 double g;
01733
01734 g = (1.0 - nu)/2.0*2.0*(1+nu);
01735
01736 c[0][0] = g; c[0][1] = -nu/2.0; c[0][2] = 0.0;
01737 c[1][0] = -nu/2.0; c[1][1] = g; c[1][2] = 0.0;
01738 c[2][0] = 0.0; c[2][1] = 0.0; c[2][2] = 1;
01739
01740 break;
01741 }
01742
01743 case axisymm:{
01744 double g;
01745 g = 2.0*(1.0+nu);
01746
01747 c[0][0]=1.0; c[0][1]=-nu; c[0][2]=c[0][1]; c[0][3]=0.0;
01748 c[1][0]=c[0][1]; c[1][1]=c[0][0]; c[1][2]=c[0][1]; c[1][3]=0.0;
01749 c[2][0]=c[0][1]; c[2][1]=c[0][1]; c[2][2]=c[0][0]; c[2][3]=0.0;
01750 c[3][0]=c[0][3]; c[3][1]=c[1][3]; c[3][2]=c[2][3]; c[3][3]=g;
01751 break;
01752 }
01753
01754 case spacestress:{
01755 c[0][0]=1; c[0][1]=-nu; c[0][2]=-nu;
01756 c[1][0]=c[0][1]; c[1][1]=c[0][0]; c[1][2]=c[0][1];
01757 c[2][0]=c[0][1]; c[2][1]=c[0][1]; c[2][2]=c[0][0];
01758 c[3][3]=2.0*(1.0+nu);
01759 c[4][4]=2.0*(1.0+nu);
01760 c[5][5]=2.0*(1.0+nu);
01761 break;
01762 }
01763 default:{
01764 print_err("unknown number of components of stress tensor is required", __FILE__, __LINE__, __func__);
01765 }
01766 }
01767 }