00001
00002
00003
00004
00005
00006
00007 #include <stdio.h>
00008 #include <stdlib.h>
00009 #include <math.h>
00010 #include "aliast.h"
00011 #include "onemedium.h"
00012 #include "globalt.h"
00013
00014 med1::med1()
00015 {
00016
00017 scale = 1.0;
00018 }
00019 med1::~med1()
00020 {}
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 void med1::matcond (matrix &d,long ri,long ci,long ipp)
00032 {
00033 long i;
00034
00035 i = Tm->ip[ipp].idm;
00036
00037 switch (Tm->ip[ipp].tm){
00038 case bazantpedersen:{
00039 Tm->bazped[i].matcond(d,ri,ci,ipp);
00040 break;
00041 }
00042 case pedersen:{
00043 Tm->ped[i].matcond(d,ri,ci,ipp);
00044 break;
00045 }
00046
00047 case carb1mat:{
00048 Tm->carb1[i].matcond(d,ri,ci,ipp);
00049 break;
00050 }
00051 case sejtkr:{
00052 Tm->sejtkrm[i].matcond(d,ri,ci,ipp);
00053 break;
00054 }
00055 case consolawf1:{
00056 Tm->consol_awf1[i].matcond(d,ri,ci,ipp);
00057 break;
00058 }
00059 case richardsmat:{
00060 Tm->richar[i].matcond (d,0,0,ipp);
00061 break;
00062 }
00063 case isotransmat:{
00064 Tm->itrm[i].matcond(d,ri,ci,ipp);
00065 break;
00066 }
00067 case nlisotransmat:{
00068 Tm->nlitrm[i].matcond(d,ri,ci,ipp);
00069 break;
00070 }
00071 case discontisotrmat:{
00072 Tm->ditrm[i].matcond(d,ri,ci,ipp);
00073 break;
00074 }
00075 case cernyconcrete:{
00076 Tm->cernym[i].matcond(d,ri,ci,ipp);
00077 break;
00078 }
00079 case cementhydrmat:{
00080 Tm->cemhydr[i].matcond(d,ri,ci,ipp);
00081 break;
00082 }
00083 case lincoupledmat:{
00084 Tm->lcmat[i].matcond(d,ri,ci,ipp);
00085 break;
00086 }
00087 case damisotransmat:{
00088 Tm->damitrm[i].matcond(d,ri,ci,ipp);
00089 break;
00090 }
00091 case radiationmater:{
00092 Tm->radmat[i].matcond(d,ri,ci,ipp);
00093 break;
00094 }
00095 default:{
00096 print_err("\n unknown material type is required in ", __FILE__, __LINE__, __func__);
00097 }
00098 }
00099 }
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 void med1::matcond2 (matrix &d,long ri,long ci,long ipp)
00113 {
00114 long i;
00115
00116
00117 i = Tm->ip[ipp].idm;
00118
00119 switch (Tm->ip[ipp].tm){
00120 case isotransmat:{
00121 break;
00122 }
00123 case nlisotransmat:{
00124 break;
00125 }
00126 case homomat:{
00127 break;
00128 }
00129 case damisotransmat:{
00130 break;
00131 }
00132 case sejtkr:
00133 case consolawf1:{
00134 break;
00135 }
00136 case bazantpedersen:{
00137
00138 break;
00139 }
00140 case pedersen:{
00141
00142 break;
00143 }
00144 case kunzel:{
00145
00146 break;
00147 }
00148 case kunzel2:{
00149
00150 break;
00151 }
00152 case grunewald:{
00153
00154 break;
00155 }
00156 case simplediscmat:{
00157
00158 break;
00159 }
00160 case devries:{
00161
00162 break;
00163 }
00164 case milly:{
00165
00166 break;
00167 }
00168 case lincoupledmat:{
00169 break;
00170 }
00171 case salt1mat:{
00172
00173 break;
00174 }
00175 case consolawf2:{
00176
00177 break;
00178 }
00179 case richardsmat:{
00180 Tm->richar[i].matcond2 (d,ri,ci,ipp);
00181 break;
00182 }
00183 default:{
00184 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00185 }
00186 }
00187 }
00188
00189
00190
00191
00192
00193
00194
00195
00196 void med1::matcap (double &c,long ri,long ci,long ipp)
00197 {
00198 long i;
00199
00200 i = Tm->ip[ipp].idm;
00201
00202 switch (Tm->ip[ipp].tm){
00203 case bazantpedersen:{
00204 Tm->bazped[i].matcap(c,ri,ci,ipp);
00205 break;
00206 }
00207 case pedersen:{
00208 Tm->ped[i].matcap(c,ri,ci,ipp);
00209 break;
00210 }
00211 case carb1mat:{
00212 Tm->carb1[i].matcap(c,ri,ci,ipp);
00213 break;
00214 }
00215 case richardsmat:{
00216 Tm->richar[i].matcap (c,ri,ci,ipp);
00217 break;
00218 }
00219 case consolawf1:{
00220 Tm->consol_awf1[i].matcap(c,ri,ci,ipp);
00221 break;
00222 }
00223 case sejtkr:{
00224 Tm->sejtkrm[i].matcap(c,ri,ci,ipp);
00225 break;
00226 }
00227 case isotransmat:{
00228 Tm->itrm[i].matcap(c,ri,ci,ipp);
00229 break;
00230 }
00231 case nlisotransmat:{
00232 Tm->nlitrm[i].matcap(c,ri,ci,ipp);
00233 break;
00234 }
00235 case damisotransmat:{
00236 Tm->damitrm[i].matcap(c,ri,ci,ipp);
00237 break;
00238 }
00239 case discontisotrmat:{
00240 Tm->ditrm[i].matcap(c,ri,ci,ipp);
00241 break;
00242 }
00243 case cernyconcrete:{
00244 Tm->cernym[i].matcap(c,ri,ci,ipp);
00245 break;
00246 }
00247 case cementhydrmat:{
00248 Tm->cemhydr[i].matcap(c,ri,ci,ipp);
00249 break;
00250 }
00251 case lincoupledmat:{
00252 Tm->lcmat[i].matcap(c,ri,ci,ipp);
00253 break;
00254 }
00255 case radiationmater:{
00256 Tm->radmat[i].matcap(c,ri,ci,ipp);
00257 break;
00258 }
00259 default:{
00260 print_err("\n unknown material type is required in ", __FILE__, __LINE__, __func__);
00261 }
00262 }
00263 }
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275 void med1::rhs_volume (matrix &d,long ri, long ci,long ipp)
00276 {
00277 long i;
00278
00279
00280 i = Tm->ip[ipp].idm;
00281
00282 switch (Tm->ip[ipp].tm){
00283 case sejtkr:
00284 Tm->sejtkrm[i].rhs_volume(d,ri,ci,ipp);
00285 break;
00286 case consolawf1:
00287 Tm->consol_awf1[i].rhs_volume(d,ri,ci,ipp);
00288 break;
00289 case isotransmat:
00290 case nlisotransmat:
00291 case discontisotrmat:
00292 case cernyconcrete:
00293 case damisotransmat:
00294 case cementhydrmat:
00295 case lincoupledmat:
00296 case bazantpedersen:
00297 case pedersen:
00298 case carb1mat:
00299 case richardsmat:
00300 break;
00301 default:{
00302 print_err ("unknown material type is required",__FILE__,__LINE__,__func__);
00303 }
00304 }
00305 }
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321 double med1::transmission_transcoeff(double trc,long ri,long ci,long nn,long bc,long ipp)
00322 {
00323 double new_trc;
00324
00325 switch (Tp->mednam){
00326 case moisture:{
00327
00328 switch (bc){
00329 case 30:{
00330 new_trc=1.0;
00331 break;
00332 }
00333 default:{
00334 print_err("\n No real boundary condition is prescribed in ", __FILE__, __LINE__, __func__);
00335 exit(0);
00336 }
00337 }
00338
00339 break;
00340 }
00341 case heat:{
00342
00343 switch (bc){
00344 case 11:{
00345 new_trc=trc;
00346 }
00347 case 30:{
00348 new_trc=1.0;
00349 break;
00350 }
00351 case 31:{
00352 new_trc=0.0;
00353 break;
00354 }
00355 case 90:{
00356 new_trc=0.0;
00357 break;
00358 }
00359 default:{
00360 print_err("\n No real boundary condition is prescribed in ", __FILE__, __LINE__, __func__);
00361 exit(0);
00362 }
00363 }
00364
00365 break;
00366 }
00367 default:{
00368 print_err("\n Unknown media name is required in ", __FILE__, __LINE__, __func__);
00369 }
00370 }
00371 new_trc = new_trc*trc;
00372 return(new_trc);
00373 }
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390 double med1::transmission_nodval(double nodval,double trc2,long ri,long ci,long nn,long bc,long ipp)
00391 {
00392 double new_nodval;
00393 long k;
00394 double t,w;
00395
00396 switch (Tp->mednam){
00397 case moisture:{
00398
00399 k=Gtt->give_dof(nn,0);
00400 if (k>0) {w = Lsrst->lhs[k-1]+Lsrst->lhsi[k-1];}
00401 if (k==0) {w = 0.0;}
00402 if (k<0) {w = Tb->lc[0].pv[0-k-1].getval();}
00403
00404 switch (bc){
00405 case 30:{
00406 new_nodval = nodval;
00407 break;
00408 }
00409 default:{
00410 print_err("\n No real boundary condition is prescribed in ", __FILE__, __LINE__, __func__);
00411 exit(0);
00412 }
00413 }
00414
00415 break;
00416 }
00417 case heat:{
00418
00419 k=Gtt->give_dof(nn,0);
00420 if (k>0) {t = Lsrst->lhs[k-1]+Lsrst->lhsi[k-1];}
00421 if (k==0) {t = 0.0;}
00422 if (k<0) {t = Tb->lc[0].pv[0-k-1].getval();}
00423
00424 switch (bc){
00425 case 11:{
00426 new_nodval = nodval;
00427 break;
00428 }
00429 case 30:{
00430 new_nodval = nodval;
00431 break;
00432 }
00433 case 31:{
00434 new_nodval = (nodval - t);
00435 break;
00436 }
00437 case 90:{
00438 new_nodval = (nodval - t) + trc2*(nodval*nodval*nodval*nodval - t*t*t*t);
00439 break;
00440 }
00441 default:{
00442 print_err("\n No real boundary condition is prescribed in ", __FILE__, __LINE__, __func__);
00443 exit(0);
00444 }
00445 }
00446
00447 break;
00448 }
00449 default:{
00450 print_err("\n Unknown media name is required in ", __FILE__, __LINE__, __func__);
00451 }
00452 }
00453 return(new_nodval);
00454 }
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471 double med1::transmission_flux(double nodval,double trc2,long ri,long ci,long nn,long bc,long ipp)
00472 {
00473 double flux;
00474 long k;
00475 double t,w;
00476
00477 switch (Tp->mednam){
00478 case moisture:{
00479
00480 k=Gtt->give_dof(nn,0);
00481 if (k>0) {w = Lsrst->lhs[k-1]+Lsrst->lhsi[k-1];}
00482 if (k==0) {w = 0.0;}
00483 if (k<0) {w = Tb->lc[0].pv[0-k-1].getval();}
00484
00485 switch (bc){
00486 case 30:{
00487 flux = (nodval - w);
00488 break;
00489 }
00490 default:{
00491 print_err("\n No real boundary condition is prescribed in ", __FILE__, __LINE__, __func__);
00492 exit(0);
00493 }
00494 }
00495
00496 break;
00497 }
00498 case heat:{
00499
00500 k=Gtt->give_dof(nn,0);
00501 if (k>0) {t = Lsrst->lhs[k-1]+Lsrst->lhsi[k-1];}
00502 if (k==0) {t = 0.0;}
00503 if (k<0) {t = Tb->lc[0].pv[0-k-1].getval();}
00504
00505 switch (bc){
00506 case 30:{
00507 flux = (nodval - t);
00508 break;
00509 }
00510 case 31:{
00511 flux = (nodval - t);
00512 break;
00513 }
00514 case 90:{
00515 flux = (nodval - t) + trc2*(nodval*nodval*nodval*nodval - t*t*t*t);
00516 break;
00517 }
00518 default:{
00519 print_err("\n No real boundary condition is prescribed in ", __FILE__, __LINE__, __func__);
00520 exit(0);
00521 }
00522 }
00523
00524 break;
00525 }
00526 default:{
00527 print_err("\n Unknown media name is required in ", __FILE__, __LINE__, __func__);
00528 }
00529 }
00530
00531 return(flux);
00532
00533 }
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544 double med1::compute_othervalues (long compother,long ipp,double *r)
00545 {
00546 long i;
00547 double other;
00548
00549 i = Tm->ip[ipp].idm;
00550
00551 switch (Tm->ip[ipp].tm){
00552 case sejtkr:{
00553 double pw;
00554
00555 pw = r[0];
00556
00557 other = Tm->sejtkrm[i].get_othervalue(compother,pw,ipp);
00558 break;
00559 }
00560 case consolawf1:{
00561 double pw;
00562
00563 pw = r[0];
00564
00565 other = Tm->consol_awf1[i].get_othervalue(compother,pw,ipp);
00566 break;
00567 }
00568 case bazantpedersen:{
00569 double w,t;
00570
00571 w = r[0];
00572 t = 0.0;
00573
00574 other = Tm->bazped[i].get_othervalue(compother,w,t);
00575 break;
00576 }
00577 case pedersen:{
00578 double w,t;
00579
00580 w = r[0];
00581 t = 0.0;
00582
00583 other = Tm->ped[i].get_othervalue(compother,w,t);
00584 break;
00585 }
00586
00587 case richardsmat:{
00588 break;
00589 }
00590
00591 default:{
00592 print_err("\n Unknown material type is required in ", __FILE__, __LINE__, __func__);
00593 }
00594 }
00595
00596 return(other);
00597 }
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607 void med1::print_othervaluesnames (FILE *out,long ipp,long compother)
00608 {
00609 long i;
00610
00611 i = Tm->ip[ipp].idm;
00612
00613 switch (Tm->ip[ipp].tm){
00614 case bazantpedersen:{
00615 Tm->bazped[i].print_othervalue_name(out,compother);
00616 break;
00617 }
00618 case pedersen:{
00619 Tm->ped[i].print_othervalue_name(out,compother);
00620 break;
00621 }
00622 case sejtkr:{
00623 Tm->sejtkrm[i].print_othervalue_name(out,compother);
00624 break;
00625 }
00626 case consolawf1:{
00627 Tm->consol_awf1[i].print_othervalue_name(out,compother);
00628 break;
00629 }
00630 case damisotransmat:
00631 Tm->damitrm[i].print_othervalue_name(out,compother);
00632 break;
00633 default:{
00634 print_err("\n Unknown material type is required in ", __FILE__, __LINE__, __func__);
00635 }
00636 }
00637 }