Changeset 16416
- Timestamp:
- 10/15/13 15:34:56 (11 years ago)
- Location:
- issm/trunk-jpl/src/m/mech
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/mech/analyticaldamage.m
r16065 r16416 13 13 % 'Thomas' for a 2D ice shelf, taking into account full strain rate tensor (default) 14 14 % - 'smoothing' : the amount of smoothing to be applied to the strain rate data. 15 % Type 'help averaging' for more information on its usage. 16 % - 'sigmab' : a compressive backstress term to be subtracted from the driving stress 17 % in the damage calculation 15 % Type 'help averaging' for more information on its 16 % usage. Defaults to 0. 17 % - 'sigmab' : a-priori backstress in opposition to the driving stress. 18 % Defaults to 0 everywhere. 19 20 % - 'coordsys' : coordinate system for calculating the strain rate 21 % components. Must be one of: 22 % 'longitudinal': x axis aligned along a flowline at every point (default) 23 % 'principal': x axis aligned along maximum principal strain rate 24 % at every point 25 % 'xy': x and y axes same as in polar stereographic projection 18 26 % 19 27 % Return values: 20 28 % 'damage' which is truncated in the range [0,1-1e-9] 21 29 % 22 % 'B' is the rigidity, which is equal to md.materials.rheology_B in areas outside 23 % those defined by 'mask.' Within areas defined by 'mask,' where negative damage 24 % is inferred, 'B' is updated to make damage equal to zero. 30 % 'B' is the ice rigidity calculated assuming D=0 everywhere. 25 31 % 26 % 'backstress' is the inferred backstress necessary to balance the analytical solution 27 % (keeping damage within its appropriate limits, e.g. D in [0,1]). 32 % 'backstress' is the inferred backstress necessary to balance the 33 % analytical solution (keeping damage within its appropriate limits, e.g. D 34 % in [0,1]). 28 35 % 29 36 % Usage: … … 31 38 % 32 39 % Example: 33 % [damage,B,backstress]=analyticaldamage(md,'eq','Weertman2D','smoothing',2,' backstress',10e3);40 % [damage,B,backstress]=analyticaldamage(md,'eq','Weertman2D','smoothing',2,'sigmab',10e3,'coordsys','longitudinal'); 34 41 35 42 % check inputs … … 53 60 smoothing = getfieldvalue(options,'smoothing',0); 54 61 sigmab = getfieldvalue(options,'sigmab',0); 62 coordsys = getfieldvalue(options,'coordsys','longitudinal'); 55 63 if length(sigmab)==1, 56 64 sigmab=sigmab*ones(md.mesh.numberofelements,1); 57 65 end 58 66 59 % average element strain rates onto vertices 60 e1=averaging(md,md.results.strainrate.principalvalue1,smoothing)/md.constants.yts; % convert to s^-1 61 e2=averaging(md,md.results.strainrate.principalvalue2,smoothing)/md.constants.yts; 62 exx=averaging(md,md.results.strainrate.xx,smoothing)/md.constants.yts; 63 eyy=averaging(md,md.results.strainrate.yy,smoothing)/md.constants.yts; 64 exy=averaging(md,md.results.strainrate.xy,smoothing)/md.constants.yts; 65 66 % checks: any of e1 or e2 equal to zero? 67 pos=find(e1==0); 68 if any(pos==1) 69 disp('WARNING: first principal strain rate equal to zero. Value set to 1e-13 s^-1'); 70 e1(pos)=1e-13; 71 end 72 pos=find(e2==0); 73 if any(pos==1) 74 disp('WARNING: second principal strain rate equal to zero. Value set to 1e-13 s^-1'); 75 e2(pos)=1e-13; 76 end 77 78 %% old method using principal strain rates {{{ 79 %% ex=maximum principal tensile strain rate 80 %ex=e1; 81 %a=e2./e1; 82 %pos=find(e1<0 & e2>0); % longitudinal compression and lateral tension 83 %a(pos)=e1(pos)./e2(pos); 84 %ex(pos)=e2(pos); 85 %pos2=find(e1<0 & e2<0 & abs(e1)<abs(e2)); % lateral and longitudinal compression 86 %a(pos2)=e1(pos2)./e2(pos2); 87 %ex(pos2)=e2(pos2); 88 %pos3=find(e1>0 & e2>0 & abs(e1)<abs(e2)); % lateral and longitudinal tension 89 %a(pos3)=e1(pos3)./e2(pos3); 90 %ex(pos3)=e2(pos3); 91 %id=find(e1<0 & e2<0); 92 %a(id)=-a(id); % where both strain rates are compressive, enforce negative alpha 93 % 94 %% }}} 95 96 % new method using longitudinal strain rates defined by observed velocity vector 97 velangle=atan(md.initialization.vy./md.initialization.vx); 98 ex=0.5*(exx+eyy)+0.5*(exx-eyy).*cos(2*velangle)+exy.*sin(2*velangle); 99 ey=exx+eyy-ex; % trace of strain rate tensor is invariant 100 exy=-0.5*(exx-eyy).*sin(2*velangle)+exy.*cos(2*velangle); 101 a=ey./ex; 102 b=exy./ex; 103 pos=find(ex<0 & ey<0); 104 %length(pos) 105 a(pos)=-a(pos); 106 107 % a < -1 in areas of strong lateral compression or longitudinal compression 108 % and theta is undefined at a = -2 109 pos=find(abs((abs(a)-2))<1e-3); 110 a(pos)=-2+1e-3; 67 [a,b,theta,ex]=thomasparams(md,'eq',eq,'smoothing',smoothing,'coordsys',coordsys); 111 68 112 69 % spreading stress … … 120 77 n=averaging(md,md.materials.rheology_n,0); 121 78 122 switch eq123 case 'Weertman1D'124 theta=1./8*ones(md.mesh.numberofvertices,1);125 a=zeros(md.mesh.numberofvertices,1);126 case 'Weertman2D'127 theta=1./9*ones(md.mesh.numberofvertices,1);128 a=ones(md.mesh.numberofvertices,1);129 case 'Thomas'130 theta=((1+a+a.^2+b.^2).^((n-1)/2))./(abs(2+a).^n);131 otherwise132 error('argument passed to "eq" not valid. Type "help analyticaldamage" for usage');133 end134 135 79 D=1-(1+a+a.^2+b.^2).^((n-1)./(2*n))./abs(ex).^(1./n).*(T-sigmab)./B./(2+a)./sign(ex); 136 137 backstress=zeros(md.mesh.numberofvertices,1);138 80 139 81 % D>1 where (2+a).*sign(ex)<0, compressive regions where high backstress needed … … 141 83 D(pos)=0; 142 84 143 % backstress to bring damage to zero 85 backstress=zeros(md.mesh.numberofvertices,1); 86 87 % backstress to bring D down to one 144 88 backstress(pos)=T(pos)-(1-D(pos)).*B(pos).*sign(ex(pos)).*(2+a(pos)).*abs(ex(pos)).^(1./n(pos))./(1+a(pos)+a(pos).^2).^((n(pos)-1)/2./n(pos)); 145 89 … … 154 98 backstress(pos)=0; 155 99 156 % increased rigidity to bring negative damage to zero 157 B(pos)=sign(ex(pos))./(2+a(pos)).*(1+a(pos)+a(pos).^2).^((n(pos)-1)/2./n(pos)).*T(pos)./abs(ex(pos)).^(1./n(pos)); 100 % rigidity from Thomas relation for D=0 and backstress=0 101 B=sign(ex)./(2+a).*(1+a+a.^2).^((n-1)/2./n).*T./(abs(ex).^(1./n)); 102 pos=find(B<0); 103 B(pos)=md.materials.rheology_B(pos); 158 104 159 105 damage=D;
Note:
See TracChangeset
for help on using the changeset viewer.