Changeset 26696
- Timestamp:
- 12/02/21 08:09:53 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
r26650 r26696 202 202 IssmDouble Jdet; 203 203 IssmDouble* xyz_list = NULL; 204 IssmDouble gap,bed,thickness,head,g,rho_ice,rho_water,A,B,n ,head_old;/***/204 IssmDouble gap,bed,thickness,head,g,rho_ice,rho_water,A,B,n; 205 205 206 206 /*Fetch number of nodes and dof for this finite element*/ … … 223 223 element->FindParam(&dt,TimesteppingTimeStepEnum); 224 224 225 /* **Get all inputs and parameters*/225 /*Get all inputs and parameters*/ 226 226 element->FindParam(&rho_water,MaterialsRhoFreshwaterEnum); 227 227 element->FindParam(&rho_ice,MaterialsRhoIceEnum); … … 233 233 Input* head_input = element->GetInput(HydrologyHeadEnum); _assert_(head_input); 234 234 Input* base_input = element->GetInput(BaseEnum); _assert_(base_input); 235 Input* head_old_input = element->GetInput(HydrologyHeadOldEnum); _assert_(head_old_input);236 235 237 236 /* Start looping on the number of gaussian points: */ … … 248 247 gap_input->GetInputValue(&gap,gauss); 249 248 head_input->GetInputValue(&head,gauss); 250 head_old_input->GetInputValue(&head_old,gauss); 251 252 /***Get ice A parameter*/ 249 250 /*Get ice A parameter*/ 253 251 B_input->GetInputValue(&B,gauss); 254 252 n_input->GetInputValue(&n,gauss); 255 253 A=pow(B,-n); 256 254 257 /* **Get water and ice pressures*/255 /*Get water and ice pressures*/ 258 256 IssmDouble pressure_ice = rho_ice*g*thickness; _assert_(pressure_ice>0.); 259 257 IssmDouble pressure_water = rho_water*g*(head-bed); 260 258 if(pressure_water>pressure_ice) pressure_water = pressure_ice; 261 259 262 /***Get water pressure from previous time step to use in lagged creep term*/263 IssmDouble pressure_water_old = rho_water*g*(head_old-bed);264 if(pressure_water_old>pressure_ice) pressure_water_old = pressure_ice;265 260 266 261 … … 293 288 IssmDouble PMPheat,dpressure_water[2],dbed[2]; 294 289 IssmDouble* xyz_list = NULL; 295 IssmDouble dgapxx; /***/296 IssmDouble dgapyy; /***/290 // IssmDouble dgapxx; /***/ 291 // IssmDouble dgapyy; /***/ 297 292 298 293 /*Fetch number of nodes and dof for this finite element*/ … … 320 315 Input* br_input = element->GetInput(HydrologyBumpHeightEnum); _assert_(br_input); 321 316 Input* headold_input = element->GetInput(HydrologyHeadOldEnum); _assert_(headold_input); 322 Input* dgapxx_input = element->GetInput(HydrologyGapHeightXXEnum); /***/323 Input* dgapyy_input = element->GetInput(HydrologyGapHeightYYEnum); /***/317 // Input* dgapxx_input = element->GetInput(HydrologyGapHeightXXEnum); /***/ 318 // Input* dgapyy_input = element->GetInput(HydrologyGapHeightYYEnum); /***/ 324 319 325 320 /*Get conductivity from inputs*/ … … 351 346 br_input->GetInputValue(&br,gauss); 352 347 headold_input->GetInputValue(&head_old,gauss); 353 dgapxx_input->GetInputValue(&dgapxx,gauss); /***/354 dgapyy_input->GetInputValue(&dgapyy,gauss); /***/348 // dgapxx_input->GetInputValue(&dgapxx,gauss); /***/ 349 // dgapyy_input->GetInputValue(&dgapyy,gauss); /***/ 355 350 356 351 /*Get ice A parameter*/ … … 365 360 beta = 0.; 366 361 367 /* TEST Compute lc term */368 // if(gap<br)369 // lc = gap*(1-(br-gap)/br);370 // else371 lc = gap;372 // lc=gap*tanh(pow(gap,3)/pow(br,3));373 // lc=pow(gap,2)/lr;374 375 362 /*Compute frictional heat flux*/ 376 363 friction->GetAlpha2(&alpha2,gauss); … … 378 365 frictionheat=alpha2*(vx*vx+vy*vy); 379 366 380 /* *** TEST take out frictional heat for large gap height ****/367 /* Take out frictional heat for large gap height */ 381 368 if(gap>br) 382 369 frictionheat=0.; … … 399 386 _assert_(meltrate>0.); 400 387 401 402 // for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*403 // (404 // meltrate*(1/rho_water-1/rho_ice)405 // +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice - pressure_water)*gap406 // -beta*sqrt(vx*vx+vy*vy)407 // +ieb408 // +storage*head_old/dt409 // )*basis[i];410 411 /* With weighted creep term*/412 // for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*413 // (414 // meltrate*(1/rho_water-1/rho_ice)415 // +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap416 // +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap417 // -beta*sqrt(vx*vx+vy*vy)418 // +ieb419 // +storage*head_old/dt420 // )*basis[i];421 422 /* With weighted creep term */423 388 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight* 424 389 ( … … 443 408 // )*basis[i]; 444 409 445 446 410 447 // /*Test with linear creep rate*/448 // for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*449 // (450 // meltrate*(1/rho_water-1/rho_ice)451 // +(pressure_ice - pressure_water)*gap/pow(10,13)452 // -beta*sqrt(vx*vx+vy*vy)453 // +ieb454 // +storage*head_old/dt455 // )*basis[i];456 411 } 457 412 /*Clean up and return*/ … … 597 552 IssmDouble q = 0.; 598 553 IssmDouble channelization = 0.; 599 IssmDouble dgapxx; /***/600 IssmDouble dgapyy; /***/554 // IssmDouble dgapxx; /***/ 555 // IssmDouble dgapyy; /***/ 601 556 602 557 /*Retrieve all inputs and parameters*/ … … 616 571 Input* lr_input = element->GetInput(HydrologyBumpSpacingEnum); _assert_(lr_input); 617 572 Input* br_input = element->GetInput(HydrologyBumpHeightEnum); _assert_(br_input); 618 Input* dgapxx_input = element->GetInput(HydrologyGapHeightXXEnum); /***/619 Input* dgapyy_input = element->GetInput(HydrologyGapHeightYYEnum); /***/573 // Input* dgapxx_input = element->GetInput(HydrologyGapHeightXXEnum); /***/ 574 // Input* dgapyy_input = element->GetInput(HydrologyGapHeightYYEnum); /***/ 620 575 621 576 /*Get conductivity from inputs*/ … … 643 598 lr_input->GetInputValue(&lr,gauss); 644 599 br_input->GetInputValue(&br,gauss); 645 dgapxx_input->GetInputValue(&dgapxx,gauss); /***/646 dgapyy_input->GetInputValue(&dgapyy,gauss); /***/600 // dgapxx_input->GetInputValue(&dgapxx,gauss); /***/ 601 // dgapyy_input->GetInputValue(&dgapyy,gauss); /***/ 647 602 648 603 /*Get ice A parameter*/ … … 657 612 beta = 0.; 658 613 659 /* TEST Compute lc term*/660 // if(gap<br)661 // lc = gap*(1-(br-gap)/br);662 // else663 lc = gap;664 // lc=gap*tanh(pow(gap,3)/pow(br,3));665 // lc = pow(gap,2)/lr;666 667 614 /*Compute frictional heat flux*/ 668 615 friction->GetAlpha2(&alpha2,gauss); … … 670 617 frictionheat=alpha2*(vx*vx+vy*vy); 671 618 672 /* *** TEST take out frictional heat for large gap height ****/619 /* Take out frictional heat for large gap height */ 673 620 if(gap>br) 674 621 frictionheat=0.; … … 702 649 703 650 704 /*TEST with linear creep rate*/705 // newgap += gauss->weight*Jdet*(gap+dt*(706 // meltrate/rho_ice707 // -(pressure_ice-pressure_water)*gap/pow(10,13)708 // +beta*sqrt(vx*vx+vy*vy)709 // ));710 651 totalweights +=gauss->weight*Jdet; 711 652
Note:
See TracChangeset
for help on using the changeset viewer.