Changeset 24063
- Timestamp:
- 07/04/19 02:11:46 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
r24061 r24063 33 33 CreateFaces(iomodel); 34 34 for(int i=0;i<iomodel->numberoffaces;i++){ 35 35 36 /*Get left and right elements*/ 36 37 int element=iomodel->faces[4*i+2]-1; //faces are [node1 node2 elem1 elem2] … … 303 304 304 305 /*Intermediaries */ 306 bool meltflag; 305 307 IssmDouble Jdet,w,v2,vx,vy,ub,h,h_r; 306 308 IssmDouble G,m,frictionheat,alpha2; … … 317 319 318 320 /*Retrieve all inputs and parameters*/ 319 bool meltflag;321 element->GetVerticesCoordinates(&xyz_list); 320 322 element->FindParam(&meltflag,HydrologyMeltFlagEnum); 321 element->GetVerticesCoordinates(&xyz_list);322 323 IssmDouble L = element->FindParam(MaterialsLatentheatEnum); 323 324 IssmDouble rho_ice = element->FindParam(MaterialsRhoIceEnum); … … 362 363 b_input->GetInputValue(&b,gauss); 363 364 H_input->GetInputValue(&H,gauss); 364 m_input->GetInputValue(&m,gauss);365 365 366 366 /*Get basal velocity*/ … … 375 375 frictionheat=alpha2*ub*ub; 376 376 377 /*Compute melt */377 /*Compute melt (if necessary)*/ 378 378 if(!meltflag){ 379 379 m = (G + frictionheat)/(rho_ice*L); 380 380 } 381 else{ 382 m_input->GetInputValue(&m,gauss); 383 } 381 384 382 385 /*Compute closing rate*/ 383 /*See Gagliardini and Werder 2018 eq. A2 (v = v2(phi_i) + v1*phi_{i+1})*/384 386 phi_0 = rho_water*g*b + rho_ice*g*H; 385 387 A=pow(B,-n); … … 433 435 434 436 /*Intermediaries */ 435 IssmDouble Jdet,vx,vy,ub,h_old,N,h_r ;436 IssmDouble A,B,n ;437 IssmDouble Jdet,vx,vy,ub,h_old,N,h_r,H,b; 438 IssmDouble A,B,n,phi,phi_0; 437 439 IssmDouble alpha,beta; 438 440 … … 444 446 445 447 /*Retrieve all inputs and parameters*/ 446 IssmDouble dt = element->FindParam(TimesteppingTimeStepEnum); 447 IssmDouble l_r = element->FindParam(HydrologyCavitySpacingEnum); 448 IssmDouble dt = element->FindParam(TimesteppingTimeStepEnum); 449 IssmDouble l_r = element->FindParam(HydrologyCavitySpacingEnum); 450 IssmDouble rho_ice = element->FindParam(MaterialsRhoIceEnum); 451 IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum); 452 IssmDouble g = element->FindParam(ConstantsGEnum); 448 453 Input* hr_input = element->GetInput(HydrologyBumpHeightEnum);_assert_(hr_input); 449 454 Input* vx_input = element->GetInput(VxEnum);_assert_(vx_input); 450 455 Input* vy_input = element->GetInput(VyEnum);_assert_(vy_input); 451 Input* N_input = element->GetInput(EffectivePressureEnum); _assert_(N_input); 452 Input* h_input = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input); 456 Input* H_input = element->GetInput(ThicknessEnum); _assert_(H_input); 457 Input* b_input = element->GetInput(BedEnum); _assert_(b_input); 458 Input* h_input = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input); 453 459 Input* B_input = element->GetInput(MaterialsRheologyBEnum); _assert_(B_input); 454 460 Input* n_input = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 461 Input* phi_input = element->GetInput(HydraulicPotentialEnum); _assert_(phi_input); 455 462 456 463 /* Start looping on the number of gaussian points: */ … … 460 467 461 468 /*Get input values at gauss points*/ 469 phi_input->GetInputValue(&phi,gauss); 462 470 vx_input->GetInputValue(&vx,gauss); 463 471 vy_input->GetInputValue(&vy,gauss); … … 465 473 B_input->GetInputValue(&B,gauss); 466 474 n_input->GetInputValue(&n,gauss); 467 N_input->GetInputValue(&N,gauss);468 475 hr_input->GetInputValue(&h_r,gauss); 476 b_input->GetInputValue(&b,gauss); 477 H_input->GetInputValue(&H,gauss); 478 479 /*Get values for a few potentials*/ 480 phi_0 = rho_water*g*b + rho_ice*g*H; 481 N = phi_0 - phi; 469 482 470 483 /*Get basal velocity*/ … … 485 498 486 499 /*Get new sheet thickness*/ 487 h_new[iv] = ODE1(alpha,beta,h_old,dt, 0);500 h_new[iv] = ODE1(alpha,beta,h_old,dt,1); 488 501 489 502 /*Make sure it is positive*/
Note:
See TracChangeset
for help on using the changeset viewer.