Changeset 23961
- Timestamp:
- 05/30/19 09:54:32 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
r23960 r23961 169 169 /*Intermediaries */ 170 170 IssmDouble Jdet,dphi[3],h,k; 171 IssmDouble A,B,n,phi_old,phi,phi_0,H,b,v1; 171 172 IssmDouble* xyz_list = NULL; 172 173 … … 189 190 IssmDouble dt = element->FindParam(TimesteppingTimeStepEnum); 190 191 IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum); 192 IssmDouble rho_ice = element->FindParam(MaterialsRhoIceEnum); 191 193 IssmDouble g = element->FindParam(ConstantsGEnum); 192 194 IssmDouble e_v = element->FindParam(HydrologyEnglacialVoidRatioEnum); … … 194 196 Input* phi_input = element->GetInput(HydraulicPotentialEnum); _assert_(phi_input); 195 197 Input* h_input = element->GetInput(HydrologySheetThicknessEnum); _assert_(h_input); 198 Input* H_input = element->GetInput(ThicknessEnum); _assert_(H_input); 199 Input* b_input = element->GetInput(BedEnum); _assert_(b_input); 200 Input* B_input = element->GetInput(MaterialsRheologyBEnum); _assert_(B_input); 201 Input* n_input = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 196 202 197 203 /* Start looping on the number of gaussian points: */ … … 205 211 206 212 phi_input->GetInputDerivativeValue(&dphi[0],xyz_list,gauss); 213 phi_input->GetInputValue(&phi,gauss); 207 214 h_input->GetInputValue(&h,gauss); 208 215 k_input->GetInputValue(&k,gauss); 216 B_input->GetInputValue(&B,gauss); 217 n_input->GetInputValue(&n,gauss); 218 b_input->GetInputValue(&b,gauss); 219 H_input->GetInputValue(&H,gauss); 209 220 210 221 /*Get norm of gradient of hydraulic potential and make sure it is >0*/ … … 220 231 coeff*dbasis[0*numnodes+i]*dbasis[0*numnodes+j] 221 232 + coeff*dbasis[1*numnodes+i]*dbasis[1*numnodes+j]); 233 } 234 } 235 236 /*Closing rate term, see Gagliardini and Werder 2018 eq. A2 (v = v1*phi_i + v2(phi_{i+1}))*/ 237 phi_0 = rho_water*g*b + rho_ice*g*H; 238 A=pow(B,-n); 239 v1 = 2./pow(n,n)*A*h*(pow(fabs(phi_0 - phi),n-1.)*( - n)); 240 for(int i=0;i<numnodes;i++){ 241 for(int j=0;j<numnodes;j++){ 242 Ke->values[i*numnodes+j] += gauss->weight*Jdet*(-v1)*basis[i]*basis[j]; 222 243 } 223 244 } … … 248 269 249 270 /*Intermediaries */ 250 IssmDouble Jdet,w,v ,vx,vy,ub,h,N,h_r;271 IssmDouble Jdet,w,v2,vx,vy,ub,h,h_r; 251 272 IssmDouble G,m,frictionheat,alpha2; 252 IssmDouble A,B,n,phi_old; 273 IssmDouble A,B,n,phi_old,phi,phi_0; 274 IssmDouble H,b; 253 275 IssmDouble* xyz_list = NULL; 254 276 … … 272 294 Input* vx_input = element->GetInput(VxEnum);_assert_(vx_input); 273 295 Input* vy_input = element->GetInput(VyEnum);_assert_(vy_input); 274 Input* N_input = element->GetInput(EffectivePressureEnum); _assert_(N_input);275 296 Input* h_input = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input); 297 Input* H_input = element->GetInput(ThicknessEnum); _assert_(H_input); 298 Input* b_input = element->GetInput(BedEnum); _assert_(b_input); 276 299 Input* G_input = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(G_input); 277 300 Input* B_input = element->GetInput(MaterialsRheologyBEnum); _assert_(B_input); 278 301 Input* n_input = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 279 302 Input* phiold_input = element->GetInput(HydraulicPotentialOldEnum); _assert_(phiold_input); 303 Input* phi_input = element->GetInput(HydraulicPotentialEnum); _assert_(phi_input); 280 304 281 305 /*Build friction element, needed later: */ … … 297 321 B_input->GetInputValue(&B,gauss); 298 322 n_input->GetInputValue(&n,gauss); 299 N_input->GetInputValue(&N,gauss);300 323 hr_input->GetInputValue(&h_r,gauss); 324 phi_input->GetInputValue(&phi,gauss); 325 b_input->GetInputValue(&b,gauss); 326 H_input->GetInputValue(&H,gauss); 301 327 302 328 /*Get basal velocity*/ … … 315 341 316 342 /*Compute closing rate*/ 343 /*See Gagliardini and Werder 2018 eq. A2 (v = v2(phi_i) + v1*phi_{i+1})*/ 344 phi_0 = rho_water*g*b + rho_ice*g*H; 317 345 A=pow(B,-n); 318 v = 2./pow(n,n)*A*h*pow(fabs(N),n-1.)*N;319 320 for(int i=0;i<numnodes;i++) pe->values[i]+= - Jdet*gauss->weight*(w-v -m)*basis[i];346 v2 = 2./pow(n,n)*A*h*(pow(fabs(phi_0 - phi),n-1.)*(phi_0 +(n-1.)*phi)); 347 348 for(int i=0;i<numnodes;i++) pe->values[i]+= - Jdet*gauss->weight*(w-v2-m)*basis[i]; 321 349 322 350 /*Transient term if dt>0*/ … … 413 441 /*Get new sheet thickness*/ 414 442 h_new[iv] = h_old + dt*(w-v); 443 if(h_new[iv]<1.e-12) h_new[iv] = 1.e-12; 415 444 } 416 445
Note:
See TracChangeset
for help on using the changeset viewer.