Changeset 20272


Ignore:
Timestamp:
02/29/16 10:47:12 (9 years ago)
Author:
jbondzio
Message:

BUG: CreatePVectorSheet uses enthalpy values interpolated at gauss-points, which may lead to inconsistency between applied basal boundary conditions. Keep applying basal heat flux at temperate base, since heated base becomes spc'd anyway.

File:
1 edited

Legend:

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

    r20213 r20272  
    821821        if(!element->IsOnBase() || element->IsFloating()) return NULL;
    822822
    823         bool isdynamicbasalspc;
     823        bool converged, isdynamicbasalspc;
    824824        int i, state;
     825        int enthalpy_enum;
    825826        IssmDouble  dt,Jdet,scalar;
    826827        IssmDouble      enthalpy, enthalpyup, pressure, pressureup, watercolumn, meltingrate;
     
    840841        element->FindParam(&dt,TimesteppingTimeStepEnum);
    841842        element->FindParam(&isdynamicbasalspc,ThermalIsdynamicbasalspcEnum);
     843        element->GetInputValue(&converged,ConvergedEnum);
     844        if(dt==0. && !converged) enthalpy_enum=EnthalpyPicardEnum; // use enthalpy from last iteration
     845        else enthalpy_enum=EnthalpyEnum; // use enthalpy from last time step
    842846        Input* vx_input             = element->GetInput(VxEnum);                          _assert_(vx_input);
    843847        Input* vy_input             = element->GetInput(VyEnum);                          _assert_(vy_input);
    844848        Input* vz_input             = element->GetInput(VzEnum);                          _assert_(vz_input);
    845         Input* enthalpy_input            = element->GetInput(EnthalpyPicardEnum);                                        _assert_(enthalpy_input);
     849        Input* enthalpy_input            = element->GetInput(enthalpy_enum);                                     _assert_(enthalpy_input);
    846850        Input* pressure_input            = element->GetInput(PressureEnum);                                                      _assert_(pressure_input);
    847851        Input* watercolumn_input         = element->GetInput(WatercolumnEnum);                                                   _assert_(watercolumn_input);
     
    876880
    877881                switch (state) {
    878                         case 0:
    879                                 // cold, dry base: apply basal surface forcing
     882                        case 0: case 1: case 2: case 3:
     883                                // cold, dry base; cold, wet base; refreezing temperate base; thin temperate base:
     884                                // Apply basal surface forcing.
     885                                // Interpolated values of enthalpy on gauss nodes may indicate cold base,
     886                                // although one node might have become temperate. So keep heat flux switched on.
    880887                                geothermalflux_input->GetInputValue(&geothermalflux,gauss);
    881888                                friction->GetAlpha2(&alpha2,gauss);
     
    890897                                        pe->values[i]+=scalar*basis[i];
    891898                                break;
    892                         case 1:
    893                                 // cold, wet base: keep at pressure melting point
    894                                 break;
    895                         case 2:
    896                                 // temperate, thin refreezing base: release spc
    897                                 break;
    898                         case 3:
    899                                 // temperate, thin melting base: set spc
    900                                 break;
    901899                        case 4:
    902900                                // temperate, thick melting base: set grad H*n=0
Note: See TracChangeset for help on using the changeset viewer.