Changeset 8487
- Timestamp:
- 06/03/11 08:20:25 (14 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r8483 r8487 450 450 EnthalpySolutionEnum, 451 451 EnthalpyAnalysisEnum, 452 EnthalpyEnum 452 EnthalpyEnum, 453 WaterFractionEnum, 454 ReferenceTemperatureEnum 453 455 }; 454 456 -
issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
r8483 r8487 394 394 case EnthalpyAnalysisEnum : return "EnthalpyAnalysis"; 395 395 case EnthalpyEnum : return "Enthalpy"; 396 case WaterFractionEnum : return "WaterFraction"; 397 case ReferenceTemperatureEnum : return "ReferenceTemperature"; 396 398 default : return "unknown"; 397 399 -
issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
r8392 r8487 62 62 parameters->AddObject(new DoubleParam(BetaEnum,iomodel->beta)); 63 63 parameters->AddObject(new DoubleParam(MeltingPointEnum,iomodel->meltingpoint)); 64 parameters->AddObject(new DoubleParam(ReferenceTemperatureEnum,iomodel->referencetemperature)); 64 65 parameters->AddObject(new DoubleParam(LatentHeatEnum,iomodel->latentheat)); 65 66 parameters->AddObject(new DoubleParam(HeatCapacityEnum,iomodel->heatcapacity)); -
issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp
r8483 r8487 40 40 IoModelFetchData(&iomodel->pressure,NULL,NULL,iomodel_handle,"pressure"); 41 41 IoModelFetchData(&iomodel->temperature,NULL,NULL,iomodel_handle,"temperature"); 42 IoModelFetchData(&iomodel->waterfraction,NULL,NULL,iomodel_handle,"waterfraction"); 42 43 IoModelFetchData(&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux"); 43 44 IoModelFetchData(&iomodel->vx,NULL,NULL,iomodel_handle,"vx"); … … 74 75 xfree((void**)&iomodel->pressure); 75 76 xfree((void**)&iomodel->temperature); 77 xfree((void**)&iomodel->waterfraction); 76 78 xfree((void**)&iomodel->geothermalflux); 77 79 xfree((void**)&iomodel->vx); -
issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
r8483 r8487 392 392 else if (strcmp(name,"EnthalpyAnalysis")==0) return EnthalpyAnalysisEnum; 393 393 else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum; 394 else if (strcmp(name,"WaterFraction")==0) return WaterFractionEnum; 395 else if (strcmp(name,"ReferenceTemperature")==0) return ReferenceTemperatureEnum; 394 396 else _error_("Enum %s not found",name); 395 397 -
issm/trunk/src/c/objects/Elements/Penta.cpp
r8483 r8487 4866 4866 for(i=0;i<6;i++)nodeinputs[i]=iomodel->temperature[penta_vertex_ids[i]-1]; 4867 4867 this->inputs->AddInput(new PentaVertexInput(TemperatureEnum,nodeinputs)); 4868 } 4869 if (iomodel->waterfraction) { 4870 for(i=0;i<6;i++)nodeinputs[i]=iomodel->waterfraction[penta_vertex_ids[i]-1]; 4871 this->inputs->AddInput(new PentaVertexInput(WaterFractionEnum,nodeinputs)); 4868 4872 } 4869 4873 if (iomodel->dhdt) { … … 6010 6014 this->inputs->AddInput(new PentaVertexInput(TemperaturePicardEnum,values)); 6011 6015 } 6016 6017 /*Free ressources:*/ 6018 xfree((void**)&doflist); 6019 } 6020 /*}}}*/ 6021 /*FUNCTION Penta::InputUpdateFromSolutionEnthalpy {{{1*/ 6022 void Penta::InputUpdateFromSolutionEnthalpy(double* solution){ 6023 6024 const int numdof=NDOF1*NUMVERTICES; 6025 6026 bool converged; 6027 int i,rheology_law; 6028 double xyz_list[NUMVERTICES][3]; 6029 double values[numdof]; 6030 double temperatures[numdof]; 6031 double waterfraction[numdof]; 6032 double B[numdof]; 6033 double B_average,s_average; 6034 int* doflist=NULL; 6035 6036 /*Get dof list: */ 6037 GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 6038 6039 /*Use the dof list to index into the solution vector: */ 6040 for(i=0;i<numdof;i++){ 6041 values[i]=solution[doflist[i]]; 6042 6043 /*Check solution*/ 6044 if(isnan(values[i])) _error_("NaN found in solution vector"); 6045 } 6046 6047 /*Get all inputs and parameters*/ 6048 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); 6049 Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input); 6050 6051 this->inputs->GetParameterValue(&converged,ConvergedEnum); 6052 if(converged){ 6053 /*Convert enthalpy into temperature and water fraction*/ 6054 // for(i=0;i<numdof;i++){ 6055 // if values[i]<GetPureIceEnthalpy(){ 6056 // temperatures[i]=values[i]; 6057 // waterfraction[i]=0; 6058 // } 6059 // else{ 6060 // temperatures[i]=values[i]; 6061 // waterfraction[i]=values[i]; 6062 // } 6063 // } 6064 6065 this->inputs->AddInput(new PentaVertexInput(EnthalpyEnum,values)); 6066 this->inputs->AddInput(new PentaVertexInput(WaterFractionEnum,waterfraction)); 6067 this->inputs->AddInput(new PentaVertexInput(TemperatureEnum,temperatures)); 6068 6069 /*Update Rheology only if converged (we must make sure that the temperature is below melting point 6070 * otherwise the rheology could be negative*/ 6071 this->parameters->FindParam(&rheology_law,RheologyLawEnum); 6072 switch(rheology_law){ 6073 case NoneEnum: 6074 /*Do nothing: B is not temperature dependent*/ 6075 break; 6076 case PatersonEnum: 6077 B_average=Paterson((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0); 6078 for(i=0;i<numdof;i++) B[i]=B_average; 6079 this->matice->inputs->AddInput(new PentaVertexInput(RheologyBEnum,B)); 6080 break; 6081 case ArrheniusEnum: 6082 surface_input->GetParameterAverage(&s_average); 6083 B_average=Arrhenius((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0, 6084 s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0), 6085 matice->GetN()); 6086 for(i=0;i<numdof;i++) B[i]=B_average; 6087 this->matice->inputs->AddInput(new PentaVertexInput(RheologyBEnum,B)); 6088 break; 6089 default: 6090 _error_("Rheology law %s not supported yet",EnumToStringx(rheology_law)); 6091 6092 } 6093 } 6094 // else{ 6095 // this->inputs->AddInput(new PentaVertexInput(EnthalpyPicardEnum,values)); 6096 // } 6012 6097 6013 6098 /*Free ressources:*/ … … 7111 7196 this->inputs->AddInput(new PentaVertexInput(VyMeshEnum,nodeinputs)); 7112 7197 this->inputs->AddInput(new PentaVertexInput(VzMeshEnum,nodeinputs)); 7198 if (iomodel->temperature && iomodel->waterfraction) { 7199 for(i=0;i<6;i++){ 7200 if(iomodel->temperature[penta_vertex_ids[i]-1] < iomodel->meltingpoint-iomodel->beta*iomodel->pressure[penta_vertex_ids[i]-1]){ 7201 nodeinputs[i]=iomodel->heatcapacity*(iomodel->temperature[penta_vertex_ids[i]-1]-iomodel->referencetemperature); 7202 } 7203 else nodeinputs[i]=iomodel->heatcapacity* 7204 (iomodel->meltingpoint-iomodel->beta*iomodel->pressure[penta_vertex_ids[i]-1]-iomodel->referencetemperature) 7205 +iomodel->latentheat*iomodel->waterfraction[penta_vertex_ids[i]-1]; 7206 } 7207 this->inputs->AddInput(new PentaVertexInput(EnthalpyEnum,nodeinputs)); 7208 } 7209 else _error_("temperature and waterfraction required for the enthalpy solution"); 7113 7210 break; 7114 7211 -
issm/trunk/src/c/objects/Elements/Penta.h
r8483 r8487 245 245 void InputUpdateFromSolutionPrognostic(double* solutiong); 246 246 void InputUpdateFromSolutionThermal( double* solutiong); 247 void InputUpdateFromSolutionEnthalpy( double* solutiong); 247 248 void InputUpdateFromSolutionOneDof(double* solutiong,int enum_type); 248 249 void InputUpdateFromSolutionOneDofCollapsed(double* solutiong,int enum_type); -
issm/trunk/src/c/objects/IoModel.cpp
r8399 r8487 69 69 xfree((void**)&this->pressure); 70 70 xfree((void**)&this->temperature); 71 xfree((void**)&this->waterfraction); 71 72 xfree((void**)&this->drag_coefficient); 72 73 xfree((void**)&this->drag_p); … … 213 214 IoModelFetchData(&this->hydro_kn,iomodel_handle,"hydro_kn"); 214 215 IoModelFetchData(&this->meltingpoint,iomodel_handle,"meltingpoint"); 216 IoModelFetchData(&this->referencetemperature,iomodel_handle,"referencetemperature"); 215 217 IoModelFetchData(&this->latentheat,iomodel_handle,"latentheat"); 216 218 IoModelFetchData(&this->heatcapacity,iomodel_handle,"heatcapacity"); … … 286 288 this->pressure=NULL; 287 289 this->temperature=NULL; 290 this->waterfraction=NULL; 288 291 this->gl_melting_rate=0; 289 292 this->basal_melting_rate=NULL; … … 383 386 this->beta=0; 384 387 this->meltingpoint=0; 388 this->referencetemperature=0; 385 389 this->latentheat=0; 386 390 this->heatcapacity=0; -
issm/trunk/src/c/objects/IoModel.h
r8399 r8487 56 56 double* pressure; 57 57 double* temperature; 58 double* waterfraction; 58 59 59 60 /*i/o: */ … … 172 173 double hydro_kn; 173 174 double meltingpoint; 175 double referencetemperature; 174 176 double latentheat; 175 177 double heatcapacity,thermalconductivity;
Note:
See TracChangeset
for help on using the changeset viewer.