Changeset 11355


Ignore:
Timestamp:
02/07/12 15:49:52 (13 years ago)
Author:
seroussi
Message:

got confused between thermal and enthalpy model ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/Elements/Penta.cpp

    r11351 r11355  
    38543854        double     rho_ice,heatcapacity,geothermalflux_value;
    38553855        double     basalfriction,alpha2,vx,vy;
    3856         double     scalar;
     3856        double     scalar,enthalpy,enthalpyup;
     3857        double     pressure,pressureup;
    38573858        double     basis[NUMVERTICES];
    38583859        Friction*  friction=NULL;
    38593860        GaussPenta* gauss=NULL;
     3861        GaussPenta* gaussup=NULL;
    38603862
    38613863        /* Geothermal flux on ice sheet base and basal friction */
     
    38753877        Input* vy_input=inputs->GetInput(VyEnum);                         _assert_(vy_input);
    38763878        Input* vz_input=inputs->GetInput(VzEnum);                         _assert_(vz_input);
     3879        Input* enthalpy_input=inputs->GetInput(EnthalpyEnum);             _assert_(enthalpy_input);
     3880        Input* pressure_input=inputs->GetInput(PressureEnum);             _assert_(pressure_input);
    38773881        Input* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
    38783882
     
    38823886        /* Start looping on the number of gauss 2d (nodes on the bedrock) */
    38833887        gauss=new GaussPenta(0,1,2,2);
     3888        gaussup=new GaussPenta(3,4,5,2);
    38843889        for(ig=gauss->begin();ig<gauss->end();ig++){
    38853890
    38863891                gauss->GaussPoint(ig);
     3892                gaussup->GaussPoint(ig);
    38873893
    38883894                GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
    38893895                GetNodalFunctionsP1(&basis[0], gauss);
    38903896
    3891                 geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
    3892                 friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
    3893                 vx_input->GetInputValue(&vx,gauss);
    3894                 vy_input->GetInputValue(&vy,gauss);
    3895                 basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
    3896                
    3897                 scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice);
    3898                 if(dt) scalar=dt*scalar;
    3899 
    3900                 for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
     3897                enthalpy_input->GetInputValue(&enthalpy,gauss);
     3898                pressure_input->GetInputValue(&pressure,gauss);
     3899                if(enthalpy>matpar->PureIceEnthalpy(pressure)){
     3900                        enthalpy_input->GetInputValue(&enthalpyup,gaussup);
     3901                        pressure_input->GetInputValue(&pressureup,gaussup);
     3902                        if(enthalpyup>matpar->PureIceEnthalpy(pressureup)){
     3903                                //do nothing, don't add heatflux
     3904                        }
     3905                        else{
     3906                                //need to change spcenthalpy according to Aschwanden
     3907                                //NEED TO UPDATE
     3908                        }
     3909                }
     3910                else{
     3911                        geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
     3912                        friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
     3913                        vx_input->GetInputValue(&vx,gauss);
     3914                        vy_input->GetInputValue(&vy,gauss);
     3915                        basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
     3916
     3917                        scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice);
     3918                        if(dt) scalar=dt*scalar;
     3919
     3920                        for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
     3921                }
    39013922        }
    39023923
    39033924        /*Clean up and return*/
    39043925        delete gauss;
     3926        delete gaussup;
    39053927        delete friction;
    39063928        return pe;
     
    40854107        double     rho_ice,heatcapacity,geothermalflux_value;
    40864108        double     basalfriction,alpha2,vx,vy;
    4087         double     scalar,enthalpy,enthalpyup;
    4088         double     pressure,pressureup;
    40894109        double     basis[NUMVERTICES];
     4110        double     scalar;
    40904111        Friction*  friction=NULL;
    40914112        GaussPenta* gauss=NULL;
    4092         GaussPenta* gaussup=NULL;
    40934113
    40944114        /* Geothermal flux on ice sheet base and basal friction */
     
    41084128        Input* vy_input=inputs->GetInput(VyEnum);                         _assert_(vy_input);
    41094129        Input* vz_input=inputs->GetInput(VzEnum);                         _assert_(vz_input);
    4110         Input* pressure_input=inputs->GetInput(PressureEnum);             _assert_(pressure_input);
    4111         Input* enthalpy_input=inputs->GetInput(EnthalpyEnum);             _assert_(enthalpy_input);
    41124130        Input* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
    41134131
     
    41174135        /* Start looping on the number of gauss 2d (nodes on the bedrock) */
    41184136        gauss=new GaussPenta(0,1,2,2);
    4119         gaussup=new GaussPenta(3,4,5,2);
    41204137        for(ig=gauss->begin();ig<gauss->end();ig++){
    41214138
    41224139                gauss->GaussPoint(ig);
    4123                 gaussup->GaussPoint(ig);
    41244140
    41254141                GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
    41264142                GetNodalFunctionsP1(&basis[0], gauss);
    41274143
    4128                 enthalpy_input->GetInputValue(&enthalpy,gauss);
    4129                 pressure_input->GetInputValue(&pressure,gauss);
    4130 //              if(enthalpy>matpar->PureIceEnthalpy(pressure)){
    4131 //                      enthalpy_input->GetInputValue(&enthalpyup,gaussup);
    4132 //                      pressure_input->GetInputValue(&pressureup,gaussup);
    4133 //                      if(enthalpyup>matpar->PureIceEnthalpy(pressureup)){
    4134 //                              //do nothing, don't add heatflux
    4135 //                      }
    4136 //                      else{
    4137 //                              //need to change spcenthalpy according to Aschwanden
    4138 //                              //NEED TO UPDATE
    4139 //                      }
    4140 //              }
    4141 //              else{
    41424144                        geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
    41434145                        friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
     
    41504152
    41514153                        for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
    4152 //              }
    41534154        }
    41544155
    41554156        /*Clean up and return*/
    41564157        delete gauss;
    4157         delete gaussup;
    41584158        delete friction;
    41594159        return pe;
Note: See TracChangeset for help on using the changeset viewer.