Changeset 11361
- Timestamp:
- 02/08/12 13:29:22 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/objects/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Elements/Penta.cpp
r11355 r11361 1132 1132 /*}}}*/ 1133 1133 /*FUNCTION Penta::GetStabilizationParameter {{{1*/ 1134 double Penta::GetStabilizationParameter(double u, double v, double w, double diameter, double rho_ice, double heatcapacity, double thermalconductivity){1134 double Penta::GetStabilizationParameter(double u, double v, double w, double diameter, double kappa){ 1135 1135 /*Compute stabilization parameter*/ 1136 /*kappa=thermalconductivity/(rho_ice*hearcapacity) for thermal model*/ 1137 /*kappa=enthalpydiffusionparameter for enthalpy model*/ 1136 1138 1137 1139 double normu; … … 1139 1141 1140 1142 normu=pow(pow(u,2)+pow(v,2)+pow(w,2),0.5); 1141 if(normu*diameter/(3*2* thermalconductivity/(rho_ice*heatcapacity))<1){1142 tau_parameter=pow(diameter,2)/(3*2*2* thermalconductivity/(rho_ice*heatcapacity));1143 if(normu*diameter/(3*2*kappa)<1){ 1144 tau_parameter=pow(diameter,2)/(3*2*2*kappa); 1143 1145 } 1144 1146 else tau_parameter=diameter/(2*normu); … … 3372 3374 else if(stabilization==2){ 3373 3375 GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss); 3374 tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter, rho_ice,heatcapacity,thermalconductivity);3376 tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,kappa); 3375 3377 3376 3378 for(i=0;i<numdof;i++){ … … 3486 3488 double Jdet,u,v,w,um,vm,wm,vel; 3487 3489 double h,hx,hy,hz,vx,vy,vz; 3488 double gravity,rho_ice,rho_water ;3490 double gravity,rho_ice,rho_water,kappa; 3489 3491 double heatcapacity,thermalconductivity,dt; 3490 3492 double tau_parameter,diameter; … … 3512 3514 heatcapacity=matpar->GetHeatCapacity(); 3513 3515 thermalconductivity=matpar->GetThermalConductivity(); 3516 kappa=thermalconductivity/(rho_ice*heatcapacity); 3514 3517 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 3515 3518 this->parameters->FindParam(&stabilization,ThermalStabilizationEnum); … … 3603 3606 else if(stabilization==2){ 3604 3607 GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss); 3605 tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter, rho_ice,heatcapacity,thermalconductivity);3608 tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,kappa); 3606 3609 3607 3610 for(i=0;i<numdof;i++){ … … 3708 3711 double Jdet,phi,dt; 3709 3712 double rho_ice,heatcapacity; 3710 double thermalconductivity ;3711 double viscosity,enthalpy ;3713 double thermalconductivity,kappa; 3714 double viscosity,enthalpy,pressure; 3712 3715 double tau_parameter,diameter; 3713 3716 double u,v,w; … … 3733 3736 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 3734 3737 Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input); 3738 Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input); 3735 3739 Input* enthalpy_input=NULL; 3736 3740 if (dt) enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(inputs); … … 3746 3750 GetNodalFunctionsP1(&L[0], gauss); 3747 3751 3752 enthalpy_input->GetInputValue(&enthalpy, gauss); 3748 3753 this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input); 3749 3754 matice->GetViscosity3dStokes(&viscosity,&epsilon[0]); … … 3757 3762 /* Build transient now */ 3758 3763 if(dt){ 3759 enthalpy_input->GetInputValue(&enthalpy, gauss);3760 3764 scalar_transient=enthalpy*Jdet*gauss->weight; 3761 3765 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=scalar_transient*L[i]; … … 3768 3772 vy_input->GetInputValue(&v, gauss); 3769 3773 vz_input->GetInputValue(&w, gauss); 3770 3771 tau_parameter=GetStabilizationParameter(u,v,w,diameter,rho_ice,heatcapacity,thermalconductivity); 3774 pressure_input->GetInputValue(&pressure, gauss); 3775 kappa=matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure); 3776 3777 tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa); 3772 3778 3773 3779 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]); … … 3961 3967 double Jdet,phi,dt; 3962 3968 double rho_ice,heatcapacity; 3963 double thermalconductivity ;3969 double thermalconductivity,kappa; 3964 3970 double viscosity,temperature; 3965 3971 double tau_parameter,diameter; … … 3981 3987 heatcapacity=matpar->GetHeatCapacity(); 3982 3988 thermalconductivity=matpar->GetThermalConductivity(); 3989 kappa=heatcapacity/(rho_ice*thermalconductivity); 3983 3990 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 3984 3991 this->parameters->FindParam(&stabilization,ThermalStabilizationEnum); … … 4022 4029 vz_input->GetInputValue(&w, gauss); 4023 4030 4024 tau_parameter=GetStabilizationParameter(u,v,w,diameter, rho_ice,heatcapacity,thermalconductivity);4031 tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa); 4025 4032 4026 4033 for(i=0;i<NUMVERTICES;i++) pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]); -
issm/trunk-jpl/src/c/objects/Elements/Penta.h
r11340 r11361 183 183 void GetPhi(double* phi, double* epsilon, double viscosity); 184 184 void GetSolutionFromInputsEnthalpy(Vec solutiong); 185 double GetStabilizationParameter(double u, double v, double w, double diameter, double rho_ice, double heatcapacity, double thermalconductivity);185 double GetStabilizationParameter(double u, double v, double w, double diameter, double kappa); 186 186 void GetStrainRate3dPattyn(double* epsilon,double* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input); 187 187 void GetStrainRate3d(double* epsilon,double* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input, Input* vz_input);
Note:
See TracChangeset
for help on using the changeset viewer.