Changeset 22841
- Timestamp:
- 06/13/18 02:10:04 (7 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
r22364 r22841 74 74 bool isefficientlayer; 75 75 int hydrology_model; 76 76 77 77 /*Fetch data needed: */ 78 78 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); … … 161 161 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 162 162 loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 163 } 163 } 164 164 } 165 165 } … … 233 233 active_element_input = basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input); 234 234 } 235 235 236 236 /* Start looping on the number of gaussian points: */ 237 237 Gauss* gauss=basalelement->NewGauss(2); … … 250 250 D[0][0]=D_scalar; 251 251 D[1][1]=D_scalar; 252 GetB(B,basalelement,xyz_list,gauss); 252 GetB(B,basalelement,xyz_list,gauss); 253 253 TripleMultiply(B,2,numnodes,1, 254 254 &D[0][0],2,2,0, … … 265 265 basis,1,numnodes,0, 266 266 &Ke->values[0],1); 267 267 268 268 /*Transfer EPL part*/ 269 269 if(isefficientlayer){ … … 288 288 delete gauss; 289 289 if(domaintype!=Domain2DhorizontalEnum){ 290 basalelement->DeleteMaterials(); 290 basalelement->DeleteMaterials(); 291 291 delete basalelement; 292 292 } … … 412 412 delete gauss; 413 413 if(domaintype!=Domain2DhorizontalEnum){ 414 basalelement->DeleteMaterials(); 414 basalelement->DeleteMaterials(); 415 415 delete basalelement; 416 416 } … … 419 419 420 420 void HydrologyDCInefficientAnalysis::GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/ 421 /*Compute B matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 421 /*Compute B matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 422 422 * For node i, Bi can be expressed in the actual coordinate system 423 * by: 423 * by: 424 424 * Bi=[ dN/dx ] 425 425 * [ dN/dy ] … … 507 507 IssmDouble rho_ice = basalelement->GetMaterialParameter(MaterialsRhoIceEnum); 508 508 IssmDouble g = basalelement->GetMaterialParameter(ConstantsGEnum); 509 509 510 510 basalelement->GetInputListOnVertices(thickness,ThicknessEnum); 511 511 basalelement->GetInputListOnVertices(base,BaseEnum); … … 542 542 xDelete<int>(doflist); 543 543 if(domaintype!=Domain2DhorizontalEnum){ 544 basalelement->DeleteMaterials(); 544 basalelement->DeleteMaterials(); 545 545 delete basalelement; 546 546 } … … 554 554 IssmDouble HydrologyDCInefficientAnalysis::SedimentStoring(Element* element,Gauss* gauss,Input* sed_head_input, Input* base_input){/*{{{*/ 555 555 int unconf_scheme; 556 IssmDouble expfac; 556 IssmDouble expfac; 557 557 IssmDouble sediment_storing; 558 558 IssmDouble storing,yield; … … 610 610 sed_head_input->GetInputValue(&prestep_head,gauss); 611 611 water_sheet=max(0.0,(prestep_head-(base_elev-sediment_thickness))); 612 612 613 613 //min definition of the if test 614 614 sediment_transmitivity=FullLayer_transmitivity*min(water_sheet/sediment_thickness,1.); … … 625 625 626 626 void HydrologyDCInefficientAnalysis::GetHydrologyDCInefficientHmax(IssmDouble* ph_max,Element* element, Node* innode){/*{{{*/ 627 627 628 628 int hmax_flag; 629 629 IssmDouble h_max; … … 632 632 /*Get the flag to the limitation method*/ 633 633 element->FindParam(&hmax_flag,HydrologydcSedimentlimitFlagEnum); 634 634 635 635 /*Switch between the different cases*/ 636 636 switch(hmax_flag){ … … 674 674 case 1: 675 675 element->FindParam(&leakage,HydrologydcLeakageFactorEnum); 676 transfer=+leakage; 676 transfer=+leakage; 677 677 break; 678 678 default: … … 698 698 _assert_(epl_head_input); 699 699 epl_head_input->GetInputValue(&epl_head,gauss); 700 if (element->Id()==42){701 _printf_("epl head in sed Pvec transfer is "<< epl_head <<"\n");702 }703 700 element->FindParam(&leakage,HydrologydcLeakageFactorEnum); 704 701 transfer=+epl_head*leakage; … … 718 715 element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i)); 719 716 Input* node_mask_input = element->GetInput(HydrologydcMaskEplactiveNodeEnum); _assert_(node_mask_input); 720 717 721 718 if(node_mask_input->Max()>0.){ 722 719 element_active = true; -
issm/trunk-jpl/src/c/classes/Loads/Friction.cpp
r22047 r22841 13 13 #include "../classes.h" 14 14 #include "shared/shared.h" 15 /*}}}*/ 15 /*}}}*/ 16 16 17 17 /*Constructors/destructors*/ … … 88 88 89 89 switch(CoupledFlag){ 90 //This should be removed at some point and the Enum uniformalized 90 91 case 0: 91 92 Neff=gravity*(rho_ice*thickness+rho_water*(base-sealevel)); … … 95 96 break; 96 97 case 2: 97 element->GetInputValue(&Neff,gauss,EffectivePressure Enum);98 element->GetInputValue(&Neff,gauss,EffectivePressureTimeAverageEnum); 98 99 break; 99 100 default: … … 174 175 void Friction::GetAlphaViscousComplement(IssmDouble* palpha_complement, Gauss* gauss){/*{{{*/ 175 176 176 /* FrictionGetAlpha2 computes alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*base, r=q/p and s=1/p. 177 * FrictionGetAlphaComplement is used in control methods on drag, and it computes: 177 /* FrictionGetAlpha2 computes alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*base, r=q/p and s=1/p. 178 * FrictionGetAlphaComplement is used in control methods on drag, and it computes: 178 179 * alpha_complement= Neff ^r * vel ^s*/ 179 180 … … 207 208 case 0: 208 209 Neff=gravity*(rho_ice*thickness+rho_water*(base-sealevel)); 209 break; 210 break; 210 211 case 1: 211 212 element->GetInputValue(&Neff,gauss,FrictionEffectivePressureEnum); 212 213 break; 213 214 case 2: 214 element->GetInputValue(&Neff,gauss,EffectivePressure Enum);215 element->GetInputValue(&Neff,gauss,EffectivePressureTimeAverageEnum); 215 216 break; 216 217 default: … … 285 286 void Friction::GetAlpha2Coulomb(IssmDouble* palpha2, Gauss* gauss){/*{{{*/ 286 287 287 /*This routine calculates the basal friction coefficient 288 /*This routine calculates the basal friction coefficient 288 289 alpha2= drag^2 * Neff ^r * | vel | ^(s-1), with Neff=rho_ice*g*thickness+rho_ice*g*base, r=q/p and s=1/p**/ 289 290 … … 319 320 case 0: 320 321 Neff=gravity*(rho_ice*thickness+rho_water*(base-sealevel)); 321 break; 322 break; 322 323 case 1: 323 324 element->GetInputValue(&Neff,gauss,FrictionEffectivePressureEnum); 324 325 break; 325 326 case 2: 326 element->GetInputValue(&Neff,gauss,EffectivePressure Enum);327 element->GetInputValue(&Neff,gauss,EffectivePressureTimeAverageEnum); 327 328 break; 328 329 default: … … 370 371 void Friction::GetAlpha2Hydro(IssmDouble* palpha2, Gauss* gauss){/*{{{*/ 371 372 372 /*This routine calculates the basal friction coefficient 373 /*This routine calculates the basal friction coefficient 373 374 Based on Gagliardini 2007, needs a good effective pressure computation 374 375 Not tested so far so use at your own risks … … 405 406 IssmDouble gravity = element->GetMaterialParameter(ConstantsGEnum); 406 407 element->parameters->FindParam(&CoupledFlag,FrictionCouplingEnum); 407 408 408 409 switch(CoupledFlag){ 409 410 case 0: 410 411 Neff=gravity*(rho_ice*thickness+rho_water*(base-sealevel)); 411 break; 412 break; 412 413 case 1: 413 414 element->GetInputValue(&Neff,gauss,FrictionEffectivePressureEnum); 414 415 break; 415 416 case 2: 416 element->GetInputValue(&Neff,gauss,EffectivePressure Enum);417 element->GetInputValue(&Neff,gauss,EffectivePressureTimeAverageEnum); 417 418 break; 418 419 default: … … 453 454 Gamma=(Chi/(1. + alpha * pow(Chi,q_exp))); 454 455 /*Check to prevent dividing by zero if vmag==0*/ 455 if(vmag==0.) alpha2=0.; 456 if(vmag==0.) alpha2=0.; 456 457 else if (Neff==0) alpha2=0.0; 457 458 else alpha2=Neff * C_param * pow(Gamma,1./n) * 1/vmag; … … 570 571 void Friction::GetAlpha2Viscous(IssmDouble* palpha2, Gauss* gauss){/*{{{*/ 571 572 572 /*This routine calculates the basal friction coefficient 573 /*This routine calculates the basal friction coefficient 573 574 alpha2= drag^2 * Neff ^r * | vel | ^(s-1), with Neff=rho_ice*g*thickness+rho_ice*g*base, r=q/p and s=1/p**/ 574 575 … … 607 608 break; 608 609 case 2: 609 element->GetInputValue(&Neff,gauss,EffectivePressure Enum);610 element->GetInputValue(&Neff,gauss,EffectivePressureTimeAverageEnum); 610 611 break; 611 612 default: … … 644 645 void Friction::GetAlpha2WaterLayer(IssmDouble* palpha2, Gauss* gauss){/*{{{*/ 645 646 646 /*This routine calculates the basal friction coefficient 647 /*This routine calculates the basal friction coefficient 647 648 alpha2= drag^2 * Neff ^r * | vel | ^(s-1), with Neff=rho_ice*g*thickness+rho_ice*g*base, r=q/p and s=1/p**/ 648 649 -
issm/trunk-jpl/src/c/cores/hydrology_core.cpp
r22372 r22841 1 1 /*!\file: hydrology_core.cpp 2 * \brief: core of the hydrology solution 3 */ 2 * \brief: core of the hydrology solution 3 */ 4 4 5 5 #include "./cores.h" … … 23 23 femmodel->parameters->FindParam(&save_results,SaveResultsEnum); 24 24 femmodel->parameters->FindParam(&hydrology_model,HydrologyModelEnum); 25 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 25 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 26 26 femmodel->parameters->FindParam(&numoutputs,HydrologyNumRequestedOutputsEnum); 27 27 if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,HydrologyRequestedOutputsEnum); … … 36 36 femmodel->SetCurrentConfiguration(HydrologyShreveAnalysisEnum); 37 37 solutionsequence_nonlinear(femmodel,modify_loads); 38 38 39 39 /*transfer water column thickness to old water column thickness: */ 40 40 InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum); 41 41 42 42 } 43 43 … … 90 90 /*save preceding timestep*/ 91 91 InputDuplicatex(femmodel,SedimentHeadEnum,SedimentHeadOldEnum); 92 InputDuplicatex(femmodel,EplHeadEnum,EplHeadOldEnum);93 InputDuplicatex(femmodel,HydrologydcEplThicknessEnum,HydrologydcEplThicknessOldEnum);94 92 /*Proceed now to heads computations*/ 95 93 solutionsequence_hydro_nonlinear(femmodel); … … 110 108 } 111 109 } 112 else if (hydrology_model==HydrologysommersEnum){ 113 femmodel->SetCurrentConfiguration(HydrologySommersAnalysisEnum); 114 InputDuplicatex(femmodel,HydrologyHeadEnum,HydrologyHeadOldEnum); 115 solutionsequence_shakti_nonlinear(femmodel); 110 else if (hydrology_model==HydrologysommersEnum){ 111 femmodel->SetCurrentConfiguration(HydrologySommersAnalysisEnum); 112 InputDuplicatex(femmodel,HydrologyHeadEnum,HydrologyHeadOldEnum); 113 solutionsequence_shakti_nonlinear(femmodel); 116 114 if(VerboseSolution()) _printf0_(" updating gap height\n"); 117 115 HydrologySommersAnalysis* analysis = new HydrologySommersAnalysis(); … … 126 124 femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs); 127 125 } 128 /*Free ressources:*/ 126 /*Free ressources:*/ 129 127 if(numoutputs){ 130 128 for(int i=0;i<numoutputs;i++){ … … 134 132 } 135 133 } 136
Note:
See TracChangeset
for help on using the changeset viewer.