Changeset 18620


Ignore:
Timestamp:
10/13/14 08:55:00 (10 years ago)
Author:
jbondzio
Message:

CHG: dynamic basal constraints for enthalpy steadystate

Location:
issm/trunk-jpl
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp

    r18612 r18620  
    11851185                UpdateBasalConstraints(element);
    11861186        }
     1187        femmodel->UpdateConstraintsx();
    11871188}/*}}}*/
    11881189void EnthalpyAnalysis::UpdateBasalConstraints(Element* element){/*{{{*/
     
    13941395        element->FindParam(&dt,TimesteppingTimeStepEnum);
    13951396
    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
    14191407        }
    14201408
  • issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.h

    r18612 r18620  
    5151                static void UpdateBasalConstraintsTransient(Element* element);
    5252                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);
    5553                static int GetThermalBasalCondition(Element* element, IssmDouble enthalpy, IssmDouble enthalpy_up, IssmDouble pressure, IssmDouble pressure_up, IssmDouble watercolumn, IssmDouble meltingrate);
    5654                static IssmDouble GetWetIceConductivity(Element* element, IssmDouble enthalpy, IssmDouble pressure);
  • issm/trunk-jpl/src/c/solutionsequences/solutionsequence_thermal_nonlinear.cpp

    r18619 r18620  
    5050                femmodel->UpdateConstraintsx();
    5151
    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)
    5353                GetSolutionFromInputsx(&tg,femmodel);
    5454                Reducevectorgtofx(&tf, tg, femmodel->nodes,femmodel->parameters);
     
    6565        for(;;){
    6666                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);
    6774                delete tg;
    68 
    69                 if(isenthalpy) SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
    70                 else SystemMatricesx(&Kff, &Kfs, &pf,&df, &melting_offset,femmodel);
    7175                CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
    7276                Reduceloadx(pf, Kfs, ys); delete Kfs;
     
    8286                if(VerboseConvergence()) _printf0_("   number of unstable constraints: " << num_unstable_constraints << "\n");
    8387
    84                 if(isenthalpy){
    85                         /*Increase count: */
     88                if(isenthalpy){ // enthalpy method
     89                        IssmDouble dt;
     90                        femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
     91
    8692                        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                        }
    87101                        if(converged==true){
    88                                 bool max_iteration_state=false;
    89102                                int step; IssmDouble time;
    90103                                femmodel->parameters->FindParam(&time,TimeEnum);
     
    93106                                break;
    94107                        }
    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);
    106111                        }
    107112                }
    108                 else{
     113                else{ // dry ice method
    109114                        if(!converged){
    110115                                if(num_unstable_constraints<=thermal_penalty_threshold) converged=true;
  • issm/trunk-jpl/src/m/classes/thermal.m

    r18554 r18620  
    100100                                if(md.thermal.isenthalpy)
    101101                                        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 
    104104                                        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']);
    106105                                end
    107106            end
  • issm/trunk-jpl/src/m/classes/thermal.py

    r18554 r18620  
    9595                        if(md.thermal.isenthalpy):
    9696                                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!")
    9898                                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")
    10099                md = checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1)
    101100
Note: See TracChangeset for help on using the changeset viewer.