Changeset 14660


Ignore:
Timestamp:
04/19/13 13:48:09 (12 years ago)
Author:
bdef
Message:

CHG: Adding parameters to the HydroDC matrix construction

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

Legend:

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

    r14652 r14660  
    57585758}
    57595759/*}}}*/
    5760 /*FUNCTION Tria::CreateKMatrixHydrologyShreve{{{*/
     5760/*FUNCTION Tria::CreateKMatrixHydrologyShreve(void){{{*/
    57615761ElementMatrix* Tria::CreateKMatrixHydrologyShreve(void){
    5762 
     5762       
    57635763        /*Constants*/
    57645764        const int  numdof=NDOF1*NUMVERTICES;
    5765 
    5766         /*Intermediaries */
     5765       
     5766/*Intermediaries */
    57675767        IssmDouble diffusivity;
    57685768        IssmDouble Jdettria,DL_scalar,dt,h;
     
    57795779        IssmDouble DLprime[2][2]                   ={0.0};
    57805780        GaussTria *gauss=NULL;
    5781 
    5782         /*Skip if water or ice shelf element*/
     5781       
     5782/*Skip if water or ice shelf element*/
    57835783        if(IsOnWater() | IsFloating()) return NULL;
    5784 
    5785         /*Initialize Element matrix*/
     5784       
     5785/*Initialize Element matrix*/
    57865786        ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    5787 
    5788         /*Create water velocity vx and vy from current inputs*/
     5787       
     5788/*Create water velocity vx and vy from current inputs*/
    57895789        CreateHydrologyWaterVelocityInput();
    5790 
    5791         /*Retrieve all inputs and parameters*/
     5790       
     5791/*Retrieve all inputs and parameters*/
    57925792        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    57935793        this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
     
    57965796        Input* vy_input=inputs->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
    57975797        h=sqrt(2*this->GetArea());
    5798 
    5799         /* Start  looping on the number of gaussian points: */
     5798       
     5799/* Start  looping on the number of gaussian points: */
    58005800        gauss=new GaussTria(2);
    58015801        for(int ig=gauss->begin();ig<gauss->end();ig++){
    5802 
     5802               
    58035803                gauss->GaussPoint(ig);
    5804 
     5804               
    58055805                GetJacobianDeterminant(&Jdettria, &xyz_list[0][0],gauss);
    58065806                GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
    5807 
     5807               
    58085808                vx_input->GetInputValue(&vx,gauss);
    58095809                vy_input->GetInputValue(&vy,gauss);
    58105810                vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
    58115811                vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
    5812 
     5812               
    58135813                DL_scalar=gauss->weight*Jdettria;
    5814 
     5814               
    58155815                TripleMultiply( &L[0],1,numdof,1,
    5816                                         &DL_scalar,1,1,0,
    5817                                         &L[0],1,numdof,0,
    5818                                         &Ke->values[0],1);
    5819 
     5816                                                                                &DL_scalar,1,1,0,
     5817                                                                                &L[0],1,numdof,0,
     5818                                                                                &Ke->values[0],1);
     5819               
    58205820                GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss);
    58215821                GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
    5822 
     5822               
    58235823                dvxdx=dvx[0];
    58245824                dvydy=dvy[1];
    58255825                DL_scalar=dt*gauss->weight*Jdettria;
    5826 
     5826               
    58275827                DL[0][0]=DL_scalar*dvxdx;
    58285828                DL[1][1]=DL_scalar*dvydy;
    58295829                DLprime[0][0]=DL_scalar*vx;
    58305830                DLprime[1][1]=DL_scalar*vy;
    5831 
     5831               
    58325832                TripleMultiply( &B[0][0],2,numdof,1,
    5833                                         &DL[0][0],2,2,0,
    5834                                         &B[0][0],2,numdof,0,
    5835                                         &Ke->values[0],1);
    5836 
     5833                                                                                &DL[0][0],2,2,0,
     5834                                                                                &B[0][0],2,numdof,0,
     5835                                                                                &Ke->values[0],1);
     5836               
    58375837                TripleMultiply( &B[0][0],2,numdof,1,
    5838                                         &DLprime[0][0],2,2,0,
    5839                                         &Bprime[0][0],2,numdof,0,
    5840                                         &Ke->values[0],1);
    5841 
     5838                                                                                &DLprime[0][0],2,2,0,
     5839                                                                                &Bprime[0][0],2,numdof,0,
     5840                                                                                &Ke->values[0],1);
     5841               
    58425842                /*Artificial diffusivity*/
    58435843                vel=sqrt(vx*vx+vy*vy);
     
    58505850                KDL[0][1]=DL_scalar*K[0][1];
    58515851                KDL[1][1]=DL_scalar*K[1][1];
    5852 
     5852               
    58535853                TripleMultiply( &Bprime[0][0],2,numdof,1,
    5854                                         &KDL[0][0],2,2,0,
    5855                                         &Bprime[0][0],2,numdof,0,
    5856                                         &Ke->values[0],1);
    5857         }
    5858 
    5859         /*Clean up and return*/
     5854                                                                                &KDL[0][0],2,2,0,
     5855                                                                                &Bprime[0][0],2,numdof,0,
     5856                                                                                &Ke->values[0],1);
     5857        }
     5858       
     5859/*Clean up and return*/
    58605860        delete gauss;
    58615861        return Ke;
     
    58705870        /* Intermediaries */
    58715871        IssmDouble  D_scalar,Jdet;
    5872         IssmDouble  sediment_porosity,dt;
     5872        IssmDouble  sediment_compressibility, sediment_porosity, sediment_thickness,
     5873                sediment_transmitivity, water_compressibility, rho_freshwater, gravity, dt;
     5874        IssmDouble  sediment_storing;
    58735875        IssmDouble  xyz_list[NUMVERTICES][3];
    58745876        IssmDouble  B[2][numdof];
    5875         IssmDouble L[NUMVERTICES];
     5877        IssmDouble  L[NUMVERTICES];
    58765878        IssmDouble  D[2][2];
    5877         GaussTria  *gauss = NULL;
     5879        GaussTria   *gauss = NULL;
    58785880
    58795881        /*Initialize Element matrix*/
     
    58825884        /*Retrieve all inputs and parameters*/
    58835885        GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES);
    5884         sediment_porosity = matpar->GetSedimentPorosity();
     5886        sediment_compressibility                        = matpar->GetSedimentCompressibility();
     5887        sediment_porosity                                                       = matpar->GetSedimentPorosity();
     5888        sediment_thickness                                              = matpar->GetSedimentThickness();
     5889        sediment_transmitivity                          = matpar->GetSedimentTransmitivity();
     5890        water_compressibility                                   = matpar->GetWaterCompressibility();
     5891        rho_freshwater                                                          = matpar->GetRhoFreshwater();
     5892        gravity                                                                                         = matpar->GetG();
     5893       
    58855894        this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
     5895
     5896        /*Compute Storing coefficient fro the above */
     5897
     5898        sediment_storing = rho_freshwater*gravity*sediment_porosity*sediment_thickness*
     5899                (water_compressibility+(sediment_compressibility/sediment_porosity));
    58865900
    58875901        /* Start looping on the number of gaussian points: */
     
    59005914                GetBHydro(&B[0][0],&xyz_list[0][0],gauss);
    59015915                TripleMultiply(&B[0][0],2,numdof,1,
    5902                                         &D[0][0],2,2,0,
    5903                                         &B[0][0],2,numdof,0,
    5904                                         &Ke->values[0],1);
     5916                                                                         &D[0][0],2,2,0,
     5917                                                                         &B[0][0],2,numdof,0,
     5918                                                                         &Ke->values[0],1);
    59055919
    59065920                /*Transient*/
     
    59085922                        GetL(&L[0], &xyz_list[0][0], gauss,NDOF1);
    59095923                        D_scalar=gauss->weight*Jdet;
    5910 
     5924                       
    59115925                        TripleMultiply(&L[0],numdof,1,0,
    5912                                                 &D_scalar,1,1,0,
    5913                                                 &L[0],1,numdof,0,
    5914                                                 &Ke->values[0],1);
     5926                                                                                 &D_scalar,1,1,0,
     5927                                                                                 &L[0],1,numdof,0,
     5928                                                                                 &Ke->values[0],1);
    59155929                }
    59165930        }
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h

    r14655 r14660  
    111111                IssmDouble GetSedimentTransmitivity();
    112112                IssmDouble GetWaterCompressibility();
    113                 IssmDouble GetWaterDensity();
    114113                IssmDouble TMeltingPoint(IssmDouble pressure);
    115114                IssmDouble PureIceEnthalpy(IssmDouble pressure);
Note: See TracChangeset for help on using the changeset viewer.