Changeset 17367


Ignore:
Timestamp:
02/28/14 12:03:48 (11 years ago)
Author:
cborstad
Message:

CHG: added a model field to choose the type of scalar equivalent stress for a damage evolution solution

Location:
issm/trunk-jpl/src
Files:
1 added
12 edited

Legend:

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

    r17275 r17367  
    3131                parameters->AddObject(iomodel->CopyConstantObject(DamageStressThresholdEnum));
    3232                parameters->AddObject(iomodel->CopyConstantObject(DamageHealingEnum));
     33                parameters->AddObject(iomodel->CopyConstantObject(DamageEquivStressEnum));
    3334        }
    3435        xDelete<char>(law);
     
    395396        IssmDouble c1,c2,c3,healing,stress_threshold;
    396397        IssmDouble s_xx,s_xy,s_yy;
    397         IssmDouble J2s,Xis,Psi,PosPsi,NegPsi;
     398        IssmDouble J2s,Chi,Psi,PosPsi,NegPsi;
    398399        IssmDouble damage,sigma_xx,sigma_xy,sigma_yy;
     400        int equivstress;
    399401
    400402        /*Fetch number of vertices and allocate output*/
     
    418420        Input* damage_input    = element->GetInput(DamageDbarEnum); _assert_(damage_input);
    419421
    420         /*Damage evolution z mapping: */
     422        /*retrieve the desired type of equivalent stress*/
     423        element->FindParam(&equivstress,DamageEquivStressEnum);
     424
     425        /*Calculate damage evolution source term: */
    421426        Gauss* gauss=element->NewGauss();
    422427        for (int iv=0;iv<numvertices;iv++){
     
    432437                s_yy=sigma_yy/(1.-damage);
    433438
    434                 J2s=1./sqrt(2.)*sqrt(s_xx*s_xx + s_yy*s_yy + s_xy*s_xy);
    435                 Xis=sqrt(3.0)*J2s;
    436                 Psi=Xis-stress_threshold;
     439                if(equivstress==1){ /* von Mises */
     440                        J2s=1./sqrt(2.)*sqrt(s_xx*s_xx + s_yy*s_yy + s_xy*s_xy);
     441                        Chi=sqrt(3.0)*J2s;
     442                }
     443                Psi=Chi-stress_threshold;
    437444                PosPsi=max(Psi,0.);
    438445                NegPsi=max(-Psi,0.);
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r17364 r17367  
    179179        DamageSpcdamageEnum,
    180180        DamageMaxDamageEnum,
     181        DamageEquivStressEnum,
    181182        MaterialsRhoIceEnum,
    182183        MaterialsRhoWaterEnum,
     
    671672        OptionStructEnum,
    672673        /*}}}*/
    673         /*Rheology law (move too Material) {{{*/
     674        /*Rheology law (move to Material) {{{*/
    674675        PatersonEnum,
    675676        ArrheniusEnum,
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r17364 r17367  
    187187                case DamageSpcdamageEnum : return "DamageSpcdamage";
    188188                case DamageMaxDamageEnum : return "DamageMaxDamage";
     189                case DamageEquivStressEnum : return "DamageEquivStress";
    189190                case MaterialsRhoIceEnum : return "MaterialsRhoIce";
    190191                case MaterialsRhoWaterEnum : return "MaterialsRhoWater";
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r17364 r17367  
    190190              else if (strcmp(name,"DamageSpcdamage")==0) return DamageSpcdamageEnum;
    191191              else if (strcmp(name,"DamageMaxDamage")==0) return DamageMaxDamageEnum;
     192              else if (strcmp(name,"DamageEquivStress")==0) return DamageEquivStressEnum;
    192193              else if (strcmp(name,"MaterialsRhoIce")==0) return MaterialsRhoIceEnum;
    193194              else if (strcmp(name,"MaterialsRhoWater")==0) return MaterialsRhoWaterEnum;
     
    259260              else if (strcmp(name,"SteadystateReltol")==0) return SteadystateReltolEnum;
    260261              else if (strcmp(name,"SteadystateRequestedOutputs")==0) return SteadystateRequestedOutputsEnum;
    261               else if (strcmp(name,"Surface")==0) return SurfaceEnum;
    262262         else stage=3;
    263263   }
    264264   if(stage==3){
    265               if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
     265              if (strcmp(name,"Surface")==0) return SurfaceEnum;
     266              else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
    266267              else if (strcmp(name,"ThermalIsdynamicbasalspc")==0) return ThermalIsdynamicbasalspcEnum;
    267268              else if (strcmp(name,"ThermalMaxiter")==0) return ThermalMaxiterEnum;
     
    382383              else if (strcmp(name,"Vertices")==0) return VerticesEnum;
    383384              else if (strcmp(name,"Results")==0) return ResultsEnum;
    384               else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
    385385         else stage=4;
    386386   }
    387387   if(stage==4){
    388               if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
     388              if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
     389              else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
    389390              else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
    390391              else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
     
    505506              else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
    506507              else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
    507               else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
    508508         else stage=5;
    509509   }
    510510   if(stage==5){
    511               if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
     511              if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
     512              else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
    512513              else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
    513514              else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
     
    628629              else if (strcmp(name,"Separate")==0) return SeparateEnum;
    629630              else if (strcmp(name,"Sset")==0) return SsetEnum;
    630               else if (strcmp(name,"Verbose")==0) return VerboseEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
     634              if (strcmp(name,"Verbose")==0) return VerboseEnum;
     635              else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
    635636              else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
    636637              else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
  • issm/trunk-jpl/src/m/classes/damage.m

    r16764 r17367  
    2626                c4                  = NaN;
    2727                healing             = NaN;
     28                equiv_stress              = NaN;
    2829        end
    2930        methods
     
    7677                        obj.c3=0;
    7778                        obj.c4=0;
     79                        obj.equiv_stress=0;
    7880
    7981                end % }}}
     
    98100                                md = checkfield(md,'fieldname','damage.c4','>=',0);
    99101                                md = checkfield(md,'fieldname','damage.stress_threshold','>=',0);
     102                                md = checkfield(md,'fieldname','damage.equiv_stress','numel',[1],'values',[0]);
    100103                        elseif strcmpi(obj.law,'undamaged'),
    101104                                if (solution==DamageEvolutionSolutionEnum),
     
    128131                                fielddisplay(obj,'healing','damage healing parameter 1');
    129132                                fielddisplay(obj,'stress_threshold','damage stress threshold [Pa]');
     133                                fielddisplay(obj,'equiv_stress','0: von Mises');
    130134                        end
    131135
     
    151155                                WriteData(fid,'object',obj,'fieldname','stress_threshold','format','Double');
    152156                                WriteData(fid,'object',obj,'fieldname','healing','format','Double');
     157                                WriteData(fid,'object',obj,'fieldname','equiv_stress','format','Integer');
    153158                        end
    154159
  • issm/trunk-jpl/src/m/classes/damage.py

    r16764 r17367  
    3535                self.c4                 = float('NaN')
    3636                self.healing                            = float('NaN')
     37                self.equiv_stress       = float('NaN')
    3738
    3839                if not len(args):
     
    6263                        s+="%s\n" % fielddisplay(self,"c4","damage parameter 4 ")
    6364                        s+="%s\n" % fielddisplay(self,"stress_threshold","damage stress threshold [Pa]")
     65                        s+="%s\n" % fielddisplay(self,"equiv_stresss","0: von Mises")
    6466
    6567                return s
     
    9597                self.c4=0
    9698                self.healing=0
     99                self.equiv_stress=0
    97100
    98101        # }}}
     
    104107                md = checkfield(md,'fieldname','damage.spcdamage','forcing',1)
    105108                       
    106                 md = checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0,1,2]);
     109                md = checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0,1,2])
    107110                md = checkfield(md,'fieldname','damage.maxiter','>=0',0);
    108111                md = checkfield(md,'fieldname','damage.penalty_factor','>=0',0);
     
    111114
    112115                if self.law == 'pralong':
    113                         md = checkfield(md,'fieldname','damage.healing','>=',0);
     116                        md = checkfield(md,'fieldname','damage.healing','>=',0)
    114117                        md = checkfield(md,'fieldname','damage.c1','>=',0)
    115118                        md = checkfield(md,'fieldname','damage.c2','>=',0)
     
    117120                        md = checkfield(md,'fieldname','damage.c4','>=',0)
    118121                        md = checkfield(md,'fieldname','damage.stress_threshold','>=',0)
     122                        md = checkfield(md,'fieldname','damage.equiv_stress','numel',[1],'values',[0])
    119123                elif strcmpi(self.law,'undamaged'):
    120124                        if (solution==DamageEvolutionSolutionEnum):
     
    142146                        WriteData(fid,'object',self,'fieldname','c4','format','Double')
    143147                        WriteData(fid,'object',self,'fieldname','stress_threshold','format','Double')
     148                        WriteData(fid,'object',self,'fieldname','equiv_stress','format','Integer')
    144149        # }}}
  • issm/trunk-jpl/src/m/classes/model.m

    r17079 r17367  
    11071107                        disp(sprintf('%19s: %-22s -- %s','basalforcings'   ,['[1x1 ' class(obj.basalforcings) ']'],'bed forcings'));
    11081108                        disp(sprintf('%19s: %-22s -- %s','materials'       ,['[1x1 ' class(obj.materials) ']'],'material properties'));
    1109                         disp(sprintf('%19s: %-22s -- %s','damage'          ,['[1x1 ' class(obj.damage) ']'],'damage propagation laws'));
     1109                        disp(sprintf('%19s: %-22s -- %s','damage'          ,['[1x1 ' class(obj.damage) ']'],'parameters for damage evolution solution'));
    11101110                        disp(sprintf('%19s: %-22s -- %s','friction'        ,['[1x1 ' class(obj.friction) ']'],'basal friction/drag properties'));
    11111111                        disp(sprintf('%19s: %-22s -- %s','flowequation'    ,['[1x1 ' class(obj.flowequation) ']'],'flow equations'));
  • issm/trunk-jpl/src/m/enum/EnumDefinitions.py

    r17364 r17367  
    179179def DamageSpcdamageEnum(): return StringToEnum("DamageSpcdamage")[0]
    180180def DamageMaxDamageEnum(): return StringToEnum("DamageMaxDamage")[0]
     181def DamageEquivStressEnum(): return StringToEnum("DamageEquivStress")[0]
    181182def MaterialsRhoIceEnum(): return StringToEnum("MaterialsRhoIce")[0]
    182183def MaterialsRhoWaterEnum(): return StringToEnum("MaterialsRhoWater")[0]
  • issm/trunk-jpl/src/m/mech/mechanicalproperties.m

    r15567 r17367  
    1515%some checks
    1616if length(vx)~=md.mesh.numberofvertices | length(vy)~=md.mesh.numberofvertices,
    17         error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!'])
     17        %error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!'])
    1818end
    1919if ~(md.mesh.dimension==2)
     
    139139deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(stress.xx.^2+stress.yy.^2+2*stress.xy.^2);
    140140md.results.deviatoricstress=deviatoricstress;
     141
     142viscosity=struct('nu',[]);
     143viscosity.nu=nu;
     144md.results.viscosity=viscosity;
  • issm/trunk-jpl/src/m/mech/steadystateiceshelftemp.m

    r15832 r17367  
    4646
    4747%calculate depth-averaged temperature (in Celsius)
    48 %temperature(pos)=-( (Tb(pos)-Ts(pos))*ki./wi(pos) + Hi(pos).*Tb(pos) - (Hi(pos).*Ts(pos) + (Tb(pos)-Ts(pos))*ki./wi(pos)).*exp(Hi(pos).*wi(pos)/ki) )./( Hi(pos).*(exp(Hi(pos).*wi(pos)/ki)-1));
    49 temperature(pos)=-( ((Tb(pos)-Ts(pos))*ki./wi(pos) + Hi(pos).*Tb(pos))./exp(Hi(pos).*wi(pos)/ki) - Hi(pos).*Ts(pos) + (Tb(pos)-Ts(pos))*ki./wi(pos))./( Hi(pos).*(1-exp(-Hi(pos).*wi(pos)/ki)));
     48temperature(pos)=-( (Tb(pos)-Ts(pos))*ki./wi(pos) + Hi(pos).*Tb(pos) - (Hi(pos).*Ts(pos) + (Tb(pos)-Ts(pos))*ki./wi(pos)).*exp(Hi(pos).*wi(pos)/ki) )./( Hi(pos).*(exp(Hi(pos).*wi(pos)/ki)-1));
     49%temperature(pos)=-( ((Tb(pos)-Ts(pos))*ki./wi(pos) + Hi(pos).*Tb(pos))./exp(Hi(pos).*wi(pos)/ki) - Hi(pos).*Ts(pos) + (Tb(pos)-Ts(pos))*ki./wi(pos))./( Hi(pos).*(1-exp(-Hi(pos).*wi(pos)/ki)));
    5050
    5151%temperature should not be less than surface temp
  • issm/trunk-jpl/src/m/mech/thomasparams.m

    r16416 r17367  
    1 function [alpha,beta,theta,ex]=thomasparams(md,varargin)
     1function [alpha,beta,theta,ex,sigxx]=thomasparams(md,varargin)
    22%THOMASPARAMS - compute Thomas' geometric parameters for an ice shelf
    33%
     
    3535%               the equivalent stress
    3636%
    37 %               'exx' is the longitudinal strain rate along a coordinate system defined
    38 %               by 'coordsys'
     37%               'exx' is the strain rate along a coordinate system defined by 'coordsys'
    3938%
    40 %   Usage: [alpha,beta,theta,exx]=ThomasParams(md,options)
     39%               'sigxx' is the deviatoric stress along a coordinate system defined by 'coordsys'
    4140%
    42 %   Example: [alpha,beta,theta,exx]=ThomasParams(md,'eq','Thomas','smoothing',2,'coordsys','longitudinal')
     41%   Usage: [alpha,beta,theta,exx,sigxx]=ThomasParams(md,options)
     42%
     43%   Example: [alpha,beta,theta,exx,sigxx]=ThomasParams(md,'eq','Thomas','smoothing',2,'coordsys','longitudinal')
    4344
    4445%some checks
     
    8283end
    8384
     85% rheology
     86n=averaging(md,md.materials.rheology_n,0);
     87B=md.materials.rheology_B;
     88
    8489switch coordsys
    8590        case 'principal'
     
    98103                id=find(e1<0 & e2<0);
    99104                a(id)=-a(id); % where both strain rates are compressive, enforce negative alpha
     105                sigxx=(abs(ex)./((1+a+a.^2).^((n-1)/2))).^(1./n).*B;
    100106                %mask=ismember(1:md.mesh.numberofvertices,id);
    101107                %plotmodel(md,'data',ex,'mask',mask)
     
    114120                a=ey./ex;
    115121                b=exy./ex;
    116                 pos=find(ex<0 & ey<0);
    117                 %length(pos)
    118                 a(pos)=-a(pos);
     122                %pos=find(ex<0 & ey<0);
     123                %a(pos)=-a(pos);
     124                %sigxx=(abs(ex)./((1+a+a.^2+b.^2).^((n-1)/2))).^(1./n).*B;
     125                sigxx=abs(ex).^(1./n-1).*ex./((1+a+a.^2+b.^2).^((n-1)./(2*n))).*B;
    119126        otherwise
    120127                error('argument passed to "coordsys" not valid');
     
    128135end
    129136a(pos)=-2+1e-3;
    130 
    131 % rheology
    132 n=averaging(md,md.materials.rheology_n,0);
    133137
    134138switch eq
  • issm/trunk-jpl/src/m/plot/colormaps/getcolormap.m

    r14513 r17367  
    4141elseif strcmpi(map,'Rignot'),
    4242        alpha=getfieldvalue(options,'alpha',1);
    43         map = hsv;
     43        map = hsv(128);
    4444        map = rgb2hsv(map);
    4545        map(:,2) = max(min( (0.1+map(:,1)).^(1/alpha) ,1),0);
Note: See TracChangeset for help on using the changeset viewer.