Changeset 15893
- Timestamp:
- 08/23/13 07:26:55 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp ¶
r15877 r15893 5236 5236 /* Intermediaries */ 5237 5237 bool isenthalpy; 5238 int i,j, analysis_type,numindices,numindicesup;5238 int i,j,ig,analysis_type,numindices,numindicesup; 5239 5239 IssmDouble xyz_list[NUMVERTICES][3]; 5240 5240 IssmDouble xyz_list_tria[NUMVERTICES2D][3]; … … 5283 5283 _assert_(numindices==numindicesup); 5284 5284 5285 /*Ok, we have vx and vy in values, fill in vx and vy arrays:*/5285 /*Ok, get meltrates now from basal conditions*/ 5286 5286 GaussPenta* gauss=new GaussPenta(); 5287 5287 GaussPenta* gaussup=new GaussPenta(); 5288 for(i =0;i<numindices;i++){5289 gauss->GaussNode(this->element_type,indices[i ]);5290 gaussup->GaussNode(this->element_type,indicesup[i ]);5288 for(ig=0;ig<numindices;ig++){ 5289 gauss->GaussNode(this->element_type,indices[ig]); 5290 gaussup->GaussNode(this->element_type,indicesup[ig]); 5291 5291 5292 5292 watercolumn_input->GetInputValue(&watercolumn, gauss); … … 5308 5308 pressure_input->GetInputValue(&pressureup, gaussup); 5309 5309 if(enthalpyup>=matpar->PureIceEnthalpy(pressureup)){ 5310 5310 for(i=0;i<3;i++) vec_heatflux[i]=0.; 5311 5311 } 5312 5312 else{ … … 5346 5346 delete gauss; 5347 5347 delete gaussup; 5348 } 5349 /*}}}*/ 5350 /*FUNCTION Penta::DrainWaterfraction{{{*/ 5351 void Penta::DrainWaterfraction(void){ 5352 5353 // TODO: create vector to mark whether node has been drained already i.o. to not drain nodes multiple times 5354 5355 /*Intermediaries*/ 5356 const int numdof=NDOF1*NUMVERTICES; 5357 int ig; 5358 bool isenthalpy; 5359 IssmDouble waterfraction, temperature; 5360 IssmDouble enthalpy, pressure; 5361 IssmDouble latentheat, dt; 5362 5363 Input* watercolumn_input=inputs->GetInput(WatercolumnEnum); _assert_(watercolumn_input); 5364 Input* enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(enthalpy_input); 5365 Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input); 5366 5367 /*Check wether enthalpy is activated*/ 5368 parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum); 5369 if(!isenthalpy) return; 5370 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 5371 5372 GaussPenta* gauss=new GaussPenta(2,3); 5373 for(ig=gauss->begin();ig<gauss->end();ig++){ 5374 gauss->GaussPoint(ig); 5375 5376 enthalpy_input->GetInputValue(&enthalpy, gauss); 5377 pressure_input->GetInputValue(&pressure, gauss); 5378 matpar->EnthalpyToThermal(&temperature, &waterfraction, enthalpy,pressure); 5379 5380 /*drain water fraction*/ 5381 waterfraction-=dt*DrainageFunctionWaterfraction(waterfraction); 5382 if(waterfraction<0) waterfraction=0.; 5383 /*update enthalpy*/ 5384 latentheat=matpar->GetLatentHeat(); 5385 matpar->ThermalToEnthalpy(&enthalpy, temperature, waterfraction, pressure); 5386 //TODO feed result back into model 5387 } 5348 5388 } 5349 5389 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.