Changeset 18501


Ignore:
Timestamp:
09/10/14 21:06:58 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added ocean forcing to stiffness matrix

File:
1 edited

Legend:

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

    r18498 r18501  
    7575        /*Intermediaries */
    7676        IssmDouble  Jdet,D_scalar,dt,thickness,concentration;
     77        IssmDouble  ocean_coef,rho_ocean,ocean_lin_drag_coef,ocean_quad_drag_coef;
     78        IssmDouble  vx,vy,oceanvx,oceanvy,vnorm,ocean_turning_angle;
    7779        IssmDouble  C[3][3];
    7880        IssmDouble* xyz_list = NULL;
     
    9092        element->GetVerticesCoordinates(&xyz_list);
    9193        element->FindParam(&dt,TimesteppingTimeStepEnum);
    92         IssmDouble rho_i               = element->GetMaterialParameter(MaterialsRhoIceEnum);
    93         Input*     thickness_input     = element->GetInput(SeaiceThicknessEnum);     _assert_(thickness_input);
     94        element->FindParam(&ocean_coef,BasalforcingsOceanCoefEnum);
     95        element->FindParam(&ocean_lin_drag_coef,BasalforcingsOceanLinDragCoefEnum);
     96        element->FindParam(&ocean_quad_drag_coef,BasalforcingsOceanQuadDragCoefEnum);
     97        element->FindParam(&ocean_turning_angle,BasalforcingsOceanTurningAngleEnum);
     98        IssmDouble rho_i           = element->GetMaterialParameter(MaterialsRhoIceEnum);
     99        Input*     thickness_input = element->GetInput(SeaiceThicknessEnum);       _assert_(thickness_input);
     100        Input*     vx_input        = element->GetInput(VxEnum);                    _assert_(vx_input);
     101        Input*     vy_input        = element->GetInput(VyEnum);                    _assert_(vy_input);
     102        Input*     oceanvx_input   = element->GetInput(BasalforcingsOceanVxEnum);  _assert_(oceanvx_input);
     103        Input*     oceanvy_input   = element->GetInput(BasalforcingsOceanVyEnum);  _assert_(oceanvy_input);
    94104
    95105        /* Start  looping on the number of gaussian points: */
     
    125135                                        &Ke->values[0],1);
    126136
    127                 /*Create Coriolis part*/
     137                /*Create Ocean forcing part*/
     138                oceanvx_input->GetInputValue(&oceanvx,gauss);
     139                oceanvy_input->GetInputValue(&oceanvy,gauss);
     140                vx_input->GetInputValue(&vx,gauss);
     141                vy_input->GetInputValue(&vy,gauss);
     142                vnorm = sqrt(pow(oceanvx-vx,2) + pow(oceanvy-vy,2));
     143                D_scalar = dt*concentration*ocean_coef*rho_ocean*(ocean_lin_drag_coef+ocean_quad_drag_coef*vnorm)*cos(ocean_turning_angle)*gauss->weight*Jdet;
     144                TripleMultiply(M,1,numdof,1,
     145                                        &D_scalar,1,1,0,
     146                                        M,1,numdof,0,
     147                                        &Ke->values[0],1);
    128148        }
    129149
     
    170190        element->FindParam(&ocean_coef,BasalforcingsOceanCoefEnum);
    171191        element->FindParam(&ocean_lin_drag_coef,BasalforcingsOceanLinDragCoefEnum);
    172         element->FindParam(&ocean_quad_drag_coef,BasalforcingsOceanQuadDragCoefEnum);
    173192        element->FindParam(&ocean_quad_drag_coef,BasalforcingsOceanQuadDragCoefEnum);
    174193        element->FindParam(&ocean_turning_angle,BasalforcingsOceanTurningAngleEnum);
     
    226245                /*Ocean forcing*/
    227246                vnorm = sqrt(pow(oceanvx-vx,2) + pow(oceanvy-vy,2));
    228                 constant_part = concentration*air_coef*rho_air*(air_lin_drag_coef+air_quad_drag_coef*vnorm);
     247                constant_part = concentration*ocean_coef*rho_ocean*(ocean_lin_drag_coef+ocean_quad_drag_coef*vnorm);
    229248                for(int i=0;i<numnodes;i++){
    230249                        pe->values[i*2+0] += dt*constant_part*(oceanvy-vy)*sin(ocean_turning_angle)*Jdet*gauss->weight*basis[i];
Note: See TracChangeset for help on using the changeset viewer.