Changeset 18745


Ignore:
Timestamp:
11/06/14 10:02:00 (10 years ago)
Author:
bdef
Message:

CHG: Now applying exponential heavyside approximation to the two forks of transfer term computation

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

Legend:

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

    r18723 r18745  
    426426        IssmDouble epl_head,sediment_head;
    427427        IssmDouble leakage,transfer;
     428        IssmDouble continuum, factor;
    428429        HydrologyDCInefficientAnalysis* inefanalysis = NULL;
    429430
     
    448449                element->FindParam(&leakage,HydrologydcLeakageFactorEnum);
    449450               
    450                 if(epl_head>sediment_head){ 
    451                         /* if(sediment_head>=hmax){ */
    452                         /*      transfer=0.0; */
    453                         /* } */
    454                         /* else{ */
    455                         /*      transfer=(leakage); */
    456                         /* } */
    457                         transfer=leakage*(1/(1+exp(-20.0*(hmax-sediment_head))));
    458                 }
    459                 else{
    460                         transfer=(leakage);
    461                        
    462                 }
     451                //Computing continuum function to apply to transfer term, transfer is null only if
     452                // epl_head>sediment_head AND sediment_head>h_max
     453                continuum=((1.0/(1.0+exp(-20.0*(sediment_head-epl_head)))))+(1.0/(1.0+exp(-20.0*(hmax-sediment_head))));
     454                factor=max(continuum,1.0);
     455                transfer=leakage*factor;
    463456                break;
    464457        default:
     
    474467        IssmDouble epl_head,sediment_head;
    475468        IssmDouble leakage,transfer;
     469        IssmDouble continuum, factor;
    476470
    477471        HydrologyDCInefficientAnalysis* inefanalysis = NULL;
     
    497491                element->FindParam(&leakage,HydrologydcLeakageFactorEnum);
    498492
    499                 if(epl_head>sediment_head){ 
    500                         /* if(sediment_head>=hmax){ */
    501                         /*      transfer=0.0; */
    502                         /* } */
    503                         /* else{ */
    504                         /*      transfer=(sediment_head*leakage); */
    505                         /* } */
    506                         transfer=sediment_head*leakage*(1/(1+exp(-20.0*(hmax-sediment_head))));
    507                 }
    508                 else{
    509                         transfer=(sediment_head*leakage);
    510                 }
     493                //Computing continuum function to apply to transfer term, transfer is null only if
     494                // epl_head>sediment_head AND sediment_head>h_max
     495                continuum=((1.0/(1.0+exp(-20.0*(sediment_head-epl_head)))))+(1.0/(1.0+exp(-20.0*(hmax-sediment_head))));
     496                factor=max(continuum,1.0);
     497                transfer=sediment_head*leakage*factor;
     498
    511499                break;
    512500        default:
     
    738726void HydrologyDCEfficientAnalysis::HydrologyEPLGetActive(Vector<IssmDouble>* active_vec, Element* element){
    739727        /*Constants*/
    740 
    741728        int      domaintype;
    742729        Element*   basalelement=NULL;
     
    760747               
    761748        basalelement->GetInputListOnVertices(&active[0],HydrologydcMaskEplactiveNodeEnum);
    762 
    763749        bool active_element;
    764        
    765750        Input*  active_element_input=basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);           
    766751        active_element_input->GetInputValue(&active_element);
    767 
    768752       
    769753        for(int i=0;i<numnodes;i++) flag+=active[i];
     
    775759        }
    776760        else if(active_element){
    777                 /*Checking Stuff*/
    778761                for(int i=0;i<numnodes;i++){
    779762                        active_vec->SetValue(basalelement->nodes[i]->Sid(),1.,INS_VAL);
     
    781764        }
    782765        else{
    783                 /*Do not do anything: at least one node was active for this element but this element is not solved for*/
     766                /*Do not do anything: at least one node is active for this element but this element is not solved for*/
    784767        }
    785768        if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
  • issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp

    r18719 r18745  
    593593        IssmDouble epl_head,sediment_head;
    594594        IssmDouble leakage,transfer;
    595 
     595        IssmDouble continuum, factor;
     596       
    596597        element->FindParam(&transfermethod,HydrologydcTransferFlagEnum);
    597598
     
    611612
    612613                hmax=GetHydrologyDCInefficientHmax(element, gauss, thick_input, base_input);
    613                
    614                 if(epl_head>sediment_head){ 
    615                         /* if(sediment_head>=hmax){ */
    616                         /*      transfer=0.0; */
    617                         /* } */
    618                         /* else{ */
    619                         /*      transfer=(leakage); */
    620                         /* } */
    621                         transfer=leakage*(1/(1+exp(-20.0*(hmax-sediment_head))));
    622                 }
    623                 else{
    624                         transfer=(leakage);
    625                 }               
     614       
     615                //Computing continuum function to apply to transfer term, transfer is null only if
     616                //epl_head>sediment_head AND sediment_head>h_max
     617                continuum=((1.0/(1.0+exp(-20.0*(sediment_head-epl_head)))))+(1.0/(1.0+exp(-20.0*(hmax-sediment_head))));
     618                factor=max(continuum,1.0);
     619                transfer=leakage*factor;
     620
    626621                break;
    627622        default:
     
    637632        IssmDouble epl_head,sediment_head;
    638633        IssmDouble leakage,transfer;
    639 
     634        IssmDouble continuum, factor;
     635       
    640636        element->FindParam(&transfermethod,HydrologydcTransferFlagEnum);
    641637
     
    656652                hmax=GetHydrologyDCInefficientHmax(element, gauss, thick_input, base_input);
    657653               
    658                 if(epl_head>sediment_head){ 
    659                         /* if(sediment_head>=hmax){ */
    660                         /*      transfer=0.0; */
    661                         /* } */
    662                         /* else{ */
    663                         /*      transfer=(epl_head*leakage); */
    664                         /* } */
    665                         transfer=epl_head*leakage*(1/(1+exp(-20.0*(hmax-sediment_head))));
    666                 }
    667                 else{
    668                         transfer=(epl_head*leakage);
    669                 }
     654                //Computing continuum function to apply to transfer term, transfer is null only if
     655                //epl_head>sediment_head AND sediment_head>h_max
     656                continuum=((1.0/(1.0+exp(-20.0*(sediment_head-epl_head)))))+(1.0/(1.0+exp(-20.0*(hmax-sediment_head))));
     657                factor=max(continuum,1.0);
     658                transfer=epl_head*leakage*factor;
    670659                break;
    671660        default:
Note: See TracChangeset for help on using the changeset viewer.