Changeset 11355
- Timestamp:
- 02/07/12 15:49:52 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Elements/Penta.cpp
r11351 r11355 3854 3854 double rho_ice,heatcapacity,geothermalflux_value; 3855 3855 double basalfriction,alpha2,vx,vy; 3856 double scalar; 3856 double scalar,enthalpy,enthalpyup; 3857 double pressure,pressureup; 3857 3858 double basis[NUMVERTICES]; 3858 3859 Friction* friction=NULL; 3859 3860 GaussPenta* gauss=NULL; 3861 GaussPenta* gaussup=NULL; 3860 3862 3861 3863 /* Geothermal flux on ice sheet base and basal friction */ … … 3875 3877 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 3876 3878 Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input); 3879 Input* enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(enthalpy_input); 3880 Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input); 3877 3881 Input* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input); 3878 3882 … … 3882 3886 /* Start looping on the number of gauss 2d (nodes on the bedrock) */ 3883 3887 gauss=new GaussPenta(0,1,2,2); 3888 gaussup=new GaussPenta(3,4,5,2); 3884 3889 for(ig=gauss->begin();ig<gauss->end();ig++){ 3885 3890 3886 3891 gauss->GaussPoint(ig); 3892 gaussup->GaussPoint(ig); 3887 3893 3888 3894 GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss); 3889 3895 GetNodalFunctionsP1(&basis[0], gauss); 3890 3896 3891 geothermalflux_input->GetInputValue(&geothermalflux_value,gauss); 3892 friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum); 3893 vx_input->GetInputValue(&vx,gauss); 3894 vy_input->GetInputValue(&vy,gauss); 3895 basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0)); 3896 3897 scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice); 3898 if(dt) scalar=dt*scalar; 3899 3900 for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; 3897 enthalpy_input->GetInputValue(&enthalpy,gauss); 3898 pressure_input->GetInputValue(&pressure,gauss); 3899 if(enthalpy>matpar->PureIceEnthalpy(pressure)){ 3900 enthalpy_input->GetInputValue(&enthalpyup,gaussup); 3901 pressure_input->GetInputValue(&pressureup,gaussup); 3902 if(enthalpyup>matpar->PureIceEnthalpy(pressureup)){ 3903 //do nothing, don't add heatflux 3904 } 3905 else{ 3906 //need to change spcenthalpy according to Aschwanden 3907 //NEED TO UPDATE 3908 } 3909 } 3910 else{ 3911 geothermalflux_input->GetInputValue(&geothermalflux_value,gauss); 3912 friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum); 3913 vx_input->GetInputValue(&vx,gauss); 3914 vy_input->GetInputValue(&vy,gauss); 3915 basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0)); 3916 3917 scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice); 3918 if(dt) scalar=dt*scalar; 3919 3920 for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; 3921 } 3901 3922 } 3902 3923 3903 3924 /*Clean up and return*/ 3904 3925 delete gauss; 3926 delete gaussup; 3905 3927 delete friction; 3906 3928 return pe; … … 4085 4107 double rho_ice,heatcapacity,geothermalflux_value; 4086 4108 double basalfriction,alpha2,vx,vy; 4087 double scalar,enthalpy,enthalpyup;4088 double pressure,pressureup;4089 4109 double basis[NUMVERTICES]; 4110 double scalar; 4090 4111 Friction* friction=NULL; 4091 4112 GaussPenta* gauss=NULL; 4092 GaussPenta* gaussup=NULL;4093 4113 4094 4114 /* Geothermal flux on ice sheet base and basal friction */ … … 4108 4128 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 4109 4129 Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input); 4110 Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);4111 Input* enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(enthalpy_input);4112 4130 Input* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input); 4113 4131 … … 4117 4135 /* Start looping on the number of gauss 2d (nodes on the bedrock) */ 4118 4136 gauss=new GaussPenta(0,1,2,2); 4119 gaussup=new GaussPenta(3,4,5,2);4120 4137 for(ig=gauss->begin();ig<gauss->end();ig++){ 4121 4138 4122 4139 gauss->GaussPoint(ig); 4123 gaussup->GaussPoint(ig);4124 4140 4125 4141 GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss); 4126 4142 GetNodalFunctionsP1(&basis[0], gauss); 4127 4143 4128 enthalpy_input->GetInputValue(&enthalpy,gauss);4129 pressure_input->GetInputValue(&pressure,gauss);4130 // if(enthalpy>matpar->PureIceEnthalpy(pressure)){4131 // enthalpy_input->GetInputValue(&enthalpyup,gaussup);4132 // pressure_input->GetInputValue(&pressureup,gaussup);4133 // if(enthalpyup>matpar->PureIceEnthalpy(pressureup)){4134 // //do nothing, don't add heatflux4135 // }4136 // else{4137 // //need to change spcenthalpy according to Aschwanden4138 // //NEED TO UPDATE4139 // }4140 // }4141 // else{4142 4144 geothermalflux_input->GetInputValue(&geothermalflux_value,gauss); 4143 4145 friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum); … … 4150 4152 4151 4153 for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; 4152 // }4153 4154 } 4154 4155 4155 4156 /*Clean up and return*/ 4156 4157 delete gauss; 4157 delete gaussup;4158 4158 delete friction; 4159 4159 return pe;
Note:
See TracChangeset
for help on using the changeset viewer.