Changeset 27294


Ignore:
Timestamp:
10/05/22 08:54:44 (2 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added CFL for hydro models

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

Legend:

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

    r27287 r27294  
    39013901
    39023902        /*intermediary: */
     3903        bool       ishydro;
    39033904        IssmDouble C;
    39043905        IssmDouble xyz_list[NUMVERTICES][3];
     
    39063907        /*get CFL coefficient:*/
    39073908        this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
     3909        this->parameters->FindParam(&ishydro,TransientIshydrologyEnum);
    39083910
    39093911        /*Get for Vx and Vy, the max of abs value: */
     
    39393941        /*CFL criterion: */
    39403942        IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy+maxabsvz/dz + 1.e-18);
     3943
     3944        /*Check hydro timestep also and take the minimum*/
     3945        if(ishydro){
     3946                if(IsOnBase()){
     3947                        Input* vx_input = this->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
     3948                        Input* vy_input = this->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
     3949                        IssmDouble maxabsvx = vx_input->GetInputMaxAbs();
     3950                        IssmDouble maxabsvy = vy_input->GetInputMaxAbs();
     3951
     3952                        /*CFL criterion: */
     3953                        IssmDouble dt2 = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
     3954                        if(dt2<dt) dt = dt2;
     3955                }
     3956        }
    39413957
    39423958        return dt;
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r27287 r27294  
    52535253
    52545254        /*intermediary: */
     5255        bool       ishydro;
    52555256        IssmDouble C;
    52565257        IssmDouble xyz_list[NUMVERTICES][3];
     
    52585259        /*get CFL coefficient:*/
    52595260        this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
     5261        this->parameters->FindParam(&ishydro,TransientIshydrologyEnum);
    52605262
    52615263        /*Get for Vx and Vy, the max of abs value: */
     
    52845286        /*CFL criterion: */
    52855287        IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
     5288
     5289        /*Check hydro timestep also and take the minimum*/
     5290        if(ishydro){
     5291                Input* vx_input = this->GetInput(HydrologyWaterVxEnum); _assert_(vx_input);
     5292                Input* vy_input = this->GetInput(HydrologyWaterVyEnum); _assert_(vy_input);
     5293                IssmDouble maxabsvx = vx_input->GetInputMaxAbs();
     5294                IssmDouble maxabsvy = vy_input->GetInputMaxAbs();
     5295
     5296                /*CFL criterion: */
     5297                IssmDouble dt2 = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
     5298                if(dt2<dt) dt = dt2;
     5299        }
    52865300
    52875301        return dt;
Note: See TracChangeset for help on using the changeset viewer.