Changeset 23951
- Timestamp:
- 05/29/19 15:56:20 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
r23950 r23951 112 112 parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.englacial_void_ratio",HydrologyEnglacialVoidRatioEnum)); 113 113 114 /*Deal with friction parameters*/ 115 int frictionlaw; 116 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 117 if(frictionlaw==4 || frictionlaw==6){ 118 parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum)); 119 } 120 if(frictionlaw==3 || frictionlaw==1 || frictionlaw==7){ 121 parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum)); 122 } 123 if(frictionlaw==9){ 124 parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum)); 125 parameters->AddObject(new IntParam(FrictionCouplingEnum,0)); 126 } 127 114 128 /*Requested outputs*/ 115 129 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.hydrology.requested_outputs"); … … 153 167 /*Get all inputs and parameters*/ 154 168 IssmDouble dt = element->FindParam(TimesteppingTimeStepEnum); 155 IssmDouble c_t = element->FindParam(HydrologyPressureMeltCoefficientEnum);156 169 IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum); 157 170 IssmDouble g = element->FindParam(ConstantsGEnum); 171 IssmDouble e_v = element->FindParam(HydrologyEnglacialVoidRatioEnum); 158 172 Input* k_input = element->GetInput(HydrologySheetConductivityEnum);_assert_(k_input); 159 173 Input* phi_input = element->GetInput(HydraulicPotentialEnum); _assert_(phi_input); … … 179 193 IssmDouble coeff = k*pow(h,alpha)*pow(normgradphi,beta-2.); 180 194 195 /*Diffusive term*/ 181 196 for(int i=0;i<numnodes;i++){ 182 197 for(int j=0;j<numnodes;j++){ 183 184 /*Diffusive term*/185 198 Ke->values[i*numnodes+j] += gauss->weight*Jdet*( 186 199 coeff*dbasis[0*numnodes+i]*dbasis[0*numnodes+j] … … 189 202 } 190 203 191 /*Transient term if dt */204 /*Transient term if dt>0*/ 192 205 if(dt>0.){ 206 /*Diffusive term*/ 207 for(int i=0;i<numnodes;i++){ 208 for(int j=0;j<numnodes;j++){ 209 Ke->values[i*numnodes+j] += gauss->weight*Jdet*e_v/(rho_water*g*dt)*basis[i]*basis[j]; 210 } 211 } 193 212 } 213 194 214 } 195 215 … … 209 229 IssmDouble Jdet,w,v,vx,vy,ub,h,N,h_r; 210 230 IssmDouble G,m,frictionheat,alpha2; 211 IssmDouble A,B,n ;231 IssmDouble A,B,n,phi_old; 212 232 IssmDouble* xyz_list = NULL; 213 233 … … 221 241 /*Retrieve all inputs and parameters*/ 222 242 element->GetVerticesCoordinates(&xyz_list); 223 IssmDouble L = element->FindParam(MaterialsLatentheatEnum); 224 IssmDouble rho_ice = element->FindParam(MaterialsRhoIceEnum); 225 IssmDouble l_r = element->FindParam(HydrologyCavitySpacingEnum); 226 Input* hr_input = element->GetInput(HydrologyBumpHeightEnum);_assert_(hr_input); 227 Input* vx_input = element->GetInput(VxEnum);_assert_(vx_input); 228 Input* vy_input = element->GetInput(VyEnum);_assert_(vy_input); 229 Input* N_input = element->GetInput(EffectivePressureEnum); _assert_(N_input); 230 Input* h_input = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input); 231 Input* G_input = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(G_input); 232 Input* B_input = element->GetInput(MaterialsRheologyBEnum); _assert_(B_input); 233 Input* n_input = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 243 IssmDouble L = element->FindParam(MaterialsLatentheatEnum); 244 IssmDouble rho_ice = element->FindParam(MaterialsRhoIceEnum); 245 IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum); 246 IssmDouble l_r = element->FindParam(HydrologyCavitySpacingEnum); 247 IssmDouble dt = element->FindParam(TimesteppingTimeStepEnum); 248 IssmDouble g = element->FindParam(ConstantsGEnum); 249 IssmDouble e_v = element->FindParam(HydrologyEnglacialVoidRatioEnum); 250 Input* hr_input = element->GetInput(HydrologyBumpHeightEnum);_assert_(hr_input); 251 Input* vx_input = element->GetInput(VxEnum);_assert_(vx_input); 252 Input* vy_input = element->GetInput(VyEnum);_assert_(vy_input); 253 Input* N_input = element->GetInput(EffectivePressureEnum); _assert_(N_input); 254 Input* h_input = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input); 255 Input* G_input = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(G_input); 256 Input* B_input = element->GetInput(MaterialsRheologyBEnum); _assert_(B_input); 257 Input* n_input = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 258 Input* phiold_input = element->GetInput(HydraulicPotentialOldEnum); _assert_(phiold_input); 234 259 235 260 /*Build friction element, needed later: */ … … 273 298 274 299 for(int i=0;i<numnodes;i++) pe->values[i]+= - Jdet*gauss->weight*(w-v-m)*basis[i]; 300 301 /*Transient term if dt>0*/ 302 if(dt>0.){ 303 phiold_input->GetInputValue(&phi_old,gauss); 304 for(int i=0;i<numnodes;i++) pe->values[i] += gauss->weight*Jdet*e_v/(rho_water*g*dt)*phi_old*basis[i]; 305 } 275 306 } 276 307
Note:
See TracChangeset
for help on using the changeset viewer.