Changeset 23812


Ignore:
Timestamp:
03/29/19 14:18:15 (6 years ago)
Author:
schlegel
Message:

CHG: add enthalpy to match the matlab version, for transient restart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/initialization.py

    r21406 r23812  
    2020                self.vz            = float('NaN')
    2121                self.vel           = float('NaN')
     22                self.enthalpy      = float('NaN')
    2223                self.pressure      = float('NaN')
    2324                self.temperature   = float('NaN')
     
    4041                string="%s\n%s"%(string,fielddisplay(self,'pressure','pressure [Pa]'))
    4142                string="%s\n%s"%(string,fielddisplay(self,'temperature','temperature [K]'))
     43                string="%s\n%s"%(string,fielddisplay(self,'enthalpy','enthalpy [J]'))
    4244                string="%s\n%s"%(string,fielddisplay(self,'waterfraction','fraction of water in the ice'))
    4345                string="%s\n%s"%(string,fielddisplay(self,'watercolumn','thickness of subglacial water [m]'))
     
    5456                self.vel=project3d(md,'vector',self.vel,'type','node')
    5557                self.temperature=project3d(md,'vector',self.temperature,'type','node')
     58                self.enthalpy=project3d(md,'vector',self.enthalpy,'type','node')
    5659                self.waterfraction=project3d(md,'vector',self.waterfraction,'type','node')
    5760                self.watercolumn=project3d(md,'vector',self.watercolumn,'type','node')
     
    133136               
    134137                if md.thermal.isenthalpy:
     138                    if (np.size(self.enthalpy)<=1):
    135139                        tpmp = md.materials.meltingpoint - md.materials.beta*md.initialization.pressure;
    136140                        pos  = np.nonzero(md.initialization.waterfraction > 0.)[0]
    137                         enthalpy      = md.materials.heatcapacity*(md.initialization.temperature-md.constants.referencetemperature);
    138                         enthalpy[pos] = md.materials.heatcapacity*(tpmp[pos].reshape(-1,) - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[pos].reshape(-1,)
    139                         WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
     141                        self.enthalpy      = md.materials.heatcapacity*(md.initialization.temperature-md.constants.referencetemperature);
     142                        self.enthalpy[pos] = md.materials.heatcapacity*(tpmp[pos].reshape(-1,) - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[pos].reshape(-1,)
     143
     144                    WriteData(fid,prefix,'data',self.enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
    140145
    141146        # }}}
Note: See TracChangeset for help on using the changeset viewer.