Changeset 22181 for issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
- Timestamp:
- 10/20/17 16:28:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r22178 r22181 216 216 IssmDouble calvingrate[NUMVERTICES]; 217 217 IssmDouble lambda1,lambda2,ex,ey,vx,vy,vel; 218 IssmDouble sigma_vm,sigma_max,sigma_max_floating,sigma_max_grounded; 218 IssmDouble sigma_vm[NUMVERTICES]; 219 IssmDouble sigma_max,sigma_max_floating,sigma_max_grounded; 219 220 IssmDouble epse_2,groundedice,bed; 220 221 … … 260 261 /*Calculate sigma_vm*/ 261 262 epse_2 = 1./2. *(lambda1*lambda1 + lambda2*lambda2); 262 sigma_vm = sqrt(3.) * B * pow(epse_2,1./(2.*n));263 sigma_vm[iv] = sqrt(3.) * B * pow(epse_2,1./(2.*n)); 263 264 264 265 /*OLD (keep for a little bit)*/ … … 279 280 } 280 281 else{ 281 calvingratex[iv]=vx*sigma_vm /sigma_max;282 calvingratey[iv]=vy*sigma_vm /sigma_max;282 calvingratex[iv]=vx*sigma_vm[iv]/sigma_max; 283 calvingratey[iv]=vy*sigma_vm[iv]/sigma_max; 283 284 } 284 285 calvingrate[iv] =sqrt(calvingratex[iv]*calvingratex[iv] + calvingratey[iv]*calvingratey[iv]); … … 289 290 this->inputs->AddInput(new TriaInput(CalvingrateyEnum,&calvingratey[0],P1Enum)); 290 291 this->inputs->AddInput(new TriaInput(CalvingCalvingrateEnum,&calvingrate[0],P1Enum)); 292 this->inputs->AddInput(new TriaInput(SigmaVMEnum,&sigma_vm[0],P1Enum)); 291 293 292 294 /*Clean up and return*/ 295 delete gauss; 296 } 297 /*}}}*/ 298 void Tria::CalvingCrevasseDepth(){/*{{{*/ 299 300 IssmDouble xyz_list[NUMVERTICES][3]; 301 IssmDouble calvingrate[NUMVERTICES]; 302 IssmDouble vx,vy,vel; 303 IssmDouble critical_fraction,water_height; 304 IssmDouble bathymetry,Ho,thickness,float_depth,groundedice; 305 IssmDouble surface_crevasse[NUMVERTICES], basal_crevasse[NUMVERTICES], crevasse_depth[NUMVERTICES], H_surf, H_surfbasal; 306 IssmDouble strainparallel, straineffective; 307 IssmDouble yts; 308 309 /* Get node coordinates and dof list: */ 310 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 311 312 /*Get the critical fraction of thickness surface and basal crevasses penetrate for calving onset*/ 313 this->parameters->FindParam(&critical_fraction,CalvingCrevasseDepthEnum); 314 this->parameters->FindParam(&yts,ConstantsYtsEnum); 315 316 IssmDouble rho_ice = this->GetMaterialParameter(MaterialsRhoIceEnum); 317 IssmDouble rho_seawater = this->GetMaterialParameter(MaterialsRhoSeawaterEnum); 318 IssmDouble rho_freshwater = this->GetMaterialParameter(MaterialsRhoFreshwaterEnum); 319 IssmDouble constant_g = this->GetMaterialParameter(ConstantsGEnum); 320 IssmDouble rheology_B = this->GetMaterialParameter(MaterialsRheologyBbarEnum); 321 IssmDouble rheology_n = this->GetMaterialParameter(MaterialsRheologyNEnum); 322 323 Input* H_input = inputs->GetInput(ThicknessEnum); _assert_(H_input); 324 Input* bed = inputs->GetInput(BedEnum); _assert_(bed); 325 Input* surface = inputs->GetInput(SurfaceEnum); _assert_(surface); 326 Input* strainrateparallel = inputs->GetInput(StrainRateparallelEnum); _assert_(strainrateparallel); 327 Input* strainrateeffective = inputs->GetInput(StrainRateeffectiveEnum); _assert_(strainrateeffective); 328 Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input); 329 Input* vy_input = inputs->GetInput(VxEnum); _assert_(vy_input); 330 Input* gr_input = inputs->GetInput(MaskGroundediceLevelsetEnum); _assert_(gr_input); 331 Input* waterheight_input = inputs->GetInput(WaterheightEnum); _assert_(waterheight_input); 332 333 /*Loop over all elements of this partition*/ 334 GaussTria* gauss=new GaussTria(); 335 for (int iv=0;iv<NUMVERTICES;iv++){ 336 gauss->GaussVertex(iv); 337 338 H_input->GetInputValue(&thickness,gauss); 339 bed->GetInputValue(&bathymetry,gauss); 340 surface->GetInputValue(&float_depth,gauss); 341 strainrateparallel->GetInputValue(&strainparallel,gauss); 342 strainrateeffective->GetInputValue(&straineffective,gauss); 343 vx_input->GetInputValue(&vx,gauss); 344 vy_input->GetInputValue(&vy,gauss); 345 gr_input->GetInputValue(&groundedice,gauss); 346 waterheight_input->GetInputValue(&water_height,gauss); 347 vel=sqrt(vx*vx+vy*vy)+1.e-14; 348 349 Ho = thickness - (rho_seawater/rho_ice) * (-bathymetry); 350 if(Ho<0.) Ho=0.; 351 352 /*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/ 353 /*surface crevasse*/ 354 //surface_crevasse[iv] = rheology_B * strainparallel * pow(straineffective, ((1 / rheology_n)-1)) / (rho_ice * constant_g); 355 surface_crevasse[iv] = 2 * rheology_B * pow(max(strainparallel,0.),(1/rheology_n)) / (rho_ice * constant_g); 356 if (surface_crevasse[iv]<0.) { 357 surface_crevasse[iv]=0.; 358 water_height = 0.; 359 } 360 if (surface_crevasse[iv]<water_height){ 361 water_height = surface_crevasse[iv]; 362 } 363 364 /*basal crevasse*/ 365 //basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (rheology_B * strainparallel * pow(straineffective,((1/rheology_n)-1)) / (rho_ice*constant_g) - Ho); 366 basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (2 * rheology_B * pow(max(strainparallel,0.),(1/rheology_n)) / (rho_ice*constant_g) - Ho); 367 if (basal_crevasse[iv]<0.) basal_crevasse[iv]=0.; 368 if (bathymetry>0.) basal_crevasse[iv] = 0.; 369 370 H_surf = surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height - critical_fraction*float_depth; 371 H_surfbasal = (surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height + basal_crevasse[iv])-(critical_fraction*thickness); 372 373 crevasse_depth[iv] = max(H_surf,H_surfbasal); 374 375 /*Assign values */ 376 if(crevasse_depth[iv]>=0. && bathymetry<=0.){ 377 calvingrate[iv] = vel+3000./yts; 378 } 379 else 380 calvingrate[iv]=0.; 381 } 382 383 this->inputs->AddInput(new TriaInput(SurfaceCrevasseEnum,&surface_crevasse[0],P1Enum)); 384 this->inputs->AddInput(new TriaInput(BasalCrevasseEnum,&basal_crevasse[0],P1Enum)); 385 this->inputs->AddInput(new TriaInput(CrevasseDepthEnum,&crevasse_depth[0],P1Enum)); 386 this->inputs->AddInput(new TriaInput(CalvingCalvingrateEnum,&calvingrate[0],P1Enum)); 387 293 388 delete gauss; 294 389 } … … 331 426 332 427 /*Calving rate proportionnal to the positive product of the strain rate along the ice flow direction and the strain rate perpendicular to the ice flow */ 333 calvingrate[iv]=propcoeff*strainparallel*strainperpendicular; 334 if(calvingrate[iv]<0. || bed>0.){ 428 if(strainparallel>0. && strainperpendicular>0. && bed<=0.){ 429 calvingrate[iv]=propcoeff*strainparallel*strainperpendicular; 430 } 431 else 335 432 calvingrate[iv]=0.; 336 }433 337 434 calvingratex[iv]=calvingrate[iv]*vx/(sqrt(vel)+1.e-14); 338 435 calvingratey[iv]=calvingrate[iv]*vy/(sqrt(vel)+1.e-14);
Note:
See TracChangeset
for help on using the changeset viewer.