Changeset 23977
- Timestamp:
- 05/31/19 20:03:07 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Channel.cpp ¶
r23973 r23977 381 381 Input* n_input = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 382 382 Input* ks_input = element->GetInput(HydrologySheetConductivityEnum); _assert_(ks_input); 383 Input* phiold_input = element->GetInput(HydraulicPotentialOldEnum); _assert_(phiold_input);384 383 Input* phi_input = element->GetInput(HydraulicPotentialEnum); _assert_(phi_input); 385 384 … … 402 401 403 402 /*Get input values at gauss points*/ 403 phi_input->GetInputDerivativeValue(&dphi[0],&xyz_list_tria[0][0],gauss); 404 b_input->GetInputDerivativeValue(&db[0],&xyz_list_tria[0][0],gauss); 404 405 phi_input->GetInputValue(&phi,gauss); 405 phi_input->GetInputDerivativeValue(&dphi[0],&xyz_list_tria[0][0],gauss);406 406 h_input->GetInputValue(&h,gauss); 407 407 ks_input->GetInputValue(&ks,gauss); … … 409 409 n_input->GetInputValue(&n,gauss); 410 410 b_input->GetInputValue(&b,gauss); 411 b_input->GetInputDerivativeValue(&db[0],&xyz_list_tria[0][0],gauss);412 411 H_input->GetInputValue(&H,gauss); 413 412 … … 484 483 /*Intermediaries */ 485 484 IssmDouble Jdet,v2,Afactor,Bfactor,fFactor; 486 IssmDouble A,B,n,phi_old,phi,phi_0,dphimds ;487 IssmDouble H,h,b,db[2],dphids,qc,dPw,ks ;485 IssmDouble A,B,n,phi_old,phi,phi_0,dphimds,dphi[2]; 486 IssmDouble H,h,b,db[2],dphids,qc,dPw,ks,Ngrad; 488 487 IssmDouble xyz_list[NUMVERTICES][3]; 489 488 IssmDouble xyz_list_tria[3][3]; … … 512 511 Input* n_input = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 513 512 Input* ks_input = element->GetInput(HydrologySheetConductivityEnum); _assert_(ks_input); 514 Input* phiold_input = element->GetInput(HydraulicPotentialOldEnum); _assert_(phiold_input);515 513 Input* phi_input = element->GetInput(HydraulicPotentialEnum); _assert_(phi_input); 516 514 … … 531 529 /*Get input values at gauss points*/ 532 530 b_input->GetInputDerivativeValue(&db[0],&xyz_list_tria[0][0],gauss); 531 phi_input->GetInputDerivativeValue(&dphi[0],&xyz_list_tria[0][0],gauss); 533 532 h_input->GetInputValue(&h,gauss); 534 533 ks_input->GetInputValue(&ks,gauss); … … 540 539 541 540 /*Get values for a few potentials*/ 541 phi_0 = rho_water*g*b + rho_ice*g*H; 542 dphids = dphi[0]*tx + dphi[1]*ty; 542 543 dphimds = rho_water*g*(db[0]*tx + db[1]*ty); 544 Ngrad = fabs(dphids); 545 if(Ngrad<1.e-12) Ngrad = 1.e-12; 543 546 544 547 /*Compute the effective conductivity Kc = k h^alpha |grad Phi|^{beta-2} (same for sheet)*/ 545 IssmDouble Kc = kc * pow(this->S,ALPHA_C) * pow( fabs(dphids),BETA_C-2.);546 IssmDouble Ks = ks * pow(h ,ALPHA_S) * pow( fabs(dphids),BETA_S-2.);548 IssmDouble Kc = kc * pow(this->S,ALPHA_C) * pow(Ngrad,BETA_C-2.); 549 IssmDouble Ks = ks * pow(h ,ALPHA_S) * pow(Ngrad,BETA_S-2.); 547 550 548 551 /*Approx. discharge in the sheet flowing folwing in the direction of the channel ofver a width lc*/ … … 564 567 /*Compute closing rate*/ 565 568 /*See Gagliardini and Werder 2018 eq. A2 (v = v2(phi_i) + v1*phi_{i+1})*/ 566 phi_0 = rho_water*g*b + rho_ice*g*H;567 569 A=pow(B,-n); 568 570 v2 = 2./pow(n,n)*A*this->S*(pow(fabs(phi_0 - phi),n-1.)*(phi_0 +(n-1.)*phi)); … … 616 618 Input* n_input = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 617 619 Input* ks_input = element->GetInput(HydrologySheetConductivityEnum); _assert_(ks_input); 618 Input* phiold_input = element->GetInput(HydraulicPotentialOldEnum); _assert_(phiold_input);619 620 Input* phi_input = element->GetInput(HydraulicPotentialEnum); _assert_(phi_input); 620 621 … … 676 677 /*Compute new S based on Forward Euler (explicit)*/ 677 678 this->S = this->S + dt*( (Xi - Pi)/(rho_ice*L) - vc); 678 if(this->S<0 ); this->S = 0.;679 if(this->S<0.); this->S = 0.; 679 680 680 681 /*Clean up and return*/
Note:
See TracChangeset
for help on using the changeset viewer.