Changeset 18620
- Timestamp:
- 10/13/14 08:55:00 (10 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
r18612 r18620 1185 1185 UpdateBasalConstraints(element); 1186 1186 } 1187 femmodel->UpdateConstraintsx(); 1187 1188 }/*}}}*/ 1188 1189 void EnthalpyAnalysis::UpdateBasalConstraints(Element* element){/*{{{*/ … … 1394 1395 element->FindParam(&dt,TimesteppingTimeStepEnum); 1395 1396 1396 if(dt==0.){ // steadystate case 1397 state=0; //TODO: add consistent steadystate basal condition scheme 1398 // if(enthalpy<PureIceEnthalpy(element,pressure)){ /*is base cold?*/ 1399 // if(watercolumn<=0.) state=0; // cold, dry base 1400 // else state=1; // cold, wet base (refreezing) 1401 // } 1402 // else{ /*base is temperate, check if upper node is temperate, too.*/ 1403 // if(enthalpyup<PureIceEnthalpy(element,pressureup)) 1404 // if(meltingrate<0.) state=2; // refreezing temperate base (non-physical, only for steadystate solver) 1405 // else state=3; // melting temperate base with no temperate layer 1406 // else 1407 // state=4; // melting temperate base with temperate layer of positive thickness 1408 // } 1409 } 1410 else{ // transient case 1411 if(enthalpy<PureIceEnthalpy(element,pressure)){ 1412 if(watercolumn<=0.) state=0; // cold, dry base 1413 else state=1; // cold, wet base (refreezing) 1414 } 1415 else{ 1416 if(enthalpyup<PureIceEnthalpy(element,pressureup)) state=3; // temperate base, but no temperate layer 1417 else state=4; // temperate layer with positive thickness 1418 } 1397 if(enthalpy<PureIceEnthalpy(element,pressure)){ 1398 if(watercolumn<=0.) state=0; // cold, dry base 1399 else state=1; // cold, wet base (refreezing) 1400 } 1401 else{ 1402 if(enthalpyup<PureIceEnthalpy(element,pressureup)){ 1403 if((dt==0.) && (meltingrate<0.)) state=2; // refreezing temperate base (non-physical, only for steadystate solver) 1404 else state=3; // temperate base, but no temperate layer 1405 } 1406 else state=4; // temperate layer with positive thickness 1419 1407 } 1420 1408 -
issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.h
r18612 r18620 51 51 static void UpdateBasalConstraintsTransient(Element* element); 52 52 static void UpdateBasalConstraintsSteadystate(Element* element); 53 // static int GetThermalBasalCondition(Element* element, Gauss* gauss, Gauss* gaussup, int enthalpy_enum);54 // static int GetThermalBasalCondition(Element* element, GaussPenta* gauss, GaussPenta* gaussup, int enthalpy_enum);55 53 static int GetThermalBasalCondition(Element* element, IssmDouble enthalpy, IssmDouble enthalpy_up, IssmDouble pressure, IssmDouble pressure_up, IssmDouble watercolumn, IssmDouble meltingrate); 56 54 static IssmDouble GetWetIceConductivity(Element* element, IssmDouble enthalpy, IssmDouble pressure); -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_thermal_nonlinear.cpp
r18619 r18620 50 50 femmodel->UpdateConstraintsx(); 51 51 52 //Update the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)52 //Update the solution to make sure that tf and tf_old are similar (for next step in transient or steadystate) 53 53 GetSolutionFromInputsx(&tg,femmodel); 54 54 Reducevectorgtofx(&tf, tg, femmodel->nodes,femmodel->parameters); … … 65 65 for(;;){ 66 66 delete tf_old;tf_old=tf; 67 68 if(isenthalpy){ 69 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 70 /*Update old solution, such that sizes of tf_old and tf are comparable*/ 71 if(isdynamicbasalspc) Reducevectorgtofx(&tf_old, tg, femmodel->nodes,femmodel->parameters); 72 } 73 else SystemMatricesx(&Kff, &Kfs, &pf,&df, &melting_offset,femmodel); 67 74 delete tg; 68 69 if(isenthalpy) SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);70 else SystemMatricesx(&Kff, &Kfs, &pf,&df, &melting_offset,femmodel);71 75 CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type); 72 76 Reduceloadx(pf, Kfs, ys); delete Kfs; … … 82 86 if(VerboseConvergence()) _printf0_(" number of unstable constraints: " << num_unstable_constraints << "\n"); 83 87 84 if(isenthalpy){ 85 /*Increase count: */ 88 if(isenthalpy){ // enthalpy method 89 IssmDouble dt; 90 femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 91 86 92 count++; 93 bool max_iteration_state=false; 94 if(count>=thermal_maxiter){ 95 _printf0_(" maximum number of nonlinear iterations (" << thermal_maxiter << ") exceeded\n"); 96 converged=true; 97 InputUpdateFromConstantx(femmodel,converged,ConvergedEnum); 98 InputUpdateFromSolutionx(femmodel,tg); 99 max_iteration_state=true; 100 } 87 101 if(converged==true){ 88 bool max_iteration_state=false;89 102 int step; IssmDouble time; 90 103 femmodel->parameters->FindParam(&time,TimeEnum); … … 93 106 break; 94 107 } 95 if(count>=thermal_maxiter){ 96 _printf0_(" maximum number of nonlinear iterations (" << thermal_maxiter << ") exceeded\n"); 97 converged=true; 98 InputUpdateFromConstantx(femmodel,converged,ConvergedEnum); 99 InputUpdateFromSolutionx(femmodel,tg); 100 bool max_iteration_state=true; 101 int step; IssmDouble time; 102 femmodel->parameters->FindParam(&time,TimeEnum); 103 femmodel->parameters->FindParam(&step,StepEnum); 104 femmodel->results->AddObject(new GenericExternalResult<bool>(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, step, time)); 105 break; 108 else if(dt==0.){ 109 EnthalpyAnalysis::ComputeBasalMeltingrate(femmodel); 110 EnthalpyAnalysis::UpdateBasalConstraints(femmodel); 106 111 } 107 112 } 108 else{ 113 else{ // dry ice method 109 114 if(!converged){ 110 115 if(num_unstable_constraints<=thermal_penalty_threshold) converged=true; -
issm/trunk-jpl/src/m/classes/thermal.m
r18554 r18620 100 100 if(md.thermal.isenthalpy) 101 101 if isnan(md.stressbalance.reltol), 102 md = checkmessage(md,['for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!']);103 end 102 md = checkmessage(md,['for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!']); 103 end 104 104 md = checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero'); 105 md = checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel', [1],'values',[1], 'message',['for enthalpy run thermal.isdynamicbasalspc should be 1']);106 105 end 107 106 end -
issm/trunk-jpl/src/m/classes/thermal.py
r18554 r18620 95 95 if(md.thermal.isenthalpy): 96 96 if numpy.isnan(md.stressbalance.reltol): 97 md.checkmessage("for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!")97 md.checkmessage("for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!") 98 98 md = checkfield(md,'fieldname','thermal.reltol','>',0.,'message',"reltol must be larger than zero"); 99 md = checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel', [1],'values',[1], 'message',"for enthalpy run thermal.isdynamicbasalspc should be true")100 99 md = checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1) 101 100
Note:
See TracChangeset
for help on using the changeset viewer.