Changeset 11347
- Timestamp:
- 02/07/12 14:30:43 (13 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
r11322 r11347 161 161 ThermalSpctemperatureEnum, 162 162 ThermalStabilizationEnum, 163 ThermalIsenthalpyEnum, 163 164 ThicknessEnum, 164 165 TimesteppingCflCoefficientEnum, -
issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
r11322 r11347 165 165 case ThermalSpctemperatureEnum : return "ThermalSpctemperature"; 166 166 case ThermalStabilizationEnum : return "ThermalStabilization"; 167 case ThermalIsenthalpyEnum : return "ThermalIsenthalpy"; 167 168 case ThicknessEnum : return "Thickness"; 168 169 case TimesteppingCflCoefficientEnum : return "TimesteppingCflCoefficient"; -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
r11322 r11347 79 79 parameters->AddObject(iomodel->CopyConstantObject(TransientIsthermalEnum)); 80 80 parameters->AddObject(iomodel->CopyConstantObject(TransientIsgroundinglineEnum)); 81 parameters->AddObject(iomodel->CopyConstantObject(ThermalIsenthalpyEnum)); 81 82 parameters->AddObject(iomodel->CopyConstantObject(MaterialsRheologyLawEnum)); 82 83 parameters->AddObject(iomodel->CopyConstantObject(AutodiffIsautodiffEnum)); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
r11129 r11347 20 20 21 21 int i,analysis_type,dim,verbose; 22 bool isthermal,isprognostic,isdiagnostic,isgroundingline ;22 bool isthermal,isprognostic,isdiagnostic,isgroundingline,isenthalpy; 23 23 24 24 /*output: */ … … 39 39 iomodel->Constant(&verbose,VerboseEnum); 40 40 iomodel->Constant(&isthermal,TransientIsthermalEnum); 41 iomodel->Constant(&isenthalpy,ThermalIsenthalpyEnum); 41 42 iomodel->Constant(&isprognostic,TransientIsprognosticEnum); 42 43 iomodel->Constant(&isdiagnostic,TransientIsdiagnosticEnum); … … 52 53 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && dim==2) continue; 53 54 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && dim==2) continue; 55 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && dim==2) continue; 54 56 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isthermal==false) continue; 55 57 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isthermal==false) continue; 58 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isthermal==false) continue; 59 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue; 60 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue; 61 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue; 56 62 if(solution_type==TransientSolutionEnum && analysis_type==PrognosticAnalysisEnum && isprognostic==false && isgroundingline==false) continue; 57 63 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticHorizAnalysisEnum && isdiagnostic==false) continue; -
issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
r11322 r11347 163 163 else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum; 164 164 else if (strcmp(name,"ThermalStabilization")==0) return ThermalStabilizationEnum; 165 else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum; 165 166 else if (strcmp(name,"Thickness")==0) return ThicknessEnum; 166 167 else if (strcmp(name,"TimesteppingCflCoefficient")==0) return TimesteppingCflCoefficientEnum; -
issm/trunk-jpl/src/c/objects/Elements/Penta.cpp
r11341 r11347 4085 4085 double rho_ice,heatcapacity,geothermalflux_value; 4086 4086 double basalfriction,alpha2,vx,vy; 4087 double scalar; 4087 double scalar,enthalpy,enthalpyup; 4088 double pressure,pressureup; 4088 4089 double basis[NUMVERTICES]; 4089 4090 Friction* friction=NULL; 4090 4091 GaussPenta* gauss=NULL; 4092 GaussPenta* gaussup=NULL; 4091 4093 4092 4094 /* Geothermal flux on ice sheet base and basal friction */ … … 4106 4108 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 4107 4109 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); 4108 4112 Input* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input); 4109 4113 … … 4113 4117 /* Start looping on the number of gauss 2d (nodes on the bedrock) */ 4114 4118 gauss=new GaussPenta(0,1,2,2); 4119 gaussup=new GaussPenta(3,4,5,2); 4115 4120 for(ig=gauss->begin();ig<gauss->end();ig++){ 4116 4121 4117 4122 gauss->GaussPoint(ig); 4123 gaussup->GaussPoint(ig); 4118 4124 4119 4125 GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss); 4120 4126 GetNodalFunctionsP1(&basis[0], gauss); 4121 4127 4122 geothermalflux_input->GetInputValue(&geothermalflux_value,gauss); 4123 friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum); 4124 vx_input->GetInputValue(&vx,gauss); 4125 vy_input->GetInputValue(&vy,gauss); 4126 basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0)); 4127 4128 scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice); 4129 if(dt) scalar=dt*scalar; 4130 4131 for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; 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 heatflux 4135 // } 4136 // else{ 4137 // //need to change spcenthalpy according to Aschwanden 4138 // //NEED TO UPDATE 4139 // } 4140 // } 4141 // else{ 4142 geothermalflux_input->GetInputValue(&geothermalflux_value,gauss); 4143 friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum); 4144 vx_input->GetInputValue(&vx,gauss); 4145 vy_input->GetInputValue(&vy,gauss); 4146 basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0)); 4147 4148 scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice); 4149 if(dt) scalar=dt*scalar; 4150 4151 for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i]; 4152 // } 4132 4153 } 4133 4154 4134 4155 /*Clean up and return*/ 4135 4156 delete gauss; 4157 delete gaussup; 4136 4158 delete friction; 4137 4159 return pe; … … 4309 4331 matpar->EnthalpyToThermal(&temperatures[i],&waterfraction[i],values[i],pressure[i]); 4310 4332 if(waterfraction[i]<0) _error_("Negative water fraction found in solution vector"); 4311 if(waterfraction[i]>1) _error_("Water fraction >1 found in solution vector");4333 // if(waterfraction[i]>1) _error_("Water fraction >1 found in solution vector"); 4312 4334 } 4313 4335 -
issm/trunk-jpl/src/c/objects/Materials/Matpar.cpp
r11301 r11347 420 420 } 421 421 else{ 422 return 0.1*thermalconductivity/(rho_ice*heatcapacity);422 return 1*thermalconductivity/(rho_ice*heatcapacity); 423 423 } 424 424 } -
issm/trunk-jpl/src/c/solutions/AnalysisConfiguration.cpp
r10287 r11347 95 95 96 96 case TransientSolutionEnum: 97 numanalyses= 8;97 numanalyses=9; 98 98 analyses=(int*)xmalloc(numanalyses*sizeof(int)); 99 99 analyses[0]=DiagnosticHorizAnalysisEnum; … … 105 105 analyses[6]=MeltingAnalysisEnum; 106 106 analyses[7]=PrognosticAnalysisEnum; 107 analyses[8]=EnthalpyAnalysisEnum; 107 108 break; 108 109 -
issm/trunk-jpl/src/c/solutions/transient_core.cpp
r11245 r11347 24 24 /*parameters: */ 25 25 double finaltime,dt,yts; 26 bool control_analysis,isdiagnostic,isprognostic,isthermal,isgroundingline ;26 bool control_analysis,isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy; 27 27 bool dakota_analysis=false; 28 28 bool time_adapt=false; … … 51 51 femmodel->parameters->FindParam(&isthermal,TransientIsthermalEnum); 52 52 femmodel->parameters->FindParam(&isgroundingline,TransientIsgroundinglineEnum); 53 femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum); 53 54 if(isgroundingline) femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum); 54 55 femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum); … … 91 92 _printf_(VerboseSolution()," computing temperatures:\n"); 92 93 #ifdef _HAVE_THERMAL_ 93 thermal_core_step(femmodel,step,time); 94 if(isenthalpy==0){ 95 thermal_core_step(femmodel,step,time); 96 } 97 else{ 98 enthalpy_core_step(femmodel,step,time); 99 } 94 100 #else 95 101 _error_("ISSM was not compiled with thermal capabilities. Exiting"); … … 135 141 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BedEnum,step,time); 136 142 if(dim==3 && isthermal) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,step,time); 137 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum,step,time); 143 if(isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,WaterfractionEnum,step,time); 144 if(isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,EnthalpyEnum,step,time); 145 if(!isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum,step,time); 138 146 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsMassBalanceEnum,step,time); 139 147 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,MaskElementonfloatingiceEnum,step,time); -
issm/trunk-jpl/src/c/solvers/solver_nonlinear.cpp
r11322 r11347 85 85 if(count>=max_nonlinear_iterations){ 86 86 _printf_(true," maximum number of iterations (%i) exceeded\n",max_nonlinear_iterations); 87 converged=true; 88 InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum); 89 InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug); 87 90 break; 88 91 } -
issm/trunk-jpl/src/m/classes/initialization.m
r11279 r11347 62 62 checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices 1]); 63 63 end 64 if ismember(EnthalpyAnalysisEnum,analyses),64 if (ismember(EnthalpyAnalysisEnum,analyses) & md.thermal.isenthalpy), 65 65 checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices 1]); 66 66 end -
issm/trunk-jpl/src/m/classes/thermal.m
r11265 r11347 12 12 penalty_lock = 0; 13 13 penalty_factor = 0; 14 isenthalpy = 0; 14 15 end 15 16 methods … … 42 43 %factor used to compute the values of the penalties: kappa=max(stiffness matrix)*10^penalty_factor 43 44 obj.penalty_factor=3; 45 46 %Should we use cold ice (default) or enthalpy formulation 47 obj.isenthalpy=0; 44 48 end % }}} 45 49 function checkconsistency(obj,md,solution,analyses) % {{{ … … 52 56 if ismember(EnthalpyAnalysisEnum,analyses), 53 57 checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*md.geometry.thickness,'message','spctemperature should be below the adjusted melting point'); 58 checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]); 54 59 end 55 60 end % }}} … … 62 67 fielddisplay(obj,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)'); 63 68 fielddisplay(obj,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)'); 69 fielddisplay(obj,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)'); 64 70 65 71 end % }}} … … 71 77 WriteData(fid,'object',obj,'fieldname','penalty_lock','format','Integer'); 72 78 WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double'); 79 WriteData(fid,'object',obj,'fieldname','isenthalpy','format','Boolean'); 73 80 end % }}} 74 81 end -
issm/trunk-jpl/src/m/solutions/AnalysisConfiguration.m
r10286 r11347 42 42 43 43 case TransientSolutionEnum, 44 numanalyses= 8;45 analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;PrognosticAnalysisEnum ];44 numanalyses=9; 45 analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;PrognosticAnalysisEnum;EnthalpyAnalysisEnum]; 46 46 47 47 case FlaimSolutionEnum, -
issm/trunk-jpl/src/m/solutions/transient_core.m
r10999 r11347 19 19 isthermal=femmodel.parameters.TransientIsthermal; 20 20 isgroundingline=femmodel.parameters.TransientIsgroundingline; 21 isenthalpy=femmodel.parameters.ThermalIsenthalpy; 21 22 groundinglinemigration=femmodel.parameters.GroundinglineMigration; 22 23 … … 57 58 if (isthermal & dim==3) 58 59 issmprintf(VerboseSolution,'\n%s',[' computing temperature']); 59 femmodel=thermal_core_step(femmodel); 60 if (isenthalpy==0), 61 femmodel=thermal_core_step(femmodel); 62 else 63 femmodel=enthalpy_core_step(femmodel); 64 end 60 65 end 61 66 … … 90 95 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BedEnum,step,time); 91 96 if (dim==3 & isthermal), femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,TemperatureEnum,step,time);end 97 if (dim==3 & isenthalpy), femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,WaterfractionEnum,step,time);end 98 if (dim==3 & isenthalpy), femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,EnthalpyEnum,step,time);end 92 99 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BasalforcingsMeltingRateEnum,step,time); 93 100 femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,SurfaceforcingsMassBalanceEnum,step,time);
Note:
See TracChangeset
for help on using the changeset viewer.