Ignore:
Timestamp:
05/24/11 11:29:04 (14 years ago)
Author:
seroussi
Message:

moved thermal PVectors from Tria to Penta

File:
1 edited

Legend:

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

    r8409 r8410  
    25142514        /*Clean up and return*/
    25152515        delete gauss;
    2516         return pe;
    2517 }
    2518 /*}}}*/
    2519 /*FUNCTION Tria::CreatePVectorThermalShelf {{{1*/
    2520 ElementVector* Tria::CreatePVectorThermalShelf(void){
    2521        
    2522         /*Constants*/
    2523         const int  numdof=NUMVERTICES*NDOF1;
    2524 
    2525         /*Intermediaries */
    2526         int        i,ig;
    2527         double     Jdet;
    2528         double     mixed_layer_capacity,thermal_exchange_velocity;
    2529         double     rho_ice,rho_water,pressure,dt,scalar_ocean;
    2530         double     meltingpoint,beta,heatcapacity,t_pmp;
    2531         double     xyz_list[NUMVERTICES][3];
    2532         double     l1l2l3[NUMVERTICES];
    2533         GaussTria* gauss=NULL;
    2534 
    2535         /*Initialize Element vector*/
    2536         ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    2537 
    2538         /*Retrieve all inputs and parameters*/
    2539         GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    2540         mixed_layer_capacity=matpar->GetMixedLayerCapacity();
    2541         thermal_exchange_velocity=matpar->GetThermalExchangeVelocity();
    2542         rho_water=matpar->GetRhoWater();
    2543         rho_ice=matpar->GetRhoIce();
    2544         heatcapacity=matpar->GetHeatCapacity();
    2545         beta=matpar->GetBeta();
    2546         meltingpoint=matpar->GetMeltingPoint();
    2547         this->parameters->FindParam(&dt,DtEnum);
    2548         Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
    2549 
    2550         /* Start looping on the number of gauss 2d (nodes on the bedrock) */
    2551         gauss=new GaussTria(2);
    2552         for(ig=gauss->begin();ig<gauss->end();ig++){
    2553 
    2554                 gauss->GaussPoint(ig);
    2555 
    2556                 GetJacobianDeterminant3d(&Jdet, &xyz_list[0][0], gauss);
    2557                 GetNodalFunctions(&l1l2l3[0], gauss);
    2558 
    2559                 pressure_input->GetParameterValue(&pressure,gauss);
    2560                 t_pmp=meltingpoint-beta*pressure;
    2561 
    2562                 scalar_ocean=gauss->weight*Jdet*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(t_pmp)/(heatcapacity*rho_ice);
    2563                 if(dt) scalar_ocean=dt*scalar_ocean;
    2564 
    2565                 for(i=0;i<numdof;i++) pe->values[i]+=scalar_ocean*l1l2l3[i];
    2566         }
    2567 
    2568         /*Clean up and return*/
    2569         delete gauss;
    2570         return pe;
    2571 }
    2572 /*}}}*/
    2573 /*FUNCTION Tria::CreatePVectorThermalSheet {{{1*/
    2574 ElementVector* Tria::CreatePVectorThermalSheet(void){
    2575 
    2576         /*Constants*/
    2577         const int  numdof=NUMVERTICES*NDOF1;
    2578 
    2579         /*Intermediaries */
    2580         int        i,ig;
    2581         int        analysis_type,drag_type;
    2582         double     xyz_list[NUMVERTICES][3];
    2583         double     Jdet,dt;
    2584         double     rho_ice,heatcapacity,geothermalflux_value;
    2585         double     basalfriction,alpha2,vx,vy,pressure;
    2586         double     pressure_list[3];
    2587         double     scalar;
    2588         double     l1l2l3[NUMVERTICES];
    2589         Friction*  friction=NULL;
    2590         GaussTria* gauss=NULL;
    2591 
    2592         /*Initialize Element vector*/
    2593         ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    2594 
    2595         /*Retrieve all inputs and parameters*/
    2596         GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    2597         parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    2598         rho_ice=matpar->GetRhoIce();
    2599         heatcapacity=matpar->GetHeatCapacity();
    2600         this->parameters->FindParam(&dt,DtEnum);
    2601         Input* vx_input=inputs->GetInput(VxEnum);                         _assert_(vx_input);
    2602         Input* vy_input=inputs->GetInput(VyEnum);                         _assert_(vy_input);
    2603         Input* vz_input=inputs->GetInput(VzEnum);                         _assert_(vz_input);
    2604         Input* geothermalflux_input=inputs->GetInput(GeothermalFluxEnum); _assert_(geothermalflux_input);
    2605 
    2606         /*Build frictoin element, needed later: */
    2607         inputs->GetParameterValue(&drag_type,DragTypeEnum);
    2608         if (drag_type!=2)_error_(" non-viscous friction not supported yet!");
    2609         friction=new Friction("3d",inputs,matpar,analysis_type);
    2610 
    2611         /* Start looping on the number of gauss 2d (nodes on the bedrock) */
    2612         gauss=new GaussTria(2);
    2613         for(ig=gauss->begin();ig<gauss->end();ig++){
    2614 
    2615                 gauss->GaussPoint(ig);
    2616 
    2617                 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0], gauss);
    2618                 GetNodalFunctions(&l1l2l3[0], gauss);
    2619 
    2620                 geothermalflux_input->GetParameterValue(&geothermalflux_value,gauss);
    2621                 friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
    2622                 vx_input->GetParameterValue(&vx,gauss);
    2623                 vy_input->GetParameterValue(&vy,gauss);
    2624                 basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
    2625                
    2626                 scalar=gauss->weight*Jdet*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice);
    2627                 if(dt) scalar=dt*scalar;
    2628 
    2629                 for(i=0;i<numdof;i++) pe->values[i]+=scalar*l1l2l3[i];
    2630         }
    2631 
    2632         /*Clean up and return*/
    2633         delete gauss;
    2634         delete friction;
    26352516        return pe;
    26362517}
Note: See TracChangeset for help on using the changeset viewer.