Changeset 21145


Ignore:
Timestamp:
08/17/16 09:52:54 (9 years ago)
Author:
aleahsommers
Message:

CHG: Added effective pressure as an output, added term in meltrate to include changes in pressure melting point

Location:
issm/trunk-jpl/src/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/HydrologySommersAnalysis.cpp

    r20690 r21145  
    88#define OMEGA 0.001    // parameter controlling transition to nonlinear resistance in basal system (dimensionless)
    99#define NU    1.787e-6 //kinematic water viscosity m^2/s
     10#define CT    7.5e-8  // Clapeyron slope (K/Pa)
     11#define CW    4.22e3   // specific heat capacity of water (J/kg/K)
    1012
    1113/*Model processing*/
     
    176178        /*Get conductivity from inputs*/
    177179        IssmDouble conductivity = GetConductivity(element);
     180//if(element->Id()==1){
     181//      printf("Conductivity at CreateKMatrix: %g \n",conductivity);
     182//}
    178183
    179184        /* Start  looping on the number of gaussian points: */
     
    208213        IssmDouble  lr,br,vx,vy,beta;
    209214        IssmDouble  alpha2,frictionheat;
     215   IssmDouble  PMPheat,dpressure_water[2],dbed[2];     
    210216        IssmDouble* xyz_list = NULL;
    211217
     
    238244        /*Get conductivity from inputs*/
    239245        IssmDouble conductivity = GetConductivity(element);
     246//if(element->Id()==1){
     247//      printf("Conductivity in CreatePVector: %g \n",conductivity);
     248//}
    240249
    241250        /*Build friction element, needed later: */
     
    251260                geothermalflux_input->GetInputValue(&G,gauss);
    252261                base_input->GetInputValue(&bed,gauss);
     262                base_input->GetInputDerivativeValue(&dbed[0],xyz_list,gauss);
    253263                thickness_input->GetInputValue(&thickness,gauss);
    254264                gap_input->GetInputValue(&gap,gauss);
     
    283293                if(pressure_water>pressure_ice) pressure_water = pressure_ice;
    284294
    285                 meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1]));
     295                /*Compute change in sensible heat due to changes in pressure melting point*/
     296        dpressure_water[0] = rho_water*g*(dh[0] - dbed[0]);
     297                dpressure_water[1] = rho_water*g*(dh[1] - dbed[1]);
     298                PMPheat=-CT*CW*conductivity*(dh[0]*dpressure_water[0]+dh[1]*dpressure_water[1]);
     299
     300                meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1])-PMPheat);
    286301                _assert_(meltrate>0.);
    287 
     302               
    288303                for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
    289304                 (
     
    315330        IssmDouble* xyz_list = NULL;
    316331
     332        /*Get gravity from parameters*/
     333           IssmDouble  g = element->GetMaterialParameter(ConstantsGEnum);
     334
    317335        /*Fetch number of nodes for this finite element*/
    318336        int numnodes = element->GetNumberOfNodes();
     
    323341
    324342        /*Get thickness and base on nodes to apply cap on water head*/
     343   IssmDouble* eff_pressure = xNew<IssmDouble>(numnodes);
    325344        IssmDouble* thickness = xNew<IssmDouble>(numnodes);
    326345        IssmDouble* bed       = xNew<IssmDouble>(numnodes);
     
    344363                }
    345364
     365                /*Calculate effective pressure*/
     366                eff_pressure[i] = rho_ice*g*thickness[i] - rho_water*g*(values[i]-bed[i]);
     367       
    346368                if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
    347369                if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector");
     
    350372        /*Add input to the element: */
    351373        element->AddInput(HydrologyHeadEnum,values,element->GetElementType());
     374   element->AddInput(EffectivePressureEnum,eff_pressure,P1Enum);
    352375
    353376        /*Update reynolds number according to new solution*/
     
    356379        head_input->GetInputDerivativeAverageValue(&dh[0],xyz_list);
    357380        IssmDouble conductivity = GetConductivity(element);
     381//if(element->Id()==1){
     382//      printf("Conductivity in UpdateInputFromSolution: %g \n",conductivity);
     383//}
     384
    358385        IssmDouble reynolds = conductivity*sqrt(dh[0]*dh[0]+dh[1]*dh[1])/(2.*NU);
    359386        element->AddInput(HydrologyReynoldsEnum,&reynolds,P0Enum);
     
    365392        xDelete<IssmDouble>(xyz_list);
    366393        xDelete<int>(doflist);
     394        xDelete<IssmDouble>(eff_pressure);
    367395}/*}}}*/
    368396void           HydrologySommersAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
     
    385413        reynolds_input->GetInputAverage(&reynolds);
    386414        gap_input->GetInputAverage(&gap);
    387 
     415       
    388416        /*Compute conductivity*/
    389417        IssmDouble conductivity = pow(gap,3)*g/(12.*NU*(1+OMEGA*reynolds));
     
    414442        IssmDouble  alpha2,frictionheat;
    415443        IssmDouble* xyz_list = NULL;
    416 
     444   IssmDouble  dpressure_water[2],dbed[2],PMPheat;
    417445
    418446        /*Retrieve all inputs and parameters*/
     
    438466        /*Get conductivity from inputs*/
    439467        IssmDouble conductivity = GetConductivity(element);
    440 
     468//if(element->Id()==1){
     469//      printf("Conductivity at gap update: %g \n",conductivity);
     470//}
    441471        /*Build friction element, needed later: */
    442472        Friction* friction=new Friction(element,2);
     
    454484                geothermalflux_input->GetInputValue(&G,gauss);
    455485                base_input->GetInputValue(&bed,gauss);
     486                base_input->GetInputDerivativeValue(&dbed[0],xyz_list,gauss);
    456487                thickness_input->GetInputValue(&thickness,gauss);
    457488                gap_input->GetInputValue(&gap,gauss);
     
    486517                if(pressure_water>pressure_ice) pressure_water = pressure_ice;
    487518     
    488 
    489                 meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1]));
     519      /* Compute change in sensible heat due to changes in pressure melting point*/
     520           dpressure_water[0] = rho_water*g*(dh[0] - dbed[0]);
     521                dpressure_water[1] = rho_water*g*(dh[1] - dbed[1]);
     522                PMPheat=-CT*CW*conductivity*(dh[0]*dpressure_water[0]+dh[1]*dpressure_water[1]);
     523       
     524                meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1])-PMPheat);
    490525                _assert_(meltrate>0.);
    491526
  • issm/trunk-jpl/src/c/cores/hydrology_core.cpp

    r19749 r21145  
    8888                if(save_results){
    8989                        if(VerboseSolution()) _printf0_("   saving results \n");
    90                         int outputs[2] = {HydrologyHeadEnum,HydrologyGapHeightEnum};
    91                         femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],2);
     90                        int outputs[3] = {HydrologyHeadEnum,HydrologyGapHeightEnum,EffectivePressureEnum};
     91                        femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],3);
    9292                       
    9393                        /*unload results*/
Note: See TracChangeset for help on using the changeset viewer.