Changeset 21463
- Timestamp:
- 01/03/17 14:21:29 (8 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologySommersAnalysis.cpp
r21211 r21463 120 120 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 121 121 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 122 //iomodel->FetchDataToInput(elements,"md.hydrology.eff_pressure",EffectivePressureEnum);123 122 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 123 124 124 /*Friction law variables*/ 125 125 switch(frictionlaw){ … … 147 147 parameters->AddObject(new IntParam(HydrologyModelEnum,hydrology_model)); 148 148 parameters->AddObject(iomodel->CopyConstantObject("md.friction.law",FrictionLawEnum)); 149 parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.relaxation",HydrologyRelaxationEnum)); 149 150 }/*}}}*/ 150 151 … … 178 179 /*Get conductivity from inputs*/ 179 180 IssmDouble conductivity = GetConductivity(element); 180 //if(element->Id()==1){181 // printf("Conductivity at CreateKMatrix: %g \n",conductivity);182 //}183 181 184 182 /* Start looping on the number of gaussian points: */ … … 245 243 /*Get conductivity from inputs*/ 246 244 IssmDouble conductivity = GetConductivity(element); 247 //if(element->Id()==1){248 // printf("Conductivity in CreatePVector: %g \n",conductivity);249 //}250 245 251 246 /*Build friction element, needed later: */ … … 306 301 meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1])-PMPheat); 307 302 _assert_(meltrate>0.); 308 303 309 304 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight* 310 305 ( 311 306 meltrate*(1/rho_water-1/rho_ice) 312 +A*pow(fabs(pressure_ice - pressure_water _old),n-1)*(pressure_ice - pressure_water_old)*gap307 +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice - pressure_water)*gap 313 308 -beta*sqrt(vx*vx+vy*vy) 314 309 +ieb … … 354 349 element->GetInputListOnNodes(&bed[0],BaseEnum); 355 350 351 /*Get head from previous time-step and under-relaxation coefficient to use in under-relaxation for nonlinear convergence*/ 352 IssmDouble* head_old = xNew<IssmDouble>(numnodes); 353 element->GetInputListOnNodes(&head_old[0],HydrologyHeadEnum); 354 IssmDouble relaxation; 355 element->FindParam(&relaxation,HydrologyRelaxationEnum); 356 356 357 /*Use the dof list to index into the solution vector: */ 357 358 for(int i=0;i<numnodes;i++){ … … 367 368 values[i] = bed[i]; 368 369 } 370 371 /*Under-relaxation*/ 372 values[i] = head_old[i] - relaxation*(head_old[i]-values[i]); 369 373 370 374 /*Calculate effective pressure*/ … … 385 389 IssmDouble conductivity = GetConductivity(element); 386 390 387 IssmDouble reynolds = conductivity*sqrt(dh[0]*dh[0]+dh[1]*dh[1])/ (2.*NU);391 IssmDouble reynolds = conductivity*sqrt(dh[0]*dh[0]+dh[1]*dh[1])/NU; 388 392 element->AddInput(HydrologyReynoldsEnum,&reynolds,P0Enum); 389 393 390 /*Free ressources:*/ 394 /*Calculate basal flux for output*/ 395 IssmDouble q = conductivity*sqrt(dh[0]*dh[0]+dh[1]*dh[1]); 396 element->AddInput(HydrologyBasalFluxEnum,&q,P1Enum); 397 398 /*Free resources:*/ 391 399 xDelete<IssmDouble>(values); 392 400 xDelete<IssmDouble>(thickness); … … 395 403 xDelete<int>(doflist); 396 404 xDelete<IssmDouble>(eff_pressure); 405 xDelete<IssmDouble>(head_old); 397 406 }/*}}}*/ 398 407 void HydrologySommersAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/ … … 468 477 /*Get conductivity from inputs*/ 469 478 IssmDouble conductivity = GetConductivity(element); 470 //if(element->Id()==1){ 471 // printf("Conductivity at gap update: %g \n",conductivity); 472 //} 479 473 480 /*Build friction element, needed later: */ 474 481 Friction* friction=new Friction(element,2); … … 537 544 /*Divide by connectivity*/ 538 545 newgap = newgap/totalweights; 539 IssmDouble mingap = 1e- 5;546 IssmDouble mingap = 1e-6; 540 547 if(newgap<mingap) newgap=mingap; 541 548 -
issm/trunk-jpl/src/c/cores/hydrology_core.cpp
r21208 r21463 89 89 if(save_results){ 90 90 if(VerboseSolution()) _printf0_(" saving results \n"); 91 int outputs[ 3] = {HydrologyHeadEnum,HydrologyGapHeightEnum,EffectivePressureEnum};92 femmodel->RequestedOutputsx(&femmodel->results,&outputs[0], 3);91 int outputs[4] = {HydrologyHeadEnum,HydrologyGapHeightEnum,EffectivePressureEnum,HydrologyBasalFluxEnum}; 92 femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],4); 93 93 94 94 /*unload results*/ -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r21389 r21463 174 174 HydrologyReynoldsEnum, 175 175 HydrologyNeumannfluxEnum, 176 HydrologyRelaxationEnum, 177 HydrologyBasalFluxEnum, 176 178 InversionControlParametersEnum, 177 179 InversionControlScalingFactorsEnum, -
issm/trunk-jpl/src/m/classes/hydrologysommers.m
r21049 r21463 15 15 spchead = NaN; 16 16 neumannflux = NaN; 17 relaxation = 0; 17 18 end 18 19 methods … … 30 31 end % }}} 31 32 function self = setdefaultparameters(self) % {{{ 33 % Set under-relaxation parameter to be 1 (no under-relaxation of nonlinear iteration) 34 self.relaxation=1; 32 35 end % }}} 33 36 function md = checkconsistency(self,md,solution,analyses) % {{{ … … 46 49 md = checkfield(md,'fieldname','hydrology.reynolds','>',0,'size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1); 47 50 md = checkfield(md,'fieldname','hydrology.neumannflux','timeseries',1,'NaN',1,'Inf',1); 48 md = checkfield(md,'fieldname','hydrology.spchead','size',[md.mesh.numberofvertices 1]); 51 md = checkfield(md,'fieldname','hydrology.spchead','size',[md.mesh.numberofvertices 1]); 52 md = checkfield(md,'fieldname','hydrology.relaxation','>=',0); 49 53 end % }}} 50 54 function disp(self) % {{{ … … 59 63 fielddisplay(self,'neumannflux','water flux applied along the model boundary (m^2/s)'); 60 64 fielddisplay(self,'spchead','water head constraints (NaN means no constraint) (m)'); 65 fielddisplay(self,'relaxation','under-relaxation coefficient for nonlinear iteration'); 61 66 end % }}} 62 67 function marshall(self,prefix,md,fid) % {{{ … … 74 79 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','neumannflux','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); 75 80 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','spchead','format','DoubleMat','mattype',1); 81 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','relaxation','format','Double'); 76 82 end % }}} 77 83 end
Note:
See TracChangeset
for help on using the changeset viewer.