Changeset 27026


Ignore:
Timestamp:
05/25/22 22:57:32 (3 years ago)
Author:
Cheng Gong
Message:

ADD: independentrate in calvingtest, with the direction in the outward normal of the calving front (not the flow velocity)

Location:
issm/trunk-jpl/src
Files:
4 edited

Legend:

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

    r27020 r27026  
    197197                        break;
    198198                case CalvingTestEnum:
    199                         iomodel->FetchData(&transparam,&N,&M,"md.calving.speedfactor");
    200199                        iomodel->FindConstant(&interp,"md.timestepping.interp_forcing");
    201200                        iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
     201                        iomodel->FetchData(&transparam,&N,&M,"md.calving.speedfactor");
    202202                        if(N==1){
    203203                                _assert_(M==1);
     
    207207            _assert_(N==2);
    208208            parameters->AddObject(new TransientParam(CalvingTestSpeedfactorEnum,&transparam[0],&transparam[M],interp,cycle,M));
     209         }
     210                        xDelete<IssmDouble>(transparam);
     211                        iomodel->FetchData(&transparam,&N,&M,"md.calving.independentrate");
     212                        if(N==1){
     213                                _assert_(M==1);
     214                                parameters->AddObject(new DoubleParam(CalvingTestIndependentRateEnum,transparam[0]));
     215         }
     216         else{
     217            _assert_(N==2);
     218            parameters->AddObject(new TransientParam(CalvingTestIndependentRateEnum,&transparam[0],&transparam[M],interp,cycle,M));
    209219         }
    210220                        xDelete<IssmDouble>(transparam);
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r27020 r27026  
    372372        IssmDouble  calvingratey[NUMVERTICES];
    373373        IssmDouble  calvingrate[NUMVERTICES];
    374         IssmDouble  vx,vy;
     374        IssmDouble  vx,vy,vel;
     375        IssmDouble  dphidx, dphidy, dphi;
    375376        IssmDouble  time;
    376         IssmDouble  coeff;
     377        IssmDouble  coeff, indrate;
    377378
    378379        /*Retrieve all inputs and parameters we will need*/
    379380        parameters->FindParam(&time,TimeEnum);
    380381        parameters->FindParam(&coeff,CalvingTestSpeedfactorEnum,time);
     382        parameters->FindParam(&indrate,CalvingTestIndependentRateEnum,time);
    381383
    382384        Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input);
    383385        Input* vy_input = this->GetInput(VyEnum); _assert_(vy_input);
     386        Input *lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
     387   Input *lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
    384388
    385389        /* Start looping on the number of vertices: */
     
    392396                vy_input->GetInputValue(&vy,&gauss);
    393397
    394                 calvingratex[iv]= coeff*vx;
    395                 calvingratey[iv]= coeff*vy;
     398                lsf_slopex_input->GetInputValue(&dphidx,&gauss);
     399      lsf_slopey_input->GetInputValue(&dphidy,&gauss);
     400
     401      vel=sqrt(vx*vx + vy*vy) + 1e-14;
     402      dphi=sqrt(dphidx*dphidx+dphidy*dphidy)+ 1e-14;
     403
     404                calvingratex[iv]= coeff*vx + indrate*dphidx/dphi;
     405                calvingratey[iv]= coeff*vy + indrate*dphidy/dphi;
    396406                calvingrate[iv] = sqrt(calvingratex[iv]*calvingratex[iv] + calvingratey[iv]*calvingratey[iv]);
    397 
    398407        }
    399408
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r27009 r27026  
    107107        CalvingMinthicknessEnum,
    108108        CalvingTestSpeedfactorEnum,
     109        CalvingTestIndependentRateEnum,
    109110        CalvingUseParamEnum,
    110111        CalvingScaleThetaEnum,
  • issm/trunk-jpl/src/m/classes/calvingtest.m

    r27021 r27026  
    77        properties (SetAccess=public)
    88                speedfactor = 1;
     9                independentrate = 0;
    910        end
    1011        methods
     
    3132                function self = setdefaultparameters(self) % {{{
    3233                        self.speedfactor = 1;
     34                        self.independentrate = 0;
    3335                end % }}}
    3436                function md = checkconsistency(self,md,solution,analyses) % {{{
     
    3638                        if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
    3739                        md = checkfield(md,'fieldname','calving.speedfactor','>=',0,'NaN',1,'Inf',1, 'singletimeseries', 1);
     40                        md = checkfield(md,'fieldname','calving.independentrate','NaN',1,'Inf',1, 'singletimeseries', 1);
    3841                end % }}}
    3942                function disp(self) % {{{
    4043                        disp(sprintf('   Calving test parameters:'));
    4144                        fielddisplay(self,'speedfactor','calving rate is proportional to the ice velocity (e.g. speedfactor=1 -> calving front should not move)');
     45                        fielddisplay(self,'independentrate','calving rate is independent of the ice velocity.');
    4246                end % }}}
    4347                function marshall(self,prefix,md,fid) % {{{
     
    4549                        WriteData(fid,prefix,'name','md.calving.law','data',8,'format','Integer');
    4650                        WriteData(fid,prefix,'object',self,'fieldname','speedfactor','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
     51                        WriteData(fid,prefix,'object',self,'fieldname','independentrate','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./yts);
    4752                end % }}}
    4853        end
Note: See TracChangeset for help on using the changeset viewer.