[16534] | 1 | #include "./EnthalpyAnalysis.h"
|
---|
| 2 | #include "../toolkits/toolkits.h"
|
---|
| 3 | #include "../classes/classes.h"
|
---|
| 4 | #include "../shared/shared.h"
|
---|
| 5 | #include "../modules/modules.h"
|
---|
[18591] | 6 | #include "../solutionsequences/solutionsequences.h"
|
---|
[21721] | 7 | #include "../cores/cores.h"
|
---|
[16534] | 8 |
|
---|
| 9 | /*Model processing*/
|
---|
[18930] | 10 | void EnthalpyAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
|
---|
[16604] | 11 |
|
---|
[18930] | 12 | /*Intermediary*/
|
---|
| 13 | int count;
|
---|
| 14 | int M,N;
|
---|
| 15 | bool spcpresent = false;
|
---|
[21546] | 16 | int finiteelement;
|
---|
[18930] | 17 | IssmDouble heatcapacity;
|
---|
| 18 | IssmDouble referencetemperature;
|
---|
[16604] | 19 |
|
---|
[18930] | 20 | /*Output*/
|
---|
| 21 | IssmDouble *spcvector = NULL;
|
---|
| 22 | IssmDouble* times=NULL;
|
---|
| 23 | IssmDouble* values=NULL;
|
---|
[16604] | 24 |
|
---|
[18930] | 25 | /*Fetch parameters: */
|
---|
[20690] | 26 | iomodel->FindConstant(&heatcapacity,"md.materials.heatcapacity");
|
---|
| 27 | iomodel->FindConstant(&referencetemperature,"md.constants.referencetemperature");
|
---|
[21546] | 28 | iomodel->FindConstant(&finiteelement,"md.thermal.fe");
|
---|
[18732] | 29 |
|
---|
[18930] | 30 | /*return if 2d mesh*/
|
---|
| 31 | if(iomodel->domaintype==Domain2DhorizontalEnum) return;
|
---|
| 32 |
|
---|
| 33 | /*Fetch data: */
|
---|
[20690] | 34 | iomodel->FetchData(&spcvector,&M,&N,"md.thermal.spctemperature");
|
---|
[18930] | 35 |
|
---|
[21546] | 36 | /*Convert spcs from temperatures to enthalpy*/
|
---|
| 37 | _assert_(N>0); _assert_(M>=iomodel->numberofvertices);
|
---|
| 38 | for(int i=0;i<iomodel->numberofvertices;i++){
|
---|
[21549] | 39 | for(int j=0;j<N;j++){
|
---|
| 40 | spcvector[i*N+j] = heatcapacity*(spcvector[i*N+j]-referencetemperature);
|
---|
[18930] | 41 | }
|
---|
| 42 | }
|
---|
| 43 |
|
---|
[21548] | 44 | /*Specific case for PDD, we want the constaints to be updated by the PDD scheme itself*/
|
---|
| 45 | bool isdynamic = false;
|
---|
| 46 | if (iomodel->solution_enum==TransientSolutionEnum){
|
---|
| 47 | int smb_model;
|
---|
| 48 | iomodel->FindConstant(&smb_model,"md.smb.model");
|
---|
| 49 | if(smb_model==SMBpddEnum) isdynamic=true;
|
---|
| 50 | if(smb_model==SMBd18opddEnum) isdynamic=true;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | if(isdynamic){
|
---|
[21560] | 54 | IoModelToDynamicConstraintsx(constraints,iomodel,spcvector,M,N,EnthalpyAnalysisEnum,finiteelement);
|
---|
[21548] | 55 | }
|
---|
| 56 | else{
|
---|
| 57 | IoModelToConstraintsx(constraints,iomodel,spcvector,M,N,EnthalpyAnalysisEnum,finiteelement);
|
---|
| 58 | }
|
---|
| 59 |
|
---|
[18930] | 60 | /*Free ressources:*/
|
---|
[20690] | 61 | iomodel->DeleteData(spcvector,"md.thermal.spctemperature");
|
---|
[18930] | 62 | xDelete<IssmDouble>(times);
|
---|
| 63 | xDelete<IssmDouble>(values);
|
---|
[16539] | 64 | }/*}}}*/
|
---|
[18930] | 65 | void EnthalpyAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
|
---|
| 66 |
|
---|
| 67 | /*No loads */
|
---|
| 68 | }/*}}}*/
|
---|
| 69 | void EnthalpyAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
|
---|
| 70 |
|
---|
[21542] | 71 | int finiteelement;
|
---|
| 72 | iomodel->FindConstant(&finiteelement,"md.thermal.fe");
|
---|
| 73 |
|
---|
[20690] | 74 | if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
|
---|
[21542] | 75 | ::CreateNodes(nodes,iomodel,EnthalpyAnalysisEnum,finiteelement);
|
---|
[20690] | 76 | iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
|
---|
[18930] | 77 | }/*}}}*/
|
---|
| 78 | int EnthalpyAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
|
---|
| 79 | return 1;
|
---|
| 80 | }/*}}}*/
|
---|
[16539] | 81 | void EnthalpyAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
|
---|
| 82 |
|
---|
[20459] | 83 | bool dakota_analysis,ismovingfront,isenthalpy;
|
---|
[21382] | 84 | int frictionlaw,basalforcing_model,materialstype;
|
---|
[19161] | 85 | int FrictionCoupling;
|
---|
| 86 |
|
---|
[16539] | 87 | /*Now, is the model 3d? otherwise, do nothing: */
|
---|
[17700] | 88 | if(iomodel->domaintype==Domain2DhorizontalEnum)return;
|
---|
[16539] | 89 |
|
---|
| 90 | /*Is enthalpy requested?*/
|
---|
[20690] | 91 | iomodel->FindConstant(&isenthalpy,"md.thermal.isenthalpy");
|
---|
[16539] | 92 | if(!isenthalpy) return;
|
---|
| 93 |
|
---|
| 94 | /*Fetch data needed: */
|
---|
[20690] | 95 | iomodel->FetchData(3,"md.initialization.temperature","md.initialization.waterfraction","md.initialization.pressure");
|
---|
[16539] | 96 |
|
---|
[21542] | 97 | /*Finite element type*/
|
---|
| 98 | int finiteelement;
|
---|
| 99 | iomodel->FindConstant(&finiteelement,"md.thermal.fe");
|
---|
| 100 |
|
---|
[16539] | 101 | /*Update elements: */
|
---|
| 102 | int counter=0;
|
---|
| 103 | for(int i=0;i<iomodel->numberofelements;i++){
|
---|
| 104 | if(iomodel->my_elements[i]){
|
---|
| 105 | Element* element=(Element*)elements->GetObjectByOffset(counter);
|
---|
[21542] | 106 | element->Update(i,iomodel,analysis_counter,analysis_type,finiteelement);
|
---|
[16539] | 107 | counter++;
|
---|
| 108 | }
|
---|
| 109 | }
|
---|
| 110 |
|
---|
[20690] | 111 | iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota");
|
---|
| 112 | iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront");
|
---|
| 113 | iomodel->FindConstant(&frictionlaw,"md.friction.law");
|
---|
[21382] | 114 | iomodel->FindConstant(&materialstype,"md.materials.type");
|
---|
[16539] | 115 |
|
---|
[20690] | 116 | iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum);
|
---|
| 117 | iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum);
|
---|
| 118 | iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0);
|
---|
| 119 | iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum);
|
---|
| 120 | iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
|
---|
| 121 | iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum);
|
---|
[17886] | 122 | if(iomodel->domaintype!=Domain2DhorizontalEnum){
|
---|
[20690] | 123 | iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
|
---|
| 124 | iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
|
---|
[17886] | 125 | }
|
---|
[20690] | 126 | iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum);
|
---|
| 127 | iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum);
|
---|
| 128 | iomodel->FetchDataToInput(elements,"md.initialization.waterfraction",WaterfractionEnum);
|
---|
| 129 | iomodel->FetchDataToInput(elements,"md.initialization.enthalpy",EnthalpyEnum);
|
---|
| 130 | iomodel->FetchDataToInput(elements,"md.initialization.watercolumn",WatercolumnEnum);
|
---|
| 131 | iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
|
---|
| 132 | iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum);
|
---|
| 133 | iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum);
|
---|
| 134 | iomodel->FetchDataToInput(elements,"md.initialization.vz",VzEnum);
|
---|
[16539] | 135 | InputUpdateFromConstantx(elements,0.,VxMeshEnum);
|
---|
| 136 | InputUpdateFromConstantx(elements,0.,VyMeshEnum);
|
---|
| 137 | InputUpdateFromConstantx(elements,0.,VzMeshEnum);
|
---|
[20459] | 138 | if(ismovingfront){
|
---|
[20690] | 139 | iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); // required for updating active nodes
|
---|
[17434] | 140 | }
|
---|
[20020] | 141 |
|
---|
| 142 | /*Basal forcings variables*/
|
---|
[20690] | 143 | iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
|
---|
[20020] | 144 | switch(basalforcing_model){
|
---|
| 145 | case MantlePlumeGeothermalFluxEnum:
|
---|
| 146 | break;
|
---|
| 147 | default:
|
---|
[20690] | 148 | iomodel->FetchDataToInput(elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum);
|
---|
[20020] | 149 | break;
|
---|
| 150 | }
|
---|
[21382] | 151 |
|
---|
| 152 | /*Rheology type*/
|
---|
| 153 | iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
|
---|
| 154 | switch(materialstype){
|
---|
[21389] | 155 | case MatenhancediceEnum:
|
---|
| 156 | iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
|
---|
| 157 | iomodel->FetchDataToInput(elements,"md.materials.rheology_E",MaterialsRheologyEEnum);
|
---|
| 158 | break;
|
---|
[21382] | 159 | case MatdamageiceEnum:
|
---|
| 160 | iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
|
---|
| 161 | break;
|
---|
| 162 | case MatestarEnum:
|
---|
| 163 | iomodel->FetchDataToInput(elements,"md.materials.rheology_Ec",MaterialsRheologyEcEnum);
|
---|
| 164 | iomodel->FetchDataToInput(elements,"md.materials.rheology_Es",MaterialsRheologyEsEnum);
|
---|
| 165 | break;
|
---|
| 166 | case MaticeEnum:
|
---|
| 167 | iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
|
---|
| 168 | break;
|
---|
| 169 | default:
|
---|
| 170 | _error_("not supported");
|
---|
| 171 | }
|
---|
[17952] | 172 |
|
---|
| 173 | /*Friction law variables*/
|
---|
| 174 | switch(frictionlaw){
|
---|
| 175 | case 1:
|
---|
[21740] | 176 | iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
|
---|
[20690] | 177 | iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum);
|
---|
| 178 | iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum);
|
---|
| 179 | iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
|
---|
[21740] | 180 | if (FrictionCoupling==1){
|
---|
| 181 | iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);
|
---|
| 182 | }
|
---|
[17952] | 183 | break;
|
---|
| 184 | case 2:
|
---|
[20690] | 185 | iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum);
|
---|
| 186 | iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum);
|
---|
[17952] | 187 | break;
|
---|
[18778] | 188 | case 3:
|
---|
[20690] | 189 | iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
|
---|
| 190 | iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum);
|
---|
| 191 | iomodel->FetchDataToInput(elements,"md.friction.As",FrictionAsEnum);
|
---|
| 192 | iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
|
---|
[21740] | 193 | if (FrictionCoupling==1){
|
---|
[20690] | 194 | iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);
|
---|
[19161] | 195 | }
|
---|
[18778] | 196 | break;
|
---|
[18732] | 197 | case 4:
|
---|
[20690] | 198 | iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum);
|
---|
| 199 | iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum);
|
---|
| 200 | iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
|
---|
| 201 | iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum);
|
---|
| 202 | iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum);
|
---|
[18732] | 203 | break;
|
---|
[18772] | 204 | case 5:
|
---|
[20690] | 205 | iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum);
|
---|
| 206 | iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum);
|
---|
| 207 | iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
|
---|
| 208 | iomodel->FetchDataToInput(elements,"md.friction.water_layer",FrictionWaterLayerEnum);
|
---|
[18772] | 209 | break;
|
---|
[18804] | 210 | case 6:
|
---|
[20690] | 211 | iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum);
|
---|
| 212 | iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum);
|
---|
| 213 | iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum);
|
---|
| 214 | iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum);
|
---|
[18804] | 215 | break;
|
---|
[21556] | 216 | case 9:
|
---|
| 217 | iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum);
|
---|
| 218 | iomodel->FetchDataToInput(elements,"md.friction.pressure_adjusted_temperature",FrictionPressureAdjustedTemperatureEnum);
|
---|
[21565] | 219 | InputUpdateFromConstantx(elements,1.,FrictionPEnum);
|
---|
| 220 | InputUpdateFromConstantx(elements,1.,FrictionQEnum);
|
---|
[21556] | 221 | break;
|
---|
[17952] | 222 | default:
|
---|
[21873] | 223 | _error_("friction law not supported");
|
---|
[17952] | 224 | }
|
---|
[20690] | 225 |
|
---|
[16539] | 226 | /*Free data: */
|
---|
[20690] | 227 | iomodel->DeleteData(3,"md.initialization.temperature","md.initialization.waterfraction","md.initialization.pressure");
|
---|
| 228 |
|
---|
[16539] | 229 | }/*}}}*/
|
---|
[18930] | 230 | void EnthalpyAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
|
---|
[16539] | 231 |
|
---|
[18930] | 232 | int numoutputs;
|
---|
| 233 | char** requestedoutputs = NULL;
|
---|
| 234 |
|
---|
[20690] | 235 | parameters->AddObject(iomodel->CopyConstantObject("md.thermal.stabilization",ThermalStabilizationEnum));
|
---|
| 236 | parameters->AddObject(iomodel->CopyConstantObject("md.thermal.maxiter",ThermalMaxiterEnum));
|
---|
| 237 | parameters->AddObject(iomodel->CopyConstantObject("md.thermal.reltol",ThermalReltolEnum));
|
---|
| 238 | parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isenthalpy",ThermalIsenthalpyEnum));
|
---|
| 239 | parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isdynamicbasalspc",ThermalIsdynamicbasalspcEnum));
|
---|
| 240 | parameters->AddObject(iomodel->CopyConstantObject("md.friction.law",FrictionLawEnum));
|
---|
[18930] | 241 |
|
---|
[20690] | 242 | iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.thermal.requested_outputs");
|
---|
[18930] | 243 | parameters->AddObject(new IntParam(ThermalNumRequestedOutputsEnum,numoutputs));
|
---|
| 244 | if(numoutputs)parameters->AddObject(new StringArrayParam(ThermalRequestedOutputsEnum,requestedoutputs,numoutputs));
|
---|
[20690] | 245 | iomodel->DeleteData(&requestedoutputs,numoutputs,"md.thermal.requested_outputs");
|
---|
[18930] | 246 |
|
---|
| 247 | /*Deal with friction parameters*/
|
---|
| 248 | int frictionlaw;
|
---|
[20690] | 249 | iomodel->FindConstant(&frictionlaw,"md.friction.law");
|
---|
[21776] | 250 | if(frictionlaw==4 || frictionlaw==6){
|
---|
| 251 | parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
|
---|
| 252 | }
|
---|
| 253 | if(frictionlaw==3 || frictionlaw==1){
|
---|
| 254 | parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
|
---|
| 255 | }
|
---|
| 256 | if(frictionlaw==9){
|
---|
| 257 | parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
|
---|
[21778] | 258 | parameters->AddObject(new IntParam(FrictionCouplingEnum,0));
|
---|
[21776] | 259 | }
|
---|
[16539] | 260 | }/*}}}*/
|
---|
| 261 |
|
---|
[18930] | 262 | /*Finite Element Analysis*/
|
---|
| 263 | void EnthalpyAnalysis::ApplyBasalConstraints(IssmDouble* serial_spc,Element* element){/*{{{*/
|
---|
[16539] | 264 |
|
---|
[21481] | 265 | /* Do not check if ice in element, this may lead to inconsistencies between cpu partitions */
|
---|
[20213] | 266 | /* Only update constraints at the base. */
|
---|
| 267 | if(!(element->IsOnBase())) return;
|
---|
[16539] | 268 |
|
---|
[18930] | 269 | /*Intermediary*/
|
---|
| 270 | bool isdynamicbasalspc;
|
---|
| 271 | int numindices;
|
---|
| 272 | int *indices = NULL;
|
---|
| 273 | Node* node = NULL;
|
---|
| 274 | IssmDouble pressure;
|
---|
[16539] | 275 |
|
---|
[18930] | 276 | /*Check wether dynamic basal boundary conditions are activated */
|
---|
| 277 | element->FindParam(&isdynamicbasalspc,ThermalIsdynamicbasalspcEnum);
|
---|
| 278 | if(!isdynamicbasalspc) return;
|
---|
[16539] | 279 |
|
---|
[18930] | 280 | /*Get parameters and inputs: */
|
---|
| 281 | Input* pressure_input = element->GetInput(PressureEnum); _assert_(pressure_input);
|
---|
[16539] | 282 |
|
---|
[18930] | 283 | /*Fetch indices of basal & surface nodes for this finite element*/
|
---|
| 284 | Penta *penta = (Penta *) element; // TODO: add Basal-/SurfaceNodeIndices to element.h, and change this to Element*
|
---|
| 285 | penta->BasalNodeIndices(&numindices,&indices,element->GetElementType());
|
---|
[16539] | 286 |
|
---|
[18930] | 287 | GaussPenta* gauss=new GaussPenta();
|
---|
| 288 | for(int i=0;i<numindices;i++){
|
---|
| 289 | gauss->GaussNode(element->GetElementType(),indices[i]);
|
---|
[16539] | 290 |
|
---|
[18930] | 291 | pressure_input->GetInputValue(&pressure,gauss);
|
---|
[16539] | 292 |
|
---|
[18930] | 293 | /*apply or release spc*/
|
---|
| 294 | node=element->GetNode(indices[i]);
|
---|
[21481] | 295 | if(!node->IsActive()) continue;
|
---|
[18930] | 296 | if(serial_spc[node->Sid()]==1.){
|
---|
| 297 | pressure_input->GetInputValue(&pressure, gauss);
|
---|
| 298 | node->ApplyConstraint(0,PureIceEnthalpy(element,pressure));
|
---|
[16539] | 299 | }
|
---|
[21481] | 300 | else {
|
---|
[18930] | 301 | node->DofInFSet(0);
|
---|
[21481] | 302 | }
|
---|
[16539] | 303 | }
|
---|
| 304 |
|
---|
[18930] | 305 | /*Free ressources:*/
|
---|
| 306 | xDelete<int>(indices);
|
---|
| 307 | delete gauss;
|
---|
| 308 | }/*}}}*/
|
---|
| 309 | void EnthalpyAnalysis::ComputeBasalMeltingrate(FemModel* femmodel){/*{{{*/
|
---|
| 310 | /*Compute basal melting rates: */
|
---|
| 311 | for(int i=0;i<femmodel->elements->Size();i++){
|
---|
| 312 | Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 313 | ComputeBasalMeltingrate(element);
|
---|
| 314 | }
|
---|
[21895] | 315 |
|
---|
| 316 | /*extrude inputs*/
|
---|
[21894] | 317 | femmodel->parameters->SetParam(BasalforcingsGroundediceMeltingRateEnum,InputToExtrudeEnum);
|
---|
| 318 | extrudefrombase_core(femmodel);
|
---|
[18930] | 319 | }/*}}}*/
|
---|
| 320 | void EnthalpyAnalysis::ComputeBasalMeltingrate(Element* element){/*{{{*/
|
---|
| 321 | /*Calculate the basal melt rates of the enthalpy model after Aschwanden 2012*/
|
---|
| 322 | /* melting rate is positive when melting, negative when refreezing*/
|
---|
[16539] | 323 |
|
---|
[18930] | 324 | /* Check if ice in element */
|
---|
| 325 | if(!element->IsIceInElement()) return;
|
---|
[16539] | 326 |
|
---|
[18930] | 327 | /* Only compute melt rates at the base of grounded ice*/
|
---|
| 328 | if(!element->IsOnBase() || element->IsFloating()) return;
|
---|
[16539] | 329 |
|
---|
[18930] | 330 | /* Intermediaries */
|
---|
| 331 | bool converged;
|
---|
| 332 | const int dim=3;
|
---|
| 333 | int i,is,state;
|
---|
[21718] | 334 | int nodedown,nodeup,numnodes,numsegments;
|
---|
[18930] | 335 | int enthalpy_enum;
|
---|
| 336 | IssmDouble vec_heatflux[dim],normal_base[dim],d1enthalpy[dim],d1pressure[dim];
|
---|
| 337 | IssmDouble basalfriction,alpha2,geothermalflux,heatflux;
|
---|
| 338 | IssmDouble dt,yts;
|
---|
| 339 | IssmDouble melting_overshoot,lambda;
|
---|
| 340 | IssmDouble vx,vy,vz;
|
---|
| 341 | IssmDouble *xyz_list = NULL;
|
---|
| 342 | IssmDouble *xyz_list_base = NULL;
|
---|
| 343 | int *pairindices = NULL;
|
---|
[16539] | 344 |
|
---|
[18930] | 345 | /*Fetch parameters*/
|
---|
| 346 | element->GetVerticesCoordinates(&xyz_list);
|
---|
| 347 | element->GetVerticesCoordinatesBase(&xyz_list_base);
|
---|
| 348 | element->GetInputValue(&converged,ConvergedEnum);
|
---|
| 349 | element->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 350 | element->FindParam(&yts, ConstantsYtsEnum);
|
---|
| 351 |
|
---|
| 352 | if(dt==0. && !converged) enthalpy_enum=EnthalpyPicardEnum;
|
---|
| 353 | else enthalpy_enum=EnthalpyEnum;
|
---|
| 354 |
|
---|
| 355 | IssmDouble latentheat = element->GetMaterialParameter(MaterialsLatentheatEnum);
|
---|
| 356 | IssmDouble rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
|
---|
| 357 | IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
|
---|
| 358 | IssmDouble beta = element->GetMaterialParameter(MaterialsBetaEnum);
|
---|
| 359 | IssmDouble kappa = EnthalpyDiffusionParameterVolume(element,enthalpy_enum); _assert_(kappa>=0.);
|
---|
| 360 | IssmDouble kappa_mix;
|
---|
| 361 |
|
---|
| 362 | /*retrieve inputs*/
|
---|
| 363 | Input* enthalpy_input = element->GetInput(enthalpy_enum); _assert_(enthalpy_input);
|
---|
| 364 | Input* pressure_input = element->GetInput(PressureEnum); _assert_(pressure_input);
|
---|
| 365 | Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
|
---|
| 366 | Input* vx_input = element->GetInput(VxEnum); _assert_(vx_input);
|
---|
| 367 | Input* vy_input = element->GetInput(VyEnum); _assert_(vy_input);
|
---|
| 368 | Input* vz_input = element->GetInput(VzEnum); _assert_(vz_input);
|
---|
| 369 |
|
---|
| 370 | /*Build friction element, needed later: */
|
---|
| 371 | Friction* friction=new Friction(element,dim);
|
---|
| 372 |
|
---|
| 373 | /******** MELTING RATES ************************************//*{{{*/
|
---|
| 374 | element->NormalBase(&normal_base[0],xyz_list_base);
|
---|
[21718] | 375 | element->VerticalSegmentIndicesBase(&pairindices,&numsegments);
|
---|
[18930] | 376 | IssmDouble* meltingrate_enthalpy = xNew<IssmDouble>(numsegments);
|
---|
| 377 | IssmDouble* heating = xNew<IssmDouble>(numsegments);
|
---|
| 378 |
|
---|
[21718] | 379 | numnodes=element->GetNumberOfNodes();
|
---|
| 380 | IssmDouble* enthalpies = xNew<IssmDouble>(numnodes);
|
---|
| 381 | IssmDouble* pressures = xNew<IssmDouble>(numnodes);
|
---|
| 382 | IssmDouble* watercolumns = xNew<IssmDouble>(numnodes);
|
---|
| 383 | IssmDouble* basalmeltingrates = xNew<IssmDouble>(numnodes);
|
---|
| 384 | element->GetInputListOnNodes(enthalpies,enthalpy_enum);
|
---|
| 385 | element->GetInputListOnNodes(pressures,PressureEnum);
|
---|
| 386 | element->GetInputListOnNodes(watercolumns,WatercolumnEnum);
|
---|
| 387 | element->GetInputListOnNodes(basalmeltingrates,BasalforcingsGroundediceMeltingRateEnum);
|
---|
[18930] | 388 |
|
---|
| 389 | Gauss* gauss=element->NewGauss();
|
---|
| 390 | for(is=0;is<numsegments;is++){
|
---|
[21718] | 391 | nodedown = pairindices[is*2+0];
|
---|
| 392 | nodeup = pairindices[is*2+1];
|
---|
| 393 | gauss->GaussNode(element->GetElementType(),nodedown);
|
---|
[18930] | 394 |
|
---|
[21718] | 395 | state=GetThermalBasalCondition(element, enthalpies[nodedown], enthalpies[nodeup], pressures[nodedown], pressures[nodeup], watercolumns[nodedown], basalmeltingrates[nodedown]);
|
---|
[18930] | 396 | switch (state) {
|
---|
| 397 | case 0:
|
---|
| 398 | // cold, dry base: apply basal surface forcing
|
---|
| 399 | for(i=0;i<3;i++) vec_heatflux[i]=0.;
|
---|
| 400 | break;
|
---|
| 401 | case 1: case 2: case 3:
|
---|
| 402 | // case 1 : cold, wet base: keep at pressure melting point
|
---|
| 403 | // case 2: temperate, thin refreezing base: release spc
|
---|
| 404 | // case 3: temperate, thin melting base: set spc
|
---|
| 405 | enthalpy_input->GetInputDerivativeValue(&d1enthalpy[0],xyz_list,gauss);
|
---|
| 406 | for(i=0;i<3;i++) vec_heatflux[i]=-kappa*d1enthalpy[i];
|
---|
| 407 | break;
|
---|
| 408 | case 4:
|
---|
| 409 | // temperate, thick melting base: set grad H*n=0
|
---|
[21718] | 410 | kappa_mix=GetWetIceConductivity(element, enthalpies[nodedown], pressures[nodedown]);
|
---|
[18930] | 411 | pressure_input->GetInputDerivativeValue(&d1pressure[0],xyz_list,gauss);
|
---|
| 412 | for(i=0;i<3;i++) vec_heatflux[i]=kappa_mix*beta*d1pressure[i];
|
---|
| 413 | break;
|
---|
| 414 | default:
|
---|
| 415 | _printf0_(" unknown thermal basal state found!");
|
---|
| 416 | }
|
---|
| 417 | if(state==0) meltingrate_enthalpy[is]=0.;
|
---|
| 418 | else{
|
---|
| 419 | /*heat flux along normal*/
|
---|
| 420 | heatflux=0.;
|
---|
| 421 | for(i=0;i<3;i++) heatflux+=(vec_heatflux[i])*normal_base[i];
|
---|
| 422 |
|
---|
| 423 | /*basal friction*/
|
---|
| 424 | friction->GetAlpha2(&alpha2,gauss);
|
---|
| 425 | vx_input->GetInputValue(&vx,gauss); vy_input->GetInputValue(&vy,gauss); vz_input->GetInputValue(&vz,gauss);
|
---|
| 426 | basalfriction=alpha2*(vx*vx + vy*vy + vz*vz);
|
---|
| 427 | geothermalflux_input->GetInputValue(&geothermalflux,gauss);
|
---|
| 428 | /* -Mb= Fb-(q-q_geo)/((1-w)*L*rho), and (1-w)*rho=rho_ice, cf Aschwanden 2012, eqs.1, 2, 66*/
|
---|
| 429 | heating[is]=(heatflux+basalfriction+geothermalflux);
|
---|
| 430 | meltingrate_enthalpy[is]=heating[is]/(latentheat*rho_ice); // m/s water equivalent
|
---|
| 431 | }
|
---|
| 432 | }/*}}}*/
|
---|
| 433 |
|
---|
| 434 | /******** UPDATE MELTINGRATES AND WATERCOLUMN **************//*{{{*/
|
---|
| 435 | for(is=0;is<numsegments;is++){
|
---|
[21718] | 436 | nodedown = pairindices[is*2+0];
|
---|
| 437 | nodeup = pairindices[is*2+1];
|
---|
[18930] | 438 | if(dt!=0.){
|
---|
[21718] | 439 | if(watercolumns[nodedown]+meltingrate_enthalpy[is]*dt<0.){ // prevent too much freeze on
|
---|
| 440 | lambda = -watercolumns[nodedown]/(dt*meltingrate_enthalpy[is]); _assert_(lambda>=0.); _assert_(lambda<1.);
|
---|
| 441 | watercolumns[nodedown]=0.;
|
---|
| 442 | basalmeltingrates[nodedown]=lambda*meltingrate_enthalpy[is]; // restrict freeze on only to size of watercolumn
|
---|
| 443 | enthalpies[nodedown]+=(1.-lambda)*dt/yts*meltingrate_enthalpy[is]*latentheat*rho_ice; // use rest of energy to cool down base: dE=L*m, m=(1-lambda)*meltingrate*rho_ice
|
---|
[16539] | 444 | }
|
---|
[18930] | 445 | else{
|
---|
[21718] | 446 | basalmeltingrates[nodedown]=meltingrate_enthalpy[is];
|
---|
| 447 | watercolumns[nodedown]+=dt*meltingrate_enthalpy[is];
|
---|
[18930] | 448 | }
|
---|
[16539] | 449 | }
|
---|
[18930] | 450 | else{
|
---|
[21718] | 451 | basalmeltingrates[nodedown]=meltingrate_enthalpy[is];
|
---|
| 452 | if(watercolumns[nodedown]+meltingrate_enthalpy[is]<0.)
|
---|
| 453 | watercolumns[nodedown]=0.;
|
---|
[18930] | 454 | else
|
---|
[21718] | 455 | watercolumns[nodedown]+=meltingrate_enthalpy[is];
|
---|
[18930] | 456 | }
|
---|
[21718] | 457 | basalmeltingrates[nodedown]*=rho_water/rho_ice; // convert meltingrate from water to ice equivalent
|
---|
| 458 | _assert_(watercolumns[nodedown]>=0.);
|
---|
[18930] | 459 | }/*}}}*/
|
---|
| 460 |
|
---|
| 461 | /*feed updated variables back into model*/
|
---|
| 462 | if(dt!=0.){
|
---|
[21718] | 463 | element->AddInput(enthalpy_enum,enthalpies,element->GetElementType());
|
---|
| 464 | element->AddInput(WatercolumnEnum,watercolumns,element->GetElementType());
|
---|
[16539] | 465 | }
|
---|
[21718] | 466 | element->AddInput(BasalforcingsGroundediceMeltingRateEnum,basalmeltingrates,element->GetElementType());
|
---|
[16539] | 467 |
|
---|
[18930] | 468 | /*Clean up and return*/
|
---|
| 469 | delete gauss;
|
---|
| 470 | delete friction;
|
---|
| 471 | xDelete<int>(pairindices);
|
---|
| 472 | xDelete<IssmDouble>(enthalpies);
|
---|
| 473 | xDelete<IssmDouble>(pressures);
|
---|
| 474 | xDelete<IssmDouble>(watercolumns);
|
---|
| 475 | xDelete<IssmDouble>(basalmeltingrates);
|
---|
| 476 | xDelete<IssmDouble>(meltingrate_enthalpy);
|
---|
| 477 | xDelete<IssmDouble>(heating);
|
---|
| 478 | xDelete<IssmDouble>(xyz_list);
|
---|
| 479 | xDelete<IssmDouble>(xyz_list_base);
|
---|
[16539] | 480 | }/*}}}*/
|
---|
[18930] | 481 | void EnthalpyAnalysis::Core(FemModel* femmodel){/*{{{*/
|
---|
[21160] | 482 |
|
---|
| 483 | IssmDouble dt;
|
---|
| 484 | bool isdynamicbasalspc;
|
---|
| 485 |
|
---|
| 486 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 487 | femmodel->parameters->FindParam(&isdynamicbasalspc,ThermalIsdynamicbasalspcEnum);
|
---|
| 488 |
|
---|
[18591] | 489 | if(VerboseSolution()) _printf0_(" computing enthalpy\n");
|
---|
| 490 | femmodel->SetCurrentConfiguration(EnthalpyAnalysisEnum);
|
---|
[21160] | 491 | if((dt>0.) && isdynamicbasalspc) UpdateBasalConstraints(femmodel);
|
---|
[18591] | 492 | solutionsequence_thermal_nonlinear(femmodel);
|
---|
| 493 |
|
---|
| 494 | /*transfer enthalpy to enthalpy picard for the next step: */
|
---|
| 495 | InputDuplicatex(femmodel,EnthalpyEnum,EnthalpyPicardEnum);
|
---|
| 496 |
|
---|
[21161] | 497 | PostProcessing(femmodel);
|
---|
[18591] | 498 |
|
---|
[17005] | 499 | }/*}}}*/
|
---|
[17000] | 500 | ElementVector* EnthalpyAnalysis::CreateDVector(Element* element){/*{{{*/
|
---|
| 501 | /*Default, return NULL*/
|
---|
| 502 | return NULL;
|
---|
| 503 | }/*}}}*/
|
---|
[16992] | 504 | ElementMatrix* EnthalpyAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
|
---|
| 505 | _error_("Not implemented");
|
---|
| 506 | }/*}}}*/
|
---|
[16782] | 507 | ElementMatrix* EnthalpyAnalysis::CreateKMatrix(Element* element){/*{{{*/
|
---|
[16888] | 508 |
|
---|
[17434] | 509 | /* Check if ice in element */
|
---|
| 510 | if(!element->IsIceInElement()) return NULL;
|
---|
| 511 |
|
---|
[16888] | 512 | /*compute all stiffness matrices for this element*/
|
---|
| 513 | ElementMatrix* Ke1=CreateKMatrixVolume(element);
|
---|
| 514 | ElementMatrix* Ke2=CreateKMatrixShelf(element);
|
---|
| 515 | ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
|
---|
| 516 |
|
---|
| 517 | /*clean-up and return*/
|
---|
| 518 | delete Ke1;
|
---|
| 519 | delete Ke2;
|
---|
| 520 | return Ke;
|
---|
[16782] | 521 | }/*}}}*/
|
---|
[16888] | 522 | ElementMatrix* EnthalpyAnalysis::CreateKMatrixVolume(Element* element){/*{{{*/
|
---|
| 523 |
|
---|
[17434] | 524 | /* Check if ice in element */
|
---|
| 525 | if(!element->IsIceInElement()) return NULL;
|
---|
| 526 |
|
---|
[16888] | 527 | /*Intermediaries */
|
---|
| 528 | int stabilization;
|
---|
| 529 | IssmDouble Jdet,dt,u,v,w,um,vm,wm,vel;
|
---|
| 530 | IssmDouble h,hx,hy,hz,vx,vy,vz;
|
---|
| 531 | IssmDouble tau_parameter,diameter;
|
---|
| 532 | IssmDouble D_scalar;
|
---|
| 533 | IssmDouble* xyz_list = NULL;
|
---|
| 534 |
|
---|
| 535 | /*Fetch number of nodes and dof for this finite element*/
|
---|
| 536 | int numnodes = element->GetNumberOfNodes();
|
---|
| 537 |
|
---|
| 538 | /*Initialize Element vector and other vectors*/
|
---|
| 539 | ElementMatrix* Ke = element->NewElementMatrix();
|
---|
| 540 | IssmDouble* basis = xNew<IssmDouble>(numnodes);
|
---|
| 541 | IssmDouble* dbasis = xNew<IssmDouble>(3*numnodes);
|
---|
| 542 | IssmDouble* B = xNew<IssmDouble>(3*numnodes);
|
---|
| 543 | IssmDouble* Bprime = xNew<IssmDouble>(3*numnodes);
|
---|
| 544 | IssmDouble D[3][3] = {0.};
|
---|
| 545 | IssmDouble K[3][3];
|
---|
| 546 |
|
---|
| 547 | /*Retrieve all inputs and parameters*/
|
---|
| 548 | element->GetVerticesCoordinates(&xyz_list);
|
---|
| 549 | element->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 550 | element->FindParam(&stabilization,ThermalStabilizationEnum);
|
---|
[17946] | 551 | IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
|
---|
[16888] | 552 | IssmDouble rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
|
---|
| 553 | IssmDouble gravity = element->GetMaterialParameter(ConstantsGEnum);
|
---|
| 554 | IssmDouble heatcapacity = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
|
---|
| 555 | IssmDouble thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
|
---|
| 556 | Input* vx_input = element->GetInput(VxEnum); _assert_(vx_input);
|
---|
| 557 | Input* vy_input = element->GetInput(VyEnum); _assert_(vy_input);
|
---|
| 558 | Input* vz_input = element->GetInput(VzEnum); _assert_(vz_input);
|
---|
| 559 | Input* vxm_input = element->GetInput(VxMeshEnum); _assert_(vxm_input);
|
---|
| 560 | Input* vym_input = element->GetInput(VyMeshEnum); _assert_(vym_input);
|
---|
| 561 | Input* vzm_input = element->GetInput(VzMeshEnum); _assert_(vzm_input);
|
---|
| 562 | if(stabilization==2) diameter=element->MinEdgeLength(xyz_list);
|
---|
| 563 |
|
---|
| 564 | /*Enthalpy diffusion parameter*/
|
---|
[17027] | 565 | IssmDouble kappa=this->EnthalpyDiffusionParameterVolume(element,EnthalpyPicardEnum); _assert_(kappa>=0.);
|
---|
[16888] | 566 |
|
---|
| 567 | /* Start looping on the number of gaussian points: */
|
---|
[19637] | 568 | Gauss* gauss=element->NewGauss(4);
|
---|
[16888] | 569 | for(int ig=gauss->begin();ig<gauss->end();ig++){
|
---|
| 570 | gauss->GaussPoint(ig);
|
---|
| 571 |
|
---|
| 572 | element->JacobianDeterminant(&Jdet,xyz_list,gauss);
|
---|
| 573 | D_scalar=gauss->weight*Jdet;
|
---|
| 574 | if(dt!=0.) D_scalar=D_scalar*dt;
|
---|
| 575 |
|
---|
| 576 | /*Conduction: */
|
---|
| 577 | GetBConduct(B,element,xyz_list,gauss);
|
---|
| 578 | D[0][0]=D_scalar*kappa/rho_ice;
|
---|
| 579 | D[1][1]=D_scalar*kappa/rho_ice;
|
---|
| 580 | D[2][2]=D_scalar*kappa/rho_ice;
|
---|
| 581 | TripleMultiply(B,3,numnodes,1,
|
---|
| 582 | &D[0][0],3,3,0,
|
---|
| 583 | B,3,numnodes,0,
|
---|
| 584 | &Ke->values[0],1);
|
---|
| 585 |
|
---|
| 586 | /*Advection: */
|
---|
| 587 | GetBAdvec(B,element,xyz_list,gauss);
|
---|
| 588 | GetBAdvecprime(Bprime,element,xyz_list,gauss);
|
---|
| 589 | vx_input->GetInputValue(&u,gauss); vxm_input->GetInputValue(&um,gauss); vx=u-um;
|
---|
| 590 | vy_input->GetInputValue(&v,gauss); vym_input->GetInputValue(&vm,gauss); vy=v-vm;
|
---|
| 591 | vz_input->GetInputValue(&w,gauss); vzm_input->GetInputValue(&wm,gauss); vz=w-wm;
|
---|
| 592 | D[0][0]=D_scalar*vx;
|
---|
| 593 | D[1][1]=D_scalar*vy;
|
---|
| 594 | D[2][2]=D_scalar*vz;
|
---|
| 595 | TripleMultiply(B,3,numnodes,1,
|
---|
| 596 | &D[0][0],3,3,0,
|
---|
| 597 | Bprime,3,numnodes,0,
|
---|
| 598 | &Ke->values[0],1);
|
---|
| 599 |
|
---|
| 600 | /*Transient: */
|
---|
| 601 | if(dt!=0.){
|
---|
| 602 | D_scalar=gauss->weight*Jdet;
|
---|
| 603 | element->NodalFunctions(basis,gauss);
|
---|
| 604 | TripleMultiply(basis,numnodes,1,0,
|
---|
| 605 | &D_scalar,1,1,0,
|
---|
| 606 | basis,1,numnodes,0,
|
---|
| 607 | &Ke->values[0],1);
|
---|
| 608 | D_scalar=D_scalar*dt;
|
---|
| 609 | }
|
---|
| 610 |
|
---|
[21382] | 611 | /*Artificial diffusivity*/
|
---|
[16888] | 612 | if(stabilization==1){
|
---|
| 613 | element->ElementSizes(&hx,&hy,&hz);
|
---|
| 614 | vel=sqrt(vx*vx + vy*vy + vz*vz)+1.e-14;
|
---|
| 615 | h=sqrt( pow(hx*vx/vel,2) + pow(hy*vy/vel,2) + pow(hz*vz/vel,2));
|
---|
[18484] | 616 | K[0][0]=h/(2.*vel)*fabs(vx*vx); K[0][1]=h/(2.*vel)*fabs(vx*vy); K[0][2]=h/(2.*vel)*fabs(vx*vz);
|
---|
| 617 | K[1][0]=h/(2.*vel)*fabs(vy*vx); K[1][1]=h/(2.*vel)*fabs(vy*vy); K[1][2]=h/(2.*vel)*fabs(vy*vz);
|
---|
| 618 | K[2][0]=h/(2.*vel)*fabs(vz*vx); K[2][1]=h/(2.*vel)*fabs(vz*vy); K[2][2]=h/(2.*vel)*fabs(vz*vz);
|
---|
[16888] | 619 | for(int i=0;i<3;i++) for(int j=0;j<3;j++) K[i][j] = D_scalar*K[i][j];
|
---|
| 620 |
|
---|
| 621 | GetBAdvecprime(Bprime,element,xyz_list,gauss);
|
---|
| 622 | TripleMultiply(Bprime,3,numnodes,1,
|
---|
| 623 | &K[0][0],3,3,0,
|
---|
| 624 | Bprime,3,numnodes,0,
|
---|
| 625 | &Ke->values[0],1);
|
---|
| 626 | }
|
---|
| 627 | else if(stabilization==2){
|
---|
| 628 | element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
|
---|
| 629 | tau_parameter=element->StabilizationParameter(u-um,v-vm,w-wm,diameter,kappa/rho_ice);
|
---|
| 630 | for(int i=0;i<numnodes;i++){
|
---|
| 631 | for(int j=0;j<numnodes;j++){
|
---|
| 632 | Ke->values[i*numnodes+j]+=tau_parameter*D_scalar*
|
---|
[16895] | 633 | ((u-um)*dbasis[0*numnodes+i]+(v-vm)*dbasis[1*numnodes+i]+(w-wm)*dbasis[2*numnodes+i])*((u-um)*dbasis[0*numnodes+j]+(v-vm)*dbasis[1*numnodes+j]+(w-wm)*dbasis[2*numnodes+j]);
|
---|
[16888] | 634 | }
|
---|
| 635 | }
|
---|
| 636 | if(dt!=0.){
|
---|
[16896] | 637 | D_scalar=gauss->weight*Jdet;
|
---|
[16888] | 638 | for(int i=0;i<numnodes;i++){
|
---|
| 639 | for(int j=0;j<numnodes;j++){
|
---|
[16895] | 640 | Ke->values[i*numnodes+j]+=tau_parameter*D_scalar*basis[j]*((u-um)*dbasis[0*numnodes+i]+(v-vm)*dbasis[1*numnodes+i]+(w-wm)*dbasis[2*numnodes+i]);
|
---|
[16888] | 641 | }
|
---|
| 642 | }
|
---|
| 643 | }
|
---|
| 644 | }
|
---|
| 645 | }
|
---|
| 646 |
|
---|
| 647 | /*Clean up and return*/
|
---|
| 648 | xDelete<IssmDouble>(xyz_list);
|
---|
| 649 | xDelete<IssmDouble>(basis);
|
---|
| 650 | xDelete<IssmDouble>(dbasis);
|
---|
| 651 | xDelete<IssmDouble>(B);
|
---|
| 652 | xDelete<IssmDouble>(Bprime);
|
---|
| 653 | delete gauss;
|
---|
| 654 | return Ke;
|
---|
| 655 | }/*}}}*/
|
---|
| 656 | ElementMatrix* EnthalpyAnalysis::CreateKMatrixShelf(Element* element){/*{{{*/
|
---|
| 657 |
|
---|
[17434] | 658 | /* Check if ice in element */
|
---|
| 659 | if(!element->IsIceInElement()) return NULL;
|
---|
| 660 |
|
---|
[16888] | 661 | /*Initialize Element matrix and return if necessary*/
|
---|
[17585] | 662 | if(!element->IsOnBase() || !element->IsFloating()) return NULL;
|
---|
[16888] | 663 |
|
---|
[16986] | 664 | /*Intermediaries*/
|
---|
[16888] | 665 | IssmDouble dt,Jdet,D;
|
---|
| 666 | IssmDouble *xyz_list_base = NULL;
|
---|
| 667 |
|
---|
| 668 | /*Fetch number of nodes for this finite element*/
|
---|
| 669 | int numnodes = element->GetNumberOfNodes();
|
---|
| 670 |
|
---|
| 671 | /*Initialize vectors*/
|
---|
| 672 | ElementMatrix* Ke = element->NewElementMatrix();
|
---|
| 673 | IssmDouble* basis = xNew<IssmDouble>(numnodes);
|
---|
| 674 |
|
---|
| 675 | /*Retrieve all inputs and parameters*/
|
---|
| 676 | element->GetVerticesCoordinatesBase(&xyz_list_base);
|
---|
| 677 | element->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 678 | IssmDouble gravity = element->GetMaterialParameter(ConstantsGEnum);
|
---|
[17946] | 679 | IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
|
---|
[16888] | 680 | IssmDouble rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
|
---|
| 681 | IssmDouble heatcapacity = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
|
---|
| 682 | IssmDouble mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
|
---|
| 683 | IssmDouble thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
|
---|
| 684 |
|
---|
| 685 | /* Start looping on the number of gaussian points: */
|
---|
[19637] | 686 | Gauss* gauss=element->NewGaussBase(4);
|
---|
[16888] | 687 | for(int ig=gauss->begin();ig<gauss->end();ig++){
|
---|
| 688 | gauss->GaussPoint(ig);
|
---|
| 689 |
|
---|
| 690 | element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
|
---|
| 691 | element->NodalFunctions(basis,gauss);
|
---|
| 692 |
|
---|
| 693 | D=gauss->weight*Jdet*rho_water*mixed_layer_capacity*thermal_exchange_vel/(heatcapacity*rho_ice);
|
---|
| 694 | if(reCast<bool,IssmDouble>(dt)) D=dt*D;
|
---|
| 695 | TripleMultiply(basis,numnodes,1,0,
|
---|
| 696 | &D,1,1,0,
|
---|
| 697 | basis,1,numnodes,0,
|
---|
| 698 | &Ke->values[0],1);
|
---|
| 699 |
|
---|
| 700 | }
|
---|
| 701 |
|
---|
| 702 | /*Clean up and return*/
|
---|
| 703 | delete gauss;
|
---|
| 704 | xDelete<IssmDouble>(basis);
|
---|
| 705 | xDelete<IssmDouble>(xyz_list_base);
|
---|
| 706 | return Ke;
|
---|
| 707 | }/*}}}*/
|
---|
[16782] | 708 | ElementVector* EnthalpyAnalysis::CreatePVector(Element* element){/*{{{*/
|
---|
[16812] | 709 |
|
---|
[17434] | 710 | /* Check if ice in element */
|
---|
| 711 | if(!element->IsIceInElement()) return NULL;
|
---|
| 712 |
|
---|
[16812] | 713 | /*compute all load vectors for this element*/
|
---|
| 714 | ElementVector* pe1=CreatePVectorVolume(element);
|
---|
| 715 | ElementVector* pe2=CreatePVectorSheet(element);
|
---|
| 716 | ElementVector* pe3=CreatePVectorShelf(element);
|
---|
| 717 | ElementVector* pe =new ElementVector(pe1,pe2,pe3);
|
---|
| 718 |
|
---|
| 719 | /*clean-up and return*/
|
---|
| 720 | delete pe1;
|
---|
| 721 | delete pe2;
|
---|
| 722 | delete pe3;
|
---|
| 723 | return pe;
|
---|
[16782] | 724 | }/*}}}*/
|
---|
[16812] | 725 | ElementVector* EnthalpyAnalysis::CreatePVectorVolume(Element* element){/*{{{*/
|
---|
| 726 |
|
---|
[17434] | 727 | /* Check if ice in element */
|
---|
| 728 | if(!element->IsIceInElement()) return NULL;
|
---|
| 729 |
|
---|
[16812] | 730 | /*Intermediaries*/
|
---|
[17014] | 731 | int i, stabilization;
|
---|
[16812] | 732 | IssmDouble Jdet,phi,dt;
|
---|
[17014] | 733 | IssmDouble enthalpy, Hpmp;
|
---|
| 734 | IssmDouble enthalpypicard, d1enthalpypicard[3];
|
---|
| 735 | IssmDouble pressure, d1pressure[3], d2pressure;
|
---|
| 736 | IssmDouble waterfractionpicard;
|
---|
| 737 | IssmDouble kappa,tau_parameter,diameter,kappa_w;
|
---|
[16812] | 738 | IssmDouble u,v,w;
|
---|
[17014] | 739 | IssmDouble scalar_def, scalar_sens ,scalar_transient;
|
---|
[16812] | 740 | IssmDouble* xyz_list = NULL;
|
---|
[17014] | 741 | IssmDouble d1H_d1P, d1P2;
|
---|
[16812] | 742 |
|
---|
| 743 | /*Fetch number of nodes and dof for this finite element*/
|
---|
| 744 | int numnodes = element->GetNumberOfNodes();
|
---|
| 745 | int numvertices = element->GetNumberOfVertices();
|
---|
| 746 |
|
---|
| 747 | /*Initialize Element vector*/
|
---|
| 748 | ElementVector* pe = element->NewElementVector();
|
---|
| 749 | IssmDouble* basis = xNew<IssmDouble>(numnodes);
|
---|
| 750 | IssmDouble* dbasis = xNew<IssmDouble>(3*numnodes);
|
---|
| 751 |
|
---|
| 752 | /*Retrieve all inputs and parameters*/
|
---|
| 753 | element->GetVerticesCoordinates(&xyz_list);
|
---|
| 754 | IssmDouble rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
|
---|
[17014] | 755 | IssmDouble heatcapacity = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
|
---|
[16812] | 756 | IssmDouble thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
|
---|
[17014] | 757 | IssmDouble temperateiceconductivity = element->GetMaterialParameter(MaterialsTemperateiceconductivityEnum);
|
---|
| 758 | IssmDouble beta = element->GetMaterialParameter(MaterialsBetaEnum);
|
---|
| 759 | IssmDouble latentheat = element->GetMaterialParameter(MaterialsLatentheatEnum);
|
---|
[16812] | 760 | element->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 761 | element->FindParam(&stabilization,ThermalStabilizationEnum);
|
---|
| 762 | Input* vx_input=element->GetInput(VxEnum); _assert_(vx_input);
|
---|
| 763 | Input* vy_input=element->GetInput(VyEnum); _assert_(vy_input);
|
---|
| 764 | Input* vz_input=element->GetInput(VzEnum); _assert_(vz_input);
|
---|
[17014] | 765 | Input* enthalpypicard_input=element->GetInput(EnthalpyPicardEnum); _assert_(enthalpypicard_input);
|
---|
| 766 | Input* pressure_input=element->GetInput(PressureEnum); _assert_(pressure_input);
|
---|
| 767 | Input* enthalpy_input=NULL;
|
---|
[16812] | 768 | if(reCast<bool,IssmDouble>(dt)){enthalpy_input = element->GetInput(EnthalpyEnum); _assert_(enthalpy_input);}
|
---|
| 769 | if(stabilization==2){
|
---|
| 770 | diameter=element->MinEdgeLength(xyz_list);
|
---|
[17027] | 771 | kappa=this->EnthalpyDiffusionParameterVolume(element,EnthalpyPicardEnum); _assert_(kappa>=0.);
|
---|
[16812] | 772 | }
|
---|
| 773 |
|
---|
| 774 | /* Start looping on the number of gaussian points: */
|
---|
[19637] | 775 | Gauss* gauss=element->NewGauss(4);
|
---|
[16812] | 776 | for(int ig=gauss->begin();ig<gauss->end();ig++){
|
---|
| 777 | gauss->GaussPoint(ig);
|
---|
| 778 |
|
---|
| 779 | element->JacobianDeterminant(&Jdet,xyz_list,gauss);
|
---|
| 780 | element->NodalFunctions(basis,gauss);
|
---|
[17014] | 781 |
|
---|
| 782 | /*viscous dissipation*/
|
---|
[16812] | 783 | element->ViscousHeating(&phi,xyz_list,gauss,vx_input,vy_input,vz_input);
|
---|
| 784 |
|
---|
| 785 | scalar_def=phi/rho_ice*Jdet*gauss->weight;
|
---|
[16895] | 786 | if(dt!=0.) scalar_def=scalar_def*dt;
|
---|
[16812] | 787 |
|
---|
[17014] | 788 | for(i=0;i<numnodes;i++) pe->values[i]+=scalar_def*basis[i];
|
---|
[16812] | 789 |
|
---|
[17014] | 790 | /*sensible heat flux in temperate ice*/
|
---|
| 791 | enthalpypicard_input->GetInputValue(&enthalpypicard,gauss);
|
---|
| 792 | pressure_input->GetInputValue(&pressure,gauss);
|
---|
| 793 | Hpmp=this->PureIceEnthalpy(element, pressure);
|
---|
| 794 |
|
---|
| 795 | if(enthalpypicard>=Hpmp){
|
---|
| 796 | enthalpypicard_input->GetInputDerivativeValue(&d1enthalpypicard[0],xyz_list,gauss);
|
---|
| 797 | pressure_input->GetInputDerivativeValue(&d1pressure[0],xyz_list,gauss);
|
---|
| 798 | d2pressure=0.; // for linear elements, 2nd derivative is zero
|
---|
| 799 |
|
---|
| 800 | d1H_d1P=0.;
|
---|
| 801 | for(i=0;i<3;i++) d1H_d1P+=d1enthalpypicard[i]*d1pressure[i];
|
---|
| 802 | d1P2=0.;
|
---|
| 803 | for(i=0;i<3;i++) d1P2+=pow(d1pressure[i],2.);
|
---|
| 804 |
|
---|
| 805 | scalar_sens=-beta*((temperateiceconductivity - thermalconductivity)/latentheat*(d1H_d1P + beta*heatcapacity*d1P2))/rho_ice;
|
---|
| 806 | if(dt!=0.) scalar_sens=scalar_sens*dt;
|
---|
| 807 | for(i=0;i<numnodes;i++) pe->values[i]+=scalar_sens*basis[i];
|
---|
| 808 | }
|
---|
| 809 |
|
---|
[16812] | 810 | /* Build transient now */
|
---|
| 811 | if(reCast<bool,IssmDouble>(dt)){
|
---|
| 812 | enthalpy_input->GetInputValue(&enthalpy, gauss);
|
---|
| 813 | scalar_transient=enthalpy*Jdet*gauss->weight;
|
---|
[17014] | 814 | for(i=0;i<numnodes;i++) pe->values[i]+=scalar_transient*basis[i];
|
---|
[16812] | 815 | }
|
---|
| 816 |
|
---|
| 817 | if(stabilization==2){
|
---|
| 818 | element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
|
---|
| 819 |
|
---|
| 820 | vx_input->GetInputValue(&u,gauss);
|
---|
| 821 | vy_input->GetInputValue(&v,gauss);
|
---|
| 822 | vz_input->GetInputValue(&w,gauss);
|
---|
[16895] | 823 | tau_parameter=element->StabilizationParameter(u,v,w,diameter,kappa/rho_ice);
|
---|
[16812] | 824 |
|
---|
[17014] | 825 | for(i=0;i<numnodes;i++) pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0*numnodes+i]+v*dbasis[1*numnodes+i]+w*dbasis[2*numnodes+i]);
|
---|
[16895] | 826 |
|
---|
| 827 | if(dt!=0.){
|
---|
[17014] | 828 | for(i=0;i<numnodes;i++) pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0*numnodes+i]+v*dbasis[1*numnodes+i]+w*dbasis[2*numnodes+i]);
|
---|
[16812] | 829 | }
|
---|
| 830 | }
|
---|
| 831 | }
|
---|
| 832 |
|
---|
| 833 | /*Clean up and return*/
|
---|
| 834 | xDelete<IssmDouble>(basis);
|
---|
| 835 | xDelete<IssmDouble>(dbasis);
|
---|
| 836 | xDelete<IssmDouble>(xyz_list);
|
---|
| 837 | delete gauss;
|
---|
| 838 | return pe;
|
---|
| 839 |
|
---|
| 840 | }/*}}}*/
|
---|
| 841 | ElementVector* EnthalpyAnalysis::CreatePVectorSheet(Element* element){/*{{{*/
|
---|
[16888] | 842 |
|
---|
[17434] | 843 | /* Check if ice in element */
|
---|
| 844 | if(!element->IsIceInElement()) return NULL;
|
---|
| 845 |
|
---|
[17014] | 846 | /* implementation of the basal condition decision chart of Aschwanden 2012, Fig.5 */
|
---|
[17585] | 847 | if(!element->IsOnBase() || element->IsFloating()) return NULL;
|
---|
[16888] | 848 |
|
---|
[20272] | 849 | bool converged, isdynamicbasalspc;
|
---|
[18612] | 850 | int i, state;
|
---|
[20272] | 851 | int enthalpy_enum;
|
---|
[18612] | 852 | IssmDouble dt,Jdet,scalar;
|
---|
| 853 | IssmDouble enthalpy, enthalpyup, pressure, pressureup, watercolumn, meltingrate;
|
---|
| 854 | IssmDouble vx,vy,vz;
|
---|
| 855 | IssmDouble alpha2,basalfriction,geothermalflux,heatflux;
|
---|
[16888] | 856 | IssmDouble *xyz_list_base = NULL;
|
---|
| 857 |
|
---|
| 858 | /*Fetch number of nodes for this finite element*/
|
---|
| 859 | int numnodes = element->GetNumberOfNodes();
|
---|
| 860 |
|
---|
| 861 | /*Initialize vectors*/
|
---|
| 862 | ElementVector* pe = element->NewElementVector();
|
---|
| 863 | IssmDouble* basis = xNew<IssmDouble>(numnodes);
|
---|
| 864 |
|
---|
| 865 | /*Retrieve all inputs and parameters*/
|
---|
| 866 | element->GetVerticesCoordinatesBase(&xyz_list_base);
|
---|
| 867 | element->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
[18622] | 868 | element->FindParam(&isdynamicbasalspc,ThermalIsdynamicbasalspcEnum);
|
---|
[20272] | 869 | element->GetInputValue(&converged,ConvergedEnum);
|
---|
| 870 | if(dt==0. && !converged) enthalpy_enum=EnthalpyPicardEnum; // use enthalpy from last iteration
|
---|
| 871 | else enthalpy_enum=EnthalpyEnum; // use enthalpy from last time step
|
---|
[16888] | 872 | Input* vx_input = element->GetInput(VxEnum); _assert_(vx_input);
|
---|
| 873 | Input* vy_input = element->GetInput(VyEnum); _assert_(vy_input);
|
---|
| 874 | Input* vz_input = element->GetInput(VzEnum); _assert_(vz_input);
|
---|
[20272] | 875 | Input* enthalpy_input = element->GetInput(enthalpy_enum); _assert_(enthalpy_input);
|
---|
[18612] | 876 | Input* pressure_input = element->GetInput(PressureEnum); _assert_(pressure_input);
|
---|
| 877 | Input* watercolumn_input = element->GetInput(WatercolumnEnum); _assert_(watercolumn_input);
|
---|
| 878 | Input* meltingrate_input = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(meltingrate_input);
|
---|
[16888] | 879 | Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
|
---|
[18612] | 880 | IssmDouble rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
|
---|
[16888] | 881 |
|
---|
| 882 | /*Build friction element, needed later: */
|
---|
| 883 | Friction* friction=new Friction(element,3);
|
---|
| 884 |
|
---|
| 885 | /* Start looping on the number of gaussian points: */
|
---|
[19637] | 886 | Gauss* gauss=element->NewGaussBase(4);
|
---|
| 887 | Gauss* gaussup=element->NewGaussTop(4);
|
---|
[16888] | 888 | for(int ig=gauss->begin();ig<gauss->end();ig++){
|
---|
| 889 | gauss->GaussPoint(ig);
|
---|
[18665] | 890 | gaussup->GaussPoint(ig);
|
---|
[16888] | 891 |
|
---|
| 892 | element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
|
---|
| 893 | element->NodalFunctions(basis,gauss);
|
---|
| 894 |
|
---|
[18622] | 895 | if(isdynamicbasalspc){
|
---|
| 896 | enthalpy_input->GetInputValue(&enthalpy,gauss);
|
---|
| 897 | enthalpy_input->GetInputValue(&enthalpyup,gaussup);
|
---|
| 898 | pressure_input->GetInputValue(&pressure,gauss);
|
---|
| 899 | pressure_input->GetInputValue(&pressureup,gaussup);
|
---|
| 900 | watercolumn_input->GetInputValue(&watercolumn,gauss);
|
---|
| 901 | meltingrate_input->GetInputValue(&meltingrate,gauss);
|
---|
| 902 | state=GetThermalBasalCondition(element, enthalpy, enthalpyup, pressure, pressureup, watercolumn, meltingrate);
|
---|
| 903 | }
|
---|
| 904 | else
|
---|
| 905 | state=0;
|
---|
[16888] | 906 |
|
---|
[18612] | 907 | switch (state) {
|
---|
[20272] | 908 | case 0: case 1: case 2: case 3:
|
---|
| 909 | // cold, dry base; cold, wet base; refreezing temperate base; thin temperate base:
|
---|
| 910 | // Apply basal surface forcing.
|
---|
| 911 | // Interpolated values of enthalpy on gauss nodes may indicate cold base,
|
---|
| 912 | // although one node might have become temperate. So keep heat flux switched on.
|
---|
[18612] | 913 | geothermalflux_input->GetInputValue(&geothermalflux,gauss);
|
---|
| 914 | friction->GetAlpha2(&alpha2,gauss);
|
---|
| 915 | vx_input->GetInputValue(&vx,gauss);
|
---|
| 916 | vy_input->GetInputValue(&vy,gauss);
|
---|
| 917 | vz_input->GetInputValue(&vz,gauss);
|
---|
| 918 | basalfriction=alpha2*(vx*vx+vy*vy+vz*vz);
|
---|
| 919 | heatflux=(basalfriction+geothermalflux)/(rho_ice);
|
---|
| 920 | scalar=gauss->weight*Jdet*heatflux;
|
---|
| 921 | if(dt!=0.) scalar=dt*scalar;
|
---|
| 922 | for(i=0;i<numnodes;i++)
|
---|
| 923 | pe->values[i]+=scalar*basis[i];
|
---|
| 924 | break;
|
---|
| 925 | case 4:
|
---|
| 926 | // temperate, thick melting base: set grad H*n=0
|
---|
| 927 | for(i=0;i<numnodes;i++)
|
---|
| 928 | pe->values[i]+=0.;
|
---|
| 929 | break;
|
---|
| 930 | default:
|
---|
| 931 | _printf0_(" unknown thermal basal state found!");
|
---|
[16888] | 932 | }
|
---|
| 933 | }
|
---|
| 934 |
|
---|
| 935 | /*Clean up and return*/
|
---|
| 936 | delete gauss;
|
---|
| 937 | delete gaussup;
|
---|
| 938 | delete friction;
|
---|
| 939 | xDelete<IssmDouble>(basis);
|
---|
| 940 | xDelete<IssmDouble>(xyz_list_base);
|
---|
| 941 | return pe;
|
---|
| 942 |
|
---|
[16812] | 943 | }/*}}}*/
|
---|
| 944 | ElementVector* EnthalpyAnalysis::CreatePVectorShelf(Element* element){/*{{{*/
|
---|
| 945 |
|
---|
[17434] | 946 | /* Check if ice in element */
|
---|
| 947 | if(!element->IsIceInElement()) return NULL;
|
---|
| 948 |
|
---|
[16888] | 949 | /*Get basal element*/
|
---|
[17585] | 950 | if(!element->IsOnBase() || !element->IsFloating()) return NULL;
|
---|
[16888] | 951 |
|
---|
[18612] | 952 | IssmDouble Hpmp,dt,Jdet,scalar_ocean,pressure;
|
---|
[16812] | 953 | IssmDouble *xyz_list_base = NULL;
|
---|
| 954 |
|
---|
| 955 | /*Fetch number of nodes for this finite element*/
|
---|
| 956 | int numnodes = element->GetNumberOfNodes();
|
---|
| 957 |
|
---|
| 958 | /*Initialize vectors*/
|
---|
| 959 | ElementVector* pe = element->NewElementVector();
|
---|
| 960 | IssmDouble* basis = xNew<IssmDouble>(numnodes);
|
---|
| 961 |
|
---|
| 962 | /*Retrieve all inputs and parameters*/
|
---|
| 963 | element->GetVerticesCoordinatesBase(&xyz_list_base);
|
---|
| 964 | element->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 965 | Input* pressure_input=element->GetInput(PressureEnum); _assert_(pressure_input);
|
---|
| 966 | IssmDouble gravity = element->GetMaterialParameter(ConstantsGEnum);
|
---|
[17946] | 967 | IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
|
---|
[16812] | 968 | IssmDouble rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
|
---|
| 969 | IssmDouble heatcapacity = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
|
---|
| 970 | IssmDouble mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
|
---|
| 971 | IssmDouble thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
|
---|
| 972 |
|
---|
| 973 | /* Start looping on the number of gaussian points: */
|
---|
[19637] | 974 | Gauss* gauss=element->NewGaussBase(4);
|
---|
[16812] | 975 | for(int ig=gauss->begin();ig<gauss->end();ig++){
|
---|
| 976 | gauss->GaussPoint(ig);
|
---|
| 977 |
|
---|
| 978 | element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
|
---|
| 979 | element->NodalFunctions(basis,gauss);
|
---|
| 980 |
|
---|
| 981 | pressure_input->GetInputValue(&pressure,gauss);
|
---|
[18612] | 982 | Hpmp=element->PureIceEnthalpy(pressure);
|
---|
[16812] | 983 |
|
---|
[18612] | 984 | scalar_ocean=gauss->weight*Jdet*rho_water*mixed_layer_capacity*thermal_exchange_vel*Hpmp/(heatcapacity*rho_ice);
|
---|
[16812] | 985 | if(reCast<bool,IssmDouble>(dt)) scalar_ocean=dt*scalar_ocean;
|
---|
| 986 |
|
---|
| 987 | for(int i=0;i<numnodes;i++) pe->values[i]+=scalar_ocean*basis[i];
|
---|
| 988 | }
|
---|
| 989 |
|
---|
| 990 | /*Clean up and return*/
|
---|
| 991 | delete gauss;
|
---|
| 992 | xDelete<IssmDouble>(basis);
|
---|
| 993 | xDelete<IssmDouble>(xyz_list_base);
|
---|
| 994 | return pe;
|
---|
| 995 | }/*}}}*/
|
---|
[18930] | 996 | void EnthalpyAnalysis::DrainWaterfraction(FemModel* femmodel){/*{{{*/
|
---|
| 997 | /*Drain excess water fraction in ice column: */
|
---|
[21721] | 998 | ComputeWaterfractionDrainage(femmodel);
|
---|
| 999 | DrainageUpdateWatercolumn(femmodel);
|
---|
| 1000 | DrainageUpdateEnthalpy(femmodel);
|
---|
[17002] | 1001 | }/*}}}*/
|
---|
[21721] | 1002 | void EnthalpyAnalysis::ComputeWaterfractionDrainage(FemModel* femmodel){/*{{{*/
|
---|
[17002] | 1003 |
|
---|
[21721] | 1004 | int i,k,numnodes;
|
---|
| 1005 | IssmDouble dt;
|
---|
| 1006 | Element* element= NULL;
|
---|
[17434] | 1007 |
|
---|
[21721] | 1008 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
[17434] | 1009 |
|
---|
[21721] | 1010 | for(i=0;i<femmodel->elements->Size();i++){
|
---|
| 1011 | element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 1012 | numnodes=element->GetNumberOfNodes();
|
---|
| 1013 | IssmDouble* waterfractions= xNew<IssmDouble>(numnodes);
|
---|
| 1014 | IssmDouble* drainage= xNew<IssmDouble>(numnodes);
|
---|
[17014] | 1015 |
|
---|
[21721] | 1016 | element->GetInputListOnNodes(waterfractions,WaterfractionEnum);
|
---|
| 1017 | for(k=0; k<numnodes;k++){
|
---|
| 1018 | drainage[k]=DrainageFunctionWaterfraction(waterfractions[k], dt);
|
---|
| 1019 | }
|
---|
| 1020 | element->AddInput(WaterfractionDrainageEnum,drainage,element->GetElementType());
|
---|
[18930] | 1021 |
|
---|
[21721] | 1022 | xDelete<IssmDouble>(waterfractions);
|
---|
| 1023 | xDelete<IssmDouble>(drainage);
|
---|
[18930] | 1024 | }
|
---|
[21721] | 1025 | }/*}}}*/
|
---|
| 1026 | void EnthalpyAnalysis::DrainageUpdateWatercolumn(FemModel* femmodel){/*{{{*/
|
---|
| 1027 |
|
---|
| 1028 | int i,k,numnodes, numbasalnodes;
|
---|
| 1029 | IssmDouble dt;
|
---|
| 1030 | int* basalnodeindices=NULL;
|
---|
| 1031 | Element* element= NULL;
|
---|
[18930] | 1032 |
|
---|
[21721] | 1033 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
[18667] | 1034 |
|
---|
[21721] | 1035 | /*depth-integrate the drained water fraction */
|
---|
| 1036 | femmodel->parameters->SetParam(WaterfractionDrainageEnum,InputToDepthaverageInEnum);
|
---|
| 1037 | femmodel->parameters->SetParam(WaterfractionDrainageIntegratedEnum,InputToDepthaverageOutEnum);
|
---|
| 1038 | depthaverage_core(femmodel);
|
---|
| 1039 | femmodel->parameters->SetParam(WaterfractionDrainageIntegratedEnum,InputToExtrudeEnum);
|
---|
| 1040 | extrudefrombase_core(femmodel);
|
---|
| 1041 | /*multiply depth-average by ice thickness*/
|
---|
| 1042 | for(i=0;i<femmodel->elements->Size();i++){
|
---|
| 1043 | element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 1044 | numnodes=element->GetNumberOfNodes();
|
---|
| 1045 | IssmDouble* drainage_int= xNew<IssmDouble>(numnodes);
|
---|
| 1046 | IssmDouble* thicknesses= xNew<IssmDouble>(numnodes);
|
---|
[17014] | 1047 |
|
---|
[21721] | 1048 | element->GetInputListOnNodes(drainage_int,WaterfractionDrainageIntegratedEnum);
|
---|
| 1049 | element->GetInputListOnNodes(thicknesses,ThicknessEnum);
|
---|
| 1050 | for(k=0;k<numnodes;k++){
|
---|
| 1051 | drainage_int[k]*=thicknesses[k];
|
---|
| 1052 | }
|
---|
| 1053 | element->AddInput(WaterfractionDrainageIntegratedEnum, drainage_int, element->GetElementType());
|
---|
[17166] | 1054 |
|
---|
[21721] | 1055 | xDelete<IssmDouble>(drainage_int);
|
---|
| 1056 | xDelete<IssmDouble>(thicknesses);
|
---|
| 1057 | }
|
---|
[17434] | 1058 |
|
---|
[21721] | 1059 | /*update water column*/
|
---|
| 1060 | for(i=0;i<femmodel->elements->Size();i++){
|
---|
| 1061 | element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 1062 | /* Check if ice in element */
|
---|
| 1063 | if(!element->IsIceInElement()) continue;
|
---|
| 1064 | if(!element->IsOnBase()) continue;
|
---|
[17166] | 1065 |
|
---|
[21721] | 1066 | numnodes=element->GetNumberOfNodes();
|
---|
| 1067 | IssmDouble* watercolumn= xNew<IssmDouble>(numnodes);
|
---|
| 1068 | IssmDouble* drainage_int= xNew<IssmDouble>(numnodes);
|
---|
| 1069 | element->GetInputListOnNodes(watercolumn,WatercolumnEnum);
|
---|
| 1070 | element->GetInputListOnNodes(drainage_int,WaterfractionDrainageIntegratedEnum);
|
---|
[17166] | 1071 |
|
---|
[21721] | 1072 | element->BasalNodeIndices(&numbasalnodes,&basalnodeindices,element->GetElementType());
|
---|
| 1073 | for(k=0;k<numbasalnodes;k++){
|
---|
| 1074 | watercolumn[basalnodeindices[k]]+=dt*drainage_int[basalnodeindices[k]];
|
---|
| 1075 | }
|
---|
| 1076 | element->AddInput(WatercolumnEnum, watercolumn, element->GetElementType());
|
---|
[17166] | 1077 |
|
---|
[21721] | 1078 | xDelete<IssmDouble>(watercolumn);
|
---|
| 1079 | xDelete<IssmDouble>(drainage_int);
|
---|
[21779] | 1080 | xDelete<int>(basalnodeindices);
|
---|
[21721] | 1081 | }
|
---|
| 1082 | }/*}}}*/
|
---|
| 1083 | void EnthalpyAnalysis::DrainageUpdateEnthalpy(FemModel* femmodel){/*{{{*/
|
---|
[17166] | 1084 |
|
---|
[21721] | 1085 | int i,k,numnodes;
|
---|
| 1086 | IssmDouble dt;
|
---|
| 1087 | Element* element= NULL;
|
---|
| 1088 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
[17166] | 1089 |
|
---|
[21721] | 1090 | for(i=0;i<femmodel->elements->Size();i++){
|
---|
| 1091 | element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 1092 | numnodes=element->GetNumberOfNodes();
|
---|
| 1093 | IssmDouble* enthalpies= xNew<IssmDouble>(numnodes);
|
---|
| 1094 | IssmDouble* pressures= xNew<IssmDouble>(numnodes);
|
---|
| 1095 | IssmDouble* temperatures= xNew<IssmDouble>(numnodes);
|
---|
| 1096 | IssmDouble* waterfractions= xNew<IssmDouble>(numnodes);
|
---|
| 1097 | IssmDouble* drainage= xNew<IssmDouble>(numnodes);
|
---|
[21653] | 1098 |
|
---|
[21721] | 1099 | element->GetInputListOnNodes(pressures,PressureEnum);
|
---|
| 1100 | element->GetInputListOnNodes(temperatures,TemperatureEnum);
|
---|
| 1101 | element->GetInputListOnNodes(waterfractions,WaterfractionEnum);
|
---|
| 1102 | element->GetInputListOnNodes(drainage,WaterfractionDrainageEnum);
|
---|
[21653] | 1103 |
|
---|
[21721] | 1104 | for(k=0;k<numnodes;k++){
|
---|
| 1105 | waterfractions[k]-=dt*drainage[k];
|
---|
| 1106 | element->ThermalToEnthalpy(&enthalpies[k], temperatures[k], waterfractions[k], pressures[k]);
|
---|
| 1107 | }
|
---|
| 1108 | element->AddInput(WaterfractionEnum,waterfractions,element->GetElementType());
|
---|
| 1109 | element->AddInput(EnthalpyEnum,enthalpies,element->GetElementType());
|
---|
[17166] | 1110 |
|
---|
[21721] | 1111 | xDelete<IssmDouble>(enthalpies);
|
---|
| 1112 | xDelete<IssmDouble>(pressures);
|
---|
| 1113 | xDelete<IssmDouble>(temperatures);
|
---|
| 1114 | xDelete<IssmDouble>(waterfractions);
|
---|
| 1115 | xDelete<IssmDouble>(drainage);
|
---|
| 1116 | }
|
---|
[17002] | 1117 | }/*}}}*/
|
---|
[18930] | 1118 | IssmDouble EnthalpyAnalysis::EnthalpyDiffusionParameter(Element* element,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
|
---|
[17014] | 1119 |
|
---|
[18930] | 1120 | IssmDouble heatcapacity = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
|
---|
| 1121 | IssmDouble temperateiceconductivity = element->GetMaterialParameter(MaterialsTemperateiceconductivityEnum);
|
---|
| 1122 | IssmDouble thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
|
---|
[17434] | 1123 |
|
---|
[18930] | 1124 | if(enthalpy < PureIceEnthalpy(element,pressure)){
|
---|
| 1125 | return thermalconductivity/heatcapacity;
|
---|
| 1126 | }
|
---|
| 1127 | else{
|
---|
| 1128 | return temperateiceconductivity/heatcapacity;
|
---|
| 1129 | }
|
---|
| 1130 | }/*}}}*/
|
---|
| 1131 | IssmDouble EnthalpyAnalysis::EnthalpyDiffusionParameterVolume(Element* element,int enthalpy_enum){/*{{{*/
|
---|
[17014] | 1132 |
|
---|
[18930] | 1133 | int iv;
|
---|
| 1134 | IssmDouble lambda; /* fraction of cold ice */
|
---|
| 1135 | IssmDouble kappa,kappa_c,kappa_t; /* enthalpy conductivities */
|
---|
| 1136 | IssmDouble Hc,Ht;
|
---|
[17014] | 1137 |
|
---|
[18930] | 1138 | /*Get pressures and enthalpies on vertices*/
|
---|
| 1139 | int numvertices = element->GetNumberOfVertices();
|
---|
| 1140 | IssmDouble* pressures = xNew<IssmDouble>(numvertices);
|
---|
| 1141 | IssmDouble* enthalpies = xNew<IssmDouble>(numvertices);
|
---|
| 1142 | IssmDouble* PIE = xNew<IssmDouble>(numvertices);
|
---|
| 1143 | IssmDouble* dHpmp = xNew<IssmDouble>(numvertices);
|
---|
[17014] | 1144 | element->GetInputListOnVertices(pressures,PressureEnum);
|
---|
[18930] | 1145 | element->GetInputListOnVertices(enthalpies,enthalpy_enum);
|
---|
| 1146 | for(iv=0;iv<numvertices;iv++){
|
---|
| 1147 | PIE[iv] = PureIceEnthalpy(element,pressures[iv]);
|
---|
| 1148 | dHpmp[iv] = enthalpies[iv]-PIE[iv];
|
---|
| 1149 | }
|
---|
[17014] | 1150 |
|
---|
[18930] | 1151 | bool allequalsign = true;
|
---|
| 1152 | if(dHpmp[0]<0.){
|
---|
| 1153 | for(iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]<0.));
|
---|
[17014] | 1154 | }
|
---|
[18930] | 1155 | else{
|
---|
| 1156 | for(iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]>=0.));
|
---|
[17014] | 1157 | }
|
---|
| 1158 |
|
---|
[18930] | 1159 | if(allequalsign){
|
---|
| 1160 | kappa = EnthalpyDiffusionParameter(element,enthalpies[0],pressures[0]);
|
---|
[17014] | 1161 | }
|
---|
[18930] | 1162 | else{
|
---|
| 1163 | /* return harmonic mean of thermal conductivities, weighted by fraction of cold/temperate ice,
|
---|
| 1164 | cf Patankar 1980, pp44 */
|
---|
| 1165 | kappa_c = EnthalpyDiffusionParameter(element,PureIceEnthalpy(element,0.)-1.,0.);
|
---|
| 1166 | kappa_t = EnthalpyDiffusionParameter(element,PureIceEnthalpy(element,0.)+1.,0.);
|
---|
| 1167 | Hc=0.; Ht=0.;
|
---|
| 1168 | for(iv=0; iv<numvertices;iv++){
|
---|
| 1169 | if(enthalpies[iv]<PIE[iv])
|
---|
| 1170 | Hc+=(PIE[iv]-enthalpies[iv]);
|
---|
| 1171 | else
|
---|
| 1172 | Ht+=(enthalpies[iv]-PIE[iv]);
|
---|
| 1173 | }
|
---|
| 1174 | _assert_((Hc+Ht)>0.);
|
---|
| 1175 | lambda = Hc/(Hc+Ht);
|
---|
| 1176 | kappa = kappa_c*kappa_t/(lambda*kappa_t+(1.-lambda)*kappa_c); // ==(lambda/kappa_c + (1.-lambda)/kappa_t)^-1
|
---|
| 1177 | }
|
---|
[17014] | 1178 |
|
---|
| 1179 | /*Clean up and return*/
|
---|
[18930] | 1180 | xDelete<IssmDouble>(PIE);
|
---|
| 1181 | xDelete<IssmDouble>(dHpmp);
|
---|
| 1182 | xDelete<IssmDouble>(pressures);
|
---|
[17014] | 1183 | xDelete<IssmDouble>(enthalpies);
|
---|
[18930] | 1184 | return kappa;
|
---|
[17002] | 1185 | }/*}}}*/
|
---|
[18930] | 1186 | void EnthalpyAnalysis::GetBAdvec(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
|
---|
| 1187 | /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1.
|
---|
| 1188 | * For node i, Bi' can be expressed in the actual coordinate system
|
---|
| 1189 | * by:
|
---|
| 1190 | * Bi_advec =[ h ]
|
---|
| 1191 | * [ h ]
|
---|
| 1192 | * [ h ]
|
---|
| 1193 | * where h is the interpolation function for node i.
|
---|
| 1194 | *
|
---|
| 1195 | * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1)
|
---|
| 1196 | */
|
---|
[18659] | 1197 |
|
---|
[18930] | 1198 | /*Fetch number of nodes for this finite element*/
|
---|
| 1199 | int numnodes = element->GetNumberOfNodes();
|
---|
[18659] | 1200 |
|
---|
[18930] | 1201 | /*Get nodal functions*/
|
---|
| 1202 | IssmDouble* basis=xNew<IssmDouble>(numnodes);
|
---|
| 1203 | element->NodalFunctions(basis,gauss);
|
---|
[18659] | 1204 |
|
---|
[18930] | 1205 | /*Build B: */
|
---|
| 1206 | for(int i=0;i<numnodes;i++){
|
---|
| 1207 | B[numnodes*0+i] = basis[i];
|
---|
| 1208 | B[numnodes*1+i] = basis[i];
|
---|
| 1209 | B[numnodes*2+i] = basis[i];
|
---|
[18659] | 1210 | }
|
---|
| 1211 |
|
---|
[18930] | 1212 | /*Clean-up*/
|
---|
| 1213 | xDelete<IssmDouble>(basis);
|
---|
[18612] | 1214 | }/*}}}*/
|
---|
[18930] | 1215 | void EnthalpyAnalysis::GetBAdvecprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
|
---|
| 1216 | /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1.
|
---|
| 1217 | * For node i, Bi' can be expressed in the actual coordinate system
|
---|
| 1218 | * by:
|
---|
| 1219 | * Biprime_advec=[ dh/dx ]
|
---|
| 1220 | * [ dh/dy ]
|
---|
| 1221 | * [ dh/dz ]
|
---|
| 1222 | * where h is the interpolation function for node i.
|
---|
| 1223 | *
|
---|
| 1224 | * We assume B has been allocated already, of size: 3x(NDOF1*numnodes)
|
---|
| 1225 | */
|
---|
[17002] | 1226 |
|
---|
[18930] | 1227 | /*Fetch number of nodes for this finite element*/
|
---|
| 1228 | int numnodes = element->GetNumberOfNodes();
|
---|
[17434] | 1229 |
|
---|
[18930] | 1230 | /*Get nodal functions derivatives*/
|
---|
| 1231 | IssmDouble* dbasis=xNew<IssmDouble>(3*numnodes);
|
---|
| 1232 | element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
|
---|
[17434] | 1233 |
|
---|
[18930] | 1234 | /*Build B: */
|
---|
| 1235 | for(int i=0;i<numnodes;i++){
|
---|
| 1236 | B[numnodes*0+i] = dbasis[0*numnodes+i];
|
---|
| 1237 | B[numnodes*1+i] = dbasis[1*numnodes+i];
|
---|
| 1238 | B[numnodes*2+i] = dbasis[2*numnodes+i];
|
---|
[18659] | 1239 | }
|
---|
| 1240 |
|
---|
[18930] | 1241 | /*Clean-up*/
|
---|
| 1242 | xDelete<IssmDouble>(dbasis);
|
---|
[18659] | 1243 | }/*}}}*/
|
---|
[18930] | 1244 | void EnthalpyAnalysis::GetBasalConstraints(Vector<IssmDouble>* vec_spc,Element* element){/*{{{*/
|
---|
[18659] | 1245 |
|
---|
| 1246 | /*Intermediary*/
|
---|
| 1247 | bool isdynamicbasalspc;
|
---|
[18612] | 1248 | IssmDouble dt;
|
---|
| 1249 |
|
---|
| 1250 | /*Check wether dynamic basal boundary conditions are activated */
|
---|
| 1251 | element->FindParam(&isdynamicbasalspc,ThermalIsdynamicbasalspcEnum);
|
---|
| 1252 | if(!isdynamicbasalspc) return;
|
---|
| 1253 |
|
---|
| 1254 | element->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 1255 | if(dt==0.){
|
---|
[18659] | 1256 | GetBasalConstraintsSteadystate(vec_spc,element);
|
---|
[18612] | 1257 | }
|
---|
| 1258 | else{
|
---|
[18659] | 1259 | GetBasalConstraintsTransient(vec_spc,element);
|
---|
[18612] | 1260 | }
|
---|
| 1261 | }/*}}}*/
|
---|
[18930] | 1262 | void EnthalpyAnalysis::GetBasalConstraintsSteadystate(Vector<IssmDouble>* vec_spc,Element* element){/*{{{*/
|
---|
[18612] | 1263 |
|
---|
| 1264 | /* Check if ice in element */
|
---|
| 1265 | if(!element->IsIceInElement()) return;
|
---|
| 1266 |
|
---|
[20213] | 1267 | /* Only update constraints at the base.
|
---|
| 1268 | * Floating ice is not affected by basal BC decision chart. */
|
---|
[18612] | 1269 | if(!(element->IsOnBase()) || element->IsFloating()) return;
|
---|
| 1270 |
|
---|
| 1271 | /*Intermediary*/
|
---|
| 1272 | int numindices, numindicesup, state;
|
---|
[17027] | 1273 | int *indices = NULL, *indicesup = NULL;
|
---|
[18612] | 1274 | IssmDouble enthalpy, enthalpyup, pressure, pressureup, watercolumn, meltingrate;
|
---|
[17014] | 1275 |
|
---|
[18612] | 1276 | /*Get parameters and inputs: */
|
---|
[18930] | 1277 | Input* enthalpy_input = element->GetInput(EnthalpyPicardEnum); _assert_(enthalpy_input);
|
---|
[18612] | 1278 | Input* pressure_input = element->GetInput(PressureEnum); _assert_(pressure_input);
|
---|
| 1279 | Input* watercolumn_input = element->GetInput(WatercolumnEnum); _assert_(watercolumn_input);
|
---|
| 1280 | Input* meltingrate_input = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(meltingrate_input);
|
---|
| 1281 |
|
---|
[17027] | 1282 | /*Fetch indices of basal & surface nodes for this finite element*/
|
---|
| 1283 | Penta *penta = (Penta *) element; // TODO: add Basal-/SurfaceNodeIndices to element.h, and change this to Element*
|
---|
| 1284 | penta->BasalNodeIndices(&numindices,&indices,element->GetElementType());
|
---|
[18612] | 1285 | penta->SurfaceNodeIndices(&numindicesup,&indicesup,element->GetElementType()); _assert_(numindices==numindicesup);
|
---|
[17014] | 1286 |
|
---|
[18612] | 1287 | GaussPenta* gauss=new GaussPenta();
|
---|
| 1288 | GaussPenta* gaussup=new GaussPenta();
|
---|
| 1289 | for(int i=0;i<numindices;i++){
|
---|
| 1290 | gauss->GaussNode(element->GetElementType(),indices[i]);
|
---|
| 1291 | gaussup->GaussNode(element->GetElementType(),indicesup[i]);
|
---|
[18930] | 1292 |
|
---|
[18612] | 1293 | enthalpy_input->GetInputValue(&enthalpy,gauss);
|
---|
| 1294 | enthalpy_input->GetInputValue(&enthalpyup,gaussup);
|
---|
| 1295 | pressure_input->GetInputValue(&pressure,gauss);
|
---|
| 1296 | pressure_input->GetInputValue(&pressureup,gaussup);
|
---|
| 1297 | watercolumn_input->GetInputValue(&watercolumn,gauss);
|
---|
| 1298 | meltingrate_input->GetInputValue(&meltingrate,gauss);
|
---|
| 1299 |
|
---|
| 1300 | state=GetThermalBasalCondition(element, enthalpy, enthalpyup, pressure, pressureup, watercolumn, meltingrate);
|
---|
| 1301 | switch (state) {
|
---|
| 1302 | case 0:
|
---|
| 1303 | // cold, dry base: apply basal surface forcing
|
---|
[18659] | 1304 | vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
|
---|
[18612] | 1305 | break;
|
---|
| 1306 | case 1:
|
---|
| 1307 | // cold, wet base: keep at pressure melting point
|
---|
[18659] | 1308 | vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
|
---|
[18612] | 1309 | break;
|
---|
| 1310 | case 2:
|
---|
[20098] | 1311 | // temperate, thin refreezing base:
|
---|
| 1312 | vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
|
---|
[18612] | 1313 | break;
|
---|
| 1314 | case 3:
|
---|
| 1315 | // temperate, thin melting base: set spc
|
---|
[18659] | 1316 | vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
|
---|
[18612] | 1317 | break;
|
---|
| 1318 | case 4:
|
---|
[20098] | 1319 | // temperate, thick melting base:
|
---|
[18930] | 1320 | vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
|
---|
[18612] | 1321 | break;
|
---|
| 1322 | default:
|
---|
| 1323 | _printf0_(" unknown thermal basal state found!");
|
---|
| 1324 | }
|
---|
| 1325 | }
|
---|
| 1326 |
|
---|
| 1327 | /*Free ressources:*/
|
---|
| 1328 | xDelete<int>(indices);
|
---|
| 1329 | xDelete<int>(indicesup);
|
---|
| 1330 | delete gauss;
|
---|
| 1331 | delete gaussup;
|
---|
| 1332 | }/*}}}*/
|
---|
[18930] | 1333 | void EnthalpyAnalysis::GetBasalConstraintsTransient(Vector<IssmDouble>* vec_spc,Element* element){/*{{{*/
|
---|
[18612] | 1334 |
|
---|
| 1335 | /* Check if ice in element */
|
---|
| 1336 | if(!element->IsIceInElement()) return;
|
---|
| 1337 |
|
---|
[20213] | 1338 | /* Only update constraints at the base.
|
---|
| 1339 | * Floating ice is not affected by basal BC decision chart.*/
|
---|
[18612] | 1340 | if(!(element->IsOnBase()) || element->IsFloating()) return;
|
---|
| 1341 |
|
---|
| 1342 | /*Intermediary*/
|
---|
| 1343 | int numindices, numindicesup, state;
|
---|
| 1344 | int *indices = NULL, *indicesup = NULL;
|
---|
| 1345 | IssmDouble enthalpy, enthalpyup, pressure, pressureup, watercolumn, meltingrate;
|
---|
| 1346 |
|
---|
[17027] | 1347 | /*Get parameters and inputs: */
|
---|
[18930] | 1348 | Input* enthalpy_input = element->GetInput(EnthalpyEnum); _assert_(enthalpy_input); //TODO: check EnthalpyPicard?
|
---|
[18612] | 1349 | Input* pressure_input = element->GetInput(PressureEnum); _assert_(pressure_input);
|
---|
| 1350 | Input* watercolumn_input = element->GetInput(WatercolumnEnum); _assert_(watercolumn_input);
|
---|
| 1351 | Input* meltingrate_input = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(meltingrate_input);
|
---|
[17014] | 1352 |
|
---|
[18612] | 1353 | /*Fetch indices of basal & surface nodes for this finite element*/
|
---|
| 1354 | Penta *penta = (Penta *) element; // TODO: add Basal-/SurfaceNodeIndices to element.h, and change this to Element*
|
---|
| 1355 | penta->BasalNodeIndices(&numindices,&indices,element->GetElementType());
|
---|
| 1356 | penta->SurfaceNodeIndices(&numindicesup,&indicesup,element->GetElementType()); _assert_(numindices==numindicesup);
|
---|
| 1357 |
|
---|
[17027] | 1358 | GaussPenta* gauss=new GaussPenta();
|
---|
| 1359 | GaussPenta* gaussup=new GaussPenta();
|
---|
[18930] | 1360 |
|
---|
[17027] | 1361 | for(int i=0;i<numindices;i++){
|
---|
| 1362 | gauss->GaussNode(element->GetElementType(),indices[i]);
|
---|
| 1363 | gaussup->GaussNode(element->GetElementType(),indicesup[i]);
|
---|
[18930] | 1364 |
|
---|
[18612] | 1365 | enthalpy_input->GetInputValue(&enthalpy,gauss);
|
---|
| 1366 | enthalpy_input->GetInputValue(&enthalpyup,gaussup);
|
---|
| 1367 | pressure_input->GetInputValue(&pressure,gauss);
|
---|
| 1368 | pressure_input->GetInputValue(&pressureup,gaussup);
|
---|
[17027] | 1369 | watercolumn_input->GetInputValue(&watercolumn,gauss);
|
---|
[18612] | 1370 | meltingrate_input->GetInputValue(&meltingrate,gauss);
|
---|
| 1371 |
|
---|
| 1372 | state=GetThermalBasalCondition(element, enthalpy, enthalpyup, pressure, pressureup, watercolumn, meltingrate);
|
---|
[18930] | 1373 |
|
---|
[18612] | 1374 | switch (state) {
|
---|
| 1375 | case 0:
|
---|
| 1376 | // cold, dry base: apply basal surface forcing
|
---|
[18659] | 1377 | vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
|
---|
[18612] | 1378 | break;
|
---|
| 1379 | case 1:
|
---|
| 1380 | // cold, wet base: keep at pressure melting point
|
---|
[18659] | 1381 | vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
|
---|
[18612] | 1382 | break;
|
---|
| 1383 | case 2:
|
---|
| 1384 | // temperate, thin refreezing base: release spc
|
---|
[18659] | 1385 | vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
|
---|
[18612] | 1386 | break;
|
---|
| 1387 | case 3:
|
---|
| 1388 | // temperate, thin melting base: set spc
|
---|
[18659] | 1389 | vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
|
---|
[18612] | 1390 | break;
|
---|
| 1391 | case 4:
|
---|
[18930] | 1392 | // temperate, thick melting base: set grad H*n=0
|
---|
| 1393 | vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
|
---|
[18612] | 1394 | break;
|
---|
| 1395 | default:
|
---|
| 1396 | _printf0_(" unknown thermal basal state found!");
|
---|
[17027] | 1397 | }
|
---|
[18930] | 1398 |
|
---|
[17027] | 1399 | }
|
---|
[17014] | 1400 |
|
---|
[17027] | 1401 | /*Free ressources:*/
|
---|
| 1402 | xDelete<int>(indices);
|
---|
| 1403 | xDelete<int>(indicesup);
|
---|
| 1404 | delete gauss;
|
---|
| 1405 | delete gaussup;
|
---|
[17002] | 1406 | }/*}}}*/
|
---|
[18930] | 1407 | void EnthalpyAnalysis::GetBConduct(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
|
---|
| 1408 | /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1.
|
---|
| 1409 | * For node i, Bi' can be expressed in the actual coordinate system
|
---|
| 1410 | * by:
|
---|
| 1411 | * Bi_conduct=[ dh/dx ]
|
---|
| 1412 | * [ dh/dy ]
|
---|
| 1413 | * [ dh/dz ]
|
---|
| 1414 | * where h is the interpolation function for node i.
|
---|
| 1415 | *
|
---|
| 1416 | * We assume B has been allocated already, of size: 3x(NDOF1*numnodes)
|
---|
| 1417 | */
|
---|
[17002] | 1418 |
|
---|
[18930] | 1419 | /*Fetch number of nodes for this finite element*/
|
---|
| 1420 | int numnodes = element->GetNumberOfNodes();
|
---|
| 1421 |
|
---|
| 1422 | /*Get nodal functions derivatives*/
|
---|
| 1423 | IssmDouble* dbasis=xNew<IssmDouble>(3*numnodes);
|
---|
| 1424 | element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
|
---|
| 1425 |
|
---|
| 1426 | /*Build B: */
|
---|
| 1427 | for(int i=0;i<numnodes;i++){
|
---|
| 1428 | B[numnodes*0+i] = dbasis[0*numnodes+i];
|
---|
| 1429 | B[numnodes*1+i] = dbasis[1*numnodes+i];
|
---|
| 1430 | B[numnodes*2+i] = dbasis[2*numnodes+i];
|
---|
| 1431 | }
|
---|
| 1432 |
|
---|
| 1433 | /*Clean-up*/
|
---|
| 1434 | xDelete<IssmDouble>(dbasis);
|
---|
| 1435 | }/*}}}*/
|
---|
| 1436 | void EnthalpyAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
|
---|
| 1437 | element->GetSolutionFromInputsOneDof(solution,EnthalpyEnum);
|
---|
| 1438 | }/*}}}*/
|
---|
| 1439 | int EnthalpyAnalysis::GetThermalBasalCondition(Element* element, IssmDouble enthalpy, IssmDouble enthalpyup, IssmDouble pressure, IssmDouble pressureup, IssmDouble watercolumn, IssmDouble meltingrate){/*{{{*/
|
---|
| 1440 |
|
---|
[18612] | 1441 | /* Check if ice in element */
|
---|
| 1442 | if(!element->IsIceInElement()) return -1;
|
---|
| 1443 |
|
---|
| 1444 | /* Only update Constraints at the base of grounded ice*/
|
---|
| 1445 | if(!(element->IsOnBase())) return -1;
|
---|
| 1446 |
|
---|
| 1447 | /*Intermediary*/
|
---|
| 1448 | int state=-1;
|
---|
| 1449 | IssmDouble dt;
|
---|
| 1450 |
|
---|
| 1451 | /*Get parameters and inputs: */
|
---|
| 1452 | element->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 1453 |
|
---|
[18620] | 1454 | if(enthalpy<PureIceEnthalpy(element,pressure)){
|
---|
| 1455 | if(watercolumn<=0.) state=0; // cold, dry base
|
---|
| 1456 | else state=1; // cold, wet base (refreezing)
|
---|
[18612] | 1457 | }
|
---|
[18620] | 1458 | else{
|
---|
| 1459 | if(enthalpyup<PureIceEnthalpy(element,pressureup)){
|
---|
| 1460 | if((dt==0.) && (meltingrate<0.)) state=2; // refreezing temperate base (non-physical, only for steadystate solver)
|
---|
| 1461 | else state=3; // temperate base, but no temperate layer
|
---|
[18612] | 1462 | }
|
---|
[18620] | 1463 | else state=4; // temperate layer with positive thickness
|
---|
[18612] | 1464 | }
|
---|
| 1465 |
|
---|
| 1466 | _assert_(state>=0);
|
---|
| 1467 | return state;
|
---|
| 1468 | }/*}}}*/
|
---|
[18930] | 1469 | IssmDouble EnthalpyAnalysis::GetWetIceConductivity(Element* element, IssmDouble enthalpy, IssmDouble pressure){/*{{{*/
|
---|
[18612] | 1470 |
|
---|
| 1471 | IssmDouble temperature, waterfraction;
|
---|
| 1472 | IssmDouble kappa_w = 0.6; // thermal conductivity of water (in W/m/K)
|
---|
| 1473 | IssmDouble kappa_i = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
|
---|
| 1474 | element->EnthalpyToThermal(&temperature, &waterfraction, enthalpy, pressure);
|
---|
| 1475 |
|
---|
| 1476 | return (1.-waterfraction)*kappa_i + waterfraction*kappa_w;
|
---|
| 1477 | }/*}}}*/
|
---|
[18930] | 1478 | void EnthalpyAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
|
---|
| 1479 | _error_("Not implemented yet");
|
---|
| 1480 | }/*}}}*/
|
---|
| 1481 | void EnthalpyAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
|
---|
[18612] | 1482 |
|
---|
[18930] | 1483 | bool converged;
|
---|
| 1484 | int i,rheology_law;
|
---|
| 1485 | IssmDouble B_average,s_average,T_average=0.,P_average=0.;
|
---|
[21382] | 1486 | IssmDouble n=3.0;
|
---|
[18930] | 1487 | int *doflist = NULL;
|
---|
| 1488 | IssmDouble *xyz_list = NULL;
|
---|
[16888] | 1489 |
|
---|
[18930] | 1490 | /*Fetch number of nodes and dof for this finite element*/
|
---|
| 1491 | int numnodes = element->GetNumberOfNodes();
|
---|
[16888] | 1492 |
|
---|
[18930] | 1493 | /*Fetch dof list and allocate solution vector*/
|
---|
| 1494 | element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
|
---|
| 1495 | IssmDouble* values = xNew<IssmDouble>(numnodes);
|
---|
| 1496 | IssmDouble* pressure = xNew<IssmDouble>(numnodes);
|
---|
| 1497 | IssmDouble* surface = xNew<IssmDouble>(numnodes);
|
---|
| 1498 | IssmDouble* B = xNew<IssmDouble>(numnodes);
|
---|
| 1499 | IssmDouble* temperature = xNew<IssmDouble>(numnodes);
|
---|
| 1500 | IssmDouble* waterfraction = xNew<IssmDouble>(numnodes);
|
---|
[16888] | 1501 |
|
---|
[18930] | 1502 | /*Use the dof list to index into the solution vector: */
|
---|
| 1503 | for(i=0;i<numnodes;i++){
|
---|
| 1504 | values[i]=solution[doflist[i]];
|
---|
[16888] | 1505 |
|
---|
[18930] | 1506 | /*Check solution*/
|
---|
| 1507 | if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
|
---|
[20669] | 1508 | if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector");
|
---|
[16888] | 1509 | }
|
---|
| 1510 |
|
---|
[18930] | 1511 | /*Get all inputs and parameters*/
|
---|
[21382] | 1512 | if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum);
|
---|
[18930] | 1513 | element->GetInputValue(&converged,ConvergedEnum);
|
---|
| 1514 | element->GetInputListOnNodes(&pressure[0],PressureEnum);
|
---|
| 1515 | if(converged){
|
---|
| 1516 | for(i=0;i<numnodes;i++){
|
---|
| 1517 | element->EnthalpyToThermal(&temperature[i],&waterfraction[i],values[i],pressure[i]);
|
---|
| 1518 | if(waterfraction[i]<0.) _error_("Negative water fraction found in solution vector");
|
---|
| 1519 | //if(waterfraction[i]>1.) _error_("Water fraction >1 found in solution vector");
|
---|
| 1520 | }
|
---|
| 1521 | element->AddInput(EnthalpyEnum,values,element->GetElementType());
|
---|
| 1522 | element->AddInput(WaterfractionEnum,waterfraction,element->GetElementType());
|
---|
| 1523 | element->AddInput(TemperatureEnum,temperature,element->GetElementType());
|
---|
| 1524 |
|
---|
| 1525 | /*Update Rheology only if converged (we must make sure that the temperature is below melting point
|
---|
| 1526 | * otherwise the rheology could be negative*/
|
---|
| 1527 | element->FindParam(&rheology_law,MaterialsRheologyLawEnum);
|
---|
| 1528 | element->GetInputListOnNodes(&surface[0],SurfaceEnum);
|
---|
| 1529 | switch(rheology_law){
|
---|
| 1530 | case NoneEnum:
|
---|
| 1531 | /*Do nothing: B is not temperature dependent*/
|
---|
| 1532 | break;
|
---|
[21377] | 1533 | case BuddJackaEnum:
|
---|
| 1534 | for(i=0;i<numnodes;i++) B[i]=BuddJacka(temperature[i]);
|
---|
| 1535 | element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
|
---|
| 1536 | break;
|
---|
[18930] | 1537 | case CuffeyEnum:
|
---|
| 1538 | for(i=0;i<numnodes;i++) B[i]=Cuffey(temperature[i]);
|
---|
| 1539 | element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
|
---|
| 1540 | break;
|
---|
[20625] | 1541 | case CuffeyTemperateEnum:
|
---|
[21382] | 1542 | for(i=0;i<numnodes;i++) B[i]=CuffeyTemperate(temperature[i], waterfraction[i],n);
|
---|
[20625] | 1543 | element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
|
---|
| 1544 | break;
|
---|
[18930] | 1545 | case PatersonEnum:
|
---|
| 1546 | for(i=0;i<numnodes;i++) B[i]=Paterson(temperature[i]);
|
---|
| 1547 | element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
|
---|
| 1548 | break;
|
---|
| 1549 | case ArrheniusEnum:
|
---|
| 1550 | element->GetVerticesCoordinates(&xyz_list);
|
---|
[21382] | 1551 | for(i=0;i<numnodes;i++) B[i]=Arrhenius(temperature[i],surface[i]-xyz_list[i*3+2],n);
|
---|
[18930] | 1552 | element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
|
---|
| 1553 | break;
|
---|
| 1554 | case LliboutryDuvalEnum:
|
---|
[21382] | 1555 | for(i=0;i<numnodes;i++) B[i]=LliboutryDuval(values[i],pressure[i],n,element->GetMaterialParameter(MaterialsBetaEnum),element->GetMaterialParameter(ConstantsReferencetemperatureEnum),element->GetMaterialParameter(MaterialsHeatcapacityEnum),element->GetMaterialParameter(MaterialsLatentheatEnum));
|
---|
[18930] | 1556 | element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
|
---|
| 1557 | break;
|
---|
| 1558 | default: _error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
|
---|
| 1559 | }
|
---|
[16888] | 1560 | }
|
---|
| 1561 | else{
|
---|
[18930] | 1562 | element->AddInput(EnthalpyPicardEnum,values,element->GetElementType());
|
---|
[16888] | 1563 | }
|
---|
| 1564 |
|
---|
[18930] | 1565 | /*Free ressources:*/
|
---|
| 1566 | xDelete<IssmDouble>(values);
|
---|
| 1567 | xDelete<IssmDouble>(pressure);
|
---|
| 1568 | xDelete<IssmDouble>(surface);
|
---|
| 1569 | xDelete<IssmDouble>(B);
|
---|
| 1570 | xDelete<IssmDouble>(temperature);
|
---|
| 1571 | xDelete<IssmDouble>(waterfraction);
|
---|
| 1572 | xDelete<IssmDouble>(xyz_list);
|
---|
| 1573 | xDelete<int>(doflist);
|
---|
| 1574 | }/*}}}*/
|
---|
| 1575 | void EnthalpyAnalysis::PostProcessing(FemModel* femmodel){/*{{{*/
|
---|
[16888] | 1576 |
|
---|
[18930] | 1577 | /*Intermediaries*/
|
---|
| 1578 | bool computebasalmeltingrates=true;
|
---|
| 1579 | bool drainicecolumn=true;
|
---|
| 1580 | IssmDouble dt;
|
---|
| 1581 |
|
---|
| 1582 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 1583 |
|
---|
[21161] | 1584 | if(drainicecolumn && (dt>0.)) DrainWaterfraction(femmodel);
|
---|
[18930] | 1585 | if(computebasalmeltingrates) ComputeBasalMeltingrate(femmodel);
|
---|
| 1586 |
|
---|
[17027] | 1587 | }/*}}}*/
|
---|
[18930] | 1588 | IssmDouble EnthalpyAnalysis::PureIceEnthalpy(Element* element,IssmDouble pressure){/*{{{*/
|
---|
[16888] | 1589 |
|
---|
| 1590 | IssmDouble heatcapacity = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
|
---|
| 1591 | IssmDouble referencetemperature = element->GetMaterialParameter(ConstantsReferencetemperatureEnum);
|
---|
| 1592 |
|
---|
| 1593 | return heatcapacity*(TMeltingPoint(element,pressure)-referencetemperature);
|
---|
| 1594 | }/*}}}*/
|
---|
[18930] | 1595 | IssmDouble EnthalpyAnalysis::TMeltingPoint(Element* element,IssmDouble pressure){/*{{{*/
|
---|
[16888] | 1596 |
|
---|
| 1597 | IssmDouble meltingpoint = element->GetMaterialParameter(MaterialsMeltingpointEnum);
|
---|
| 1598 | IssmDouble beta = element->GetMaterialParameter(MaterialsBetaEnum);
|
---|
| 1599 |
|
---|
| 1600 | return meltingpoint-beta*pressure;
|
---|
| 1601 | }/*}}}*/
|
---|
[18930] | 1602 | void EnthalpyAnalysis::UpdateBasalConstraints(FemModel* femmodel){/*{{{*/
|
---|
| 1603 |
|
---|
| 1604 | /*Update basal dirichlet BCs for enthalpy: */
|
---|
| 1605 | Vector<IssmDouble>* spc = NULL;
|
---|
| 1606 | IssmDouble* serial_spc = NULL;
|
---|
| 1607 |
|
---|
| 1608 | spc=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes(EnthalpyAnalysisEnum));
|
---|
| 1609 | /*First create a vector to figure out what elements should be constrained*/
|
---|
| 1610 | for(int i=0;i<femmodel->elements->Size();i++){
|
---|
| 1611 | Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 1612 | GetBasalConstraints(spc,element);
|
---|
| 1613 | }
|
---|
| 1614 |
|
---|
| 1615 | /*Assemble and serialize*/
|
---|
| 1616 | spc->Assemble();
|
---|
| 1617 | serial_spc=spc->ToMPISerial();
|
---|
| 1618 | delete spc;
|
---|
| 1619 |
|
---|
| 1620 | /*Then update basal constraints nodes accordingly*/
|
---|
| 1621 | for(int i=0;i<femmodel->elements->Size();i++){
|
---|
| 1622 | Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 1623 | ApplyBasalConstraints(serial_spc,element);
|
---|
| 1624 | }
|
---|
| 1625 |
|
---|
| 1626 | femmodel->UpdateConstraintsx();
|
---|
| 1627 |
|
---|
| 1628 | /*Delete*/
|
---|
| 1629 | xDelete<IssmDouble>(serial_spc);
|
---|
| 1630 | }/*}}}*/
|
---|
| 1631 | void EnthalpyAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
|
---|
[20453] | 1632 | SetActiveNodesLSMx(femmodel);
|
---|
[18930] | 1633 | }/*}}}*/
|
---|