Changeset 22488 for issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
- Timestamp:
- 03/01/18 14:48:25 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r22473 r22488 302 302 IssmDouble calvingrate[NUMVERTICES]; 303 303 IssmDouble vx,vy,vel; 304 IssmDouble rheology_B,critical_fraction,water_height;305 IssmDouble b athymetry,Ho,thickness,float_depth,groundedice;304 IssmDouble critical_fraction,water_height; 305 IssmDouble bed,Ho,thickness,float_depth; 306 306 IssmDouble surface_crevasse[NUMVERTICES], basal_crevasse[NUMVERTICES], crevasse_depth[NUMVERTICES], H_surf, H_surfbasal; 307 307 IssmDouble strainparallel, straineffective; 308 IssmDouble yts;308 IssmDouble s_xx,s_xy,s_yy,s1,s2,stmp; 309 309 310 310 /* Get node coordinates and dof list: */ … … 313 313 /*Get the critical fraction of thickness surface and basal crevasses penetrate for calving onset*/ 314 314 this->parameters->FindParam(&critical_fraction,CalvingCrevasseDepthEnum); 315 this->parameters->FindParam(&yts,ConstantsYtsEnum);316 315 317 316 IssmDouble rho_ice = this->GetMaterialParameter(MaterialsRhoIceEnum); … … 321 320 IssmDouble rheology_n = this->GetMaterialParameter(MaterialsRheologyNEnum); 322 321 323 Input* B_input = inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(B_input); 324 Input* H_input = inputs->GetInput(ThicknessEnum); _assert_(H_input); 325 Input* bed = inputs->GetInput(BedEnum); _assert_(bed); 326 Input* surface = inputs->GetInput(SurfaceEnum); _assert_(surface); 327 Input* strainrateparallel = inputs->GetInput(StrainRateparallelEnum); _assert_(strainrateparallel); 328 Input* strainrateeffective = inputs->GetInput(StrainRateeffectiveEnum); _assert_(strainrateeffective); 329 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 330 Input* vy_input = inputs->GetInput(VxEnum); _assert_(vy_input); 331 Input* gr_input = inputs->GetInput(MaskGroundediceLevelsetEnum); _assert_(gr_input); 332 Input* waterheight_input = inputs->GetInput(WaterheightEnum); _assert_(waterheight_input); 333 322 Input* H_input = inputs->GetInput(ThicknessEnum); _assert_(H_input); 323 Input* bed_input = inputs->GetInput(BedEnum); _assert_(bed_input); 324 Input* surface_input = inputs->GetInput(SurfaceEnum); _assert_(surface_input); 325 Input* strainrateparallel_input = inputs->GetInput(StrainRateparallelEnum); _assert_(strainrateparallel_input); 326 Input* strainrateeffective_input = inputs->GetInput(StrainRateeffectiveEnum); _assert_(strainrateeffective_input); 327 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 328 Input* vy_input = inputs->GetInput(VxEnum); _assert_(vy_input); 329 Input* waterheight_input = inputs->GetInput(WaterheightEnum); _assert_(waterheight_input); 330 Input* s_xx_input = inputs->GetInput(DeviatoricStressxxEnum); _assert_(s_xx_input); 331 Input* s_xy_input = inputs->GetInput(DeviatoricStressxyEnum); _assert_(s_xy_input); 332 Input* s_yy_input = inputs->GetInput(DeviatoricStressyyEnum); _assert_(s_yy_input); 333 334 334 /*Loop over all elements of this partition*/ 335 335 GaussTria* gauss=new GaussTria(); … … 337 337 gauss->GaussVertex(iv); 338 338 339 B_input->GetInputValue(&rheology_B,gauss);340 339 H_input->GetInputValue(&thickness,gauss); 341 bed ->GetInputValue(&bathymetry,gauss);342 surface ->GetInputValue(&float_depth,gauss);343 strainrateparallel ->GetInputValue(&strainparallel,gauss);344 strainrateeffective ->GetInputValue(&straineffective,gauss);340 bed_input->GetInputValue(&bed,gauss); 341 surface_input->GetInputValue(&float_depth,gauss); 342 strainrateparallel_input->GetInputValue(&strainparallel,gauss); 343 strainrateeffective_input->GetInputValue(&straineffective,gauss); 345 344 vx_input->GetInputValue(&vx,gauss); 346 345 vy_input->GetInputValue(&vy,gauss); 347 gr_input->GetInputValue(&groundedice,gauss);348 346 waterheight_input->GetInputValue(&water_height,gauss); 347 s_xx_input->GetInputValue(&s_xx,gauss); 348 s_xy_input->GetInputValue(&s_xy,gauss); 349 s_yy_input->GetInputValue(&s_yy,gauss); 350 349 351 vel=sqrt(vx*vx+vy*vy)+1.e-14; 350 352 351 Ho = thickness - (rho_seawater/rho_ice) * (-bathymetry); 353 s1=(s_xx+s_yy)/2.+sqrt(pow((s_xx-s_yy)/2.,2)+pow(s_xy,2)); 354 s2=(s_xx+s_yy)/2.-sqrt(pow((s_xx-s_yy)/2.,2)+pow(s_xy,2)); 355 if(fabs(s2)>fabs(s1)){stmp=s2; s2=s1; s1=stmp;} 356 357 Ho = thickness - (rho_seawater/rho_ice) * (-bed); 352 358 if(Ho<0.) Ho=0.; 353 359 354 360 /*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/ 355 361 /*surface crevasse*/ 356 surface_crevasse[iv] = rheology_B * strainparallel * pow(straineffective, ((1 / rheology_n)-1)) / (rho_ice * constant_g);357 //surface_crevasse[iv] = 2 * rheology_B * pow(max(strainparallel,0.),(1/rheology_n)) / (rho_ice *constant_g);362 //surface_crevasse[iv] = rheology_B * strainparallel * pow(straineffective, ((1 / rheology_n)-1)) / (rho_ice * constant_g); 363 surface_crevasse[iv] = s1 / (rho_ice*constant_g); 358 364 if (surface_crevasse[iv]<0.) { 359 365 surface_crevasse[iv]=0.; 360 366 water_height = 0.; 361 367 } 362 if (surface_crevasse[iv]<water_height){363 water_height = surface_crevasse[iv];364 }368 //if (surface_crevasse[iv]<water_height){ 369 // water_height = surface_crevasse[iv]; 370 //} 365 371 366 372 /*basal crevasse*/ 367 basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (rheology_B * strainparallel * pow(straineffective,((1/rheology_n)-1)) / (rho_ice*constant_g) - Ho);368 //basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (2 * rheology_B * pow(max(strainparallel,0.),(1/rheology_n)) / (rho_ice*constant_g) -Ho);373 //basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (rheology_B * strainparallel * pow(straineffective,((1/rheology_n)-1)) / (rho_ice*constant_g) - Ho); 374 basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (s1/ (rho_ice*constant_g)-Ho); 369 375 if (basal_crevasse[iv]<0.) basal_crevasse[iv]=0.; 370 if (b athymetry>0.) basal_crevasse[iv] = 0.;376 if (bed>0.) basal_crevasse[iv] = 0.; 371 377 372 378 H_surf = surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height - critical_fraction*float_depth; … … 374 380 375 381 crevasse_depth[iv] = max(H_surf,H_surfbasal); 382 } 376 383 377 /*Assign values */378 if(crevasse_depth[iv]>=0. && bathymetry<=0.){379 calvingrate[iv] = vel+3000./yts;380 }381 else382 calvingrate[iv]=0.;383 }384 385 384 this->inputs->AddInput(new TriaInput(SurfaceCrevasseEnum,&surface_crevasse[0],P1Enum)); 386 385 this->inputs->AddInput(new TriaInput(BasalCrevasseEnum,&basal_crevasse[0],P1Enum)); 387 386 this->inputs->AddInput(new TriaInput(CrevasseDepthEnum,&crevasse_depth[0],P1Enum)); 388 this->inputs->AddInput(new TriaInput(CalvingCalvingrateEnum,&calvingrate[0],P1Enum));389 387 390 388 delete gauss;
Note:
See TracChangeset
for help on using the changeset viewer.