From d735f445e5c38697c8ade7bce4d41a0d0486253c Mon Sep 17 00:00:00 2001 From: Markus Mueller Date: Sun, 26 Jul 2020 12:13:39 +0200 Subject: [PATCH] removed rbi fallback, removed rth_de --- src/spicelib/devices/hicum2/hicum2.c | 1 - src/spicelib/devices/hicum2/hicum2conv.c | 10 +--- src/spicelib/devices/hicum2/hicum2defs.h | 2 - src/spicelib/devices/hicum2/hicum2mask.c | 3 - src/spicelib/devices/hicum2/hicum2mpar.c | 4 -- src/spicelib/devices/hicum2/hicum2setup.c | 2 - src/spicelib/devices/hicum2/hicumL2.cpp | 72 ++++++----------------- 7 files changed, 20 insertions(+), 74 deletions(-) diff --git a/src/spicelib/devices/hicum2/hicum2.c b/src/spicelib/devices/hicum2/hicum2.c index 03f04ba54..cabec5e29 100644 --- a/src/spicelib/devices/hicum2/hicum2.c +++ b/src/spicelib/devices/hicum2/hicum2.c @@ -273,7 +273,6 @@ IFparm HICUMmPTable[] = { /* model parameters */ //Self-Heating IOP("flsh", HICUM_MOD_FLSH , IF_INTEGER, "Flag for turning on and off self-heating effect"), - IOP("rth_de", HICUM_MOD_RTH_DE , IF_INTEGER, "Experimental flag for turning on and off self-heating using direct evaluation"), IOP("rth", HICUM_MOD_RTH , IF_REAL, "Thermal resistance"), IOP("zetarth", HICUM_MOD_ZETARTH, IF_REAL, "Temperature coefficient for Rth"), IOP("alrth", HICUM_MOD_ALRTH , IF_REAL, "First order relative TC of parameter Rth"), diff --git a/src/spicelib/devices/hicum2/hicum2conv.c b/src/spicelib/devices/hicum2/hicum2conv.c index 9c4adf88d..421c909f6 100644 --- a/src/spicelib/devices/hicum2/hicum2conv.c +++ b/src/spicelib/devices/hicum2/hicum2conv.c @@ -83,15 +83,9 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt) *(ckt->CKTrhsOld+here->HICUMemitEINode)); Vciei = Vbiei - Vbici; - //model->HICUMrth_de - if (model->HICUMrth_de==1) { - Vrth = *(ckt->CKTstate0 + here->HICUMith)*here->HICUMrth_t.rpart; - delvrth = 0; - } else { - Vrth = model->HICUMtype*(*(ckt->CKTrhsOld+here->HICUMtempNode)); - delvrth = Vrth - *(ckt->CKTstate0 + here->HICUMvrth); - } + Vrth = model->HICUMtype*(*(ckt->CKTrhsOld+here->HICUMtempNode)); + delvrth = Vrth - *(ckt->CKTstate0 + here->HICUMvrth); delvbiei = Vbiei - *(ckt->CKTstate0 + here->HICUMvbiei); delvbici = Vbici - *(ckt->CKTstate0 + here->HICUMvbici); delvbpei = Vbpei - *(ckt->CKTstate0 + here->HICUMvbpei); diff --git a/src/spicelib/devices/hicum2/hicum2defs.h b/src/spicelib/devices/hicum2/hicum2defs.h index fa8745a55..0a864dde5 100644 --- a/src/spicelib/devices/hicum2/hicum2defs.h +++ b/src/spicelib/devices/hicum2/hicum2defs.h @@ -703,7 +703,6 @@ typedef struct sHICUMmodel { /* model structure for a hicum */ //Self-Heating int HICUMflsh; - int HICUMrth_de; double HICUMrth; double HICUMzetarth; double HICUMalrth; @@ -1084,7 +1083,6 @@ enum { //Self-Heating HICUM_MOD_FLSH, - HICUM_MOD_RTH_DE, HICUM_MOD_RTH, HICUM_MOD_ZETARTH, HICUM_MOD_ALRTH, diff --git a/src/spicelib/devices/hicum2/hicum2mask.c b/src/spicelib/devices/hicum2/hicum2mask.c index c4fed2a67..efffde670 100644 --- a/src/spicelib/devices/hicum2/hicum2mask.c +++ b/src/spicelib/devices/hicum2/hicum2mask.c @@ -461,9 +461,6 @@ HICUMmAsk(CKTcircuit *ckt, GENmodel *instPtr, int which, IFvalue *value) case HICUM_MOD_FLSH: value->iValue = model->HICUMflsh; return(OK); - case HICUM_MOD_RTH_DE: - value->iValue = model->HICUMrth_de; - return(OK); case HICUM_MOD_RTH: value->rValue = model->HICUMrth; return(OK); diff --git a/src/spicelib/devices/hicum2/hicum2mpar.c b/src/spicelib/devices/hicum2/hicum2mpar.c index 57be1ad19..a054b3b3f 100644 --- a/src/spicelib/devices/hicum2/hicum2mpar.c +++ b/src/spicelib/devices/hicum2/hicum2mpar.c @@ -590,10 +590,6 @@ HICUMmParam(int param, IFvalue *value, GENmodel *inModel) model->HICUMflsh = value->iValue; model->HICUMflshGiven = TRUE; break; - case HICUM_MOD_RTH_DE: - model->HICUMrth_de = value->iValue; - model->HICUMrth_deGiven = TRUE; - break; case HICUM_MOD_RTH: model->HICUMrth = value->rValue; model->HICUMrthGiven = TRUE; diff --git a/src/spicelib/devices/hicum2/hicum2setup.c b/src/spicelib/devices/hicum2/hicum2setup.c index 4cb1657c5..565a3abf4 100644 --- a/src/spicelib/devices/hicum2/hicum2setup.c +++ b/src/spicelib/devices/hicum2/hicum2setup.c @@ -445,8 +445,6 @@ HICUMsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) //Self-Heating if(!model->HICUMflshGiven) model->HICUMflsh = 0; - if(!model->HICUMrth_deGiven) - model->HICUMrth_de = 0; if(!model->HICUMrthGiven) model->HICUMrth = 0.0; diff --git a/src/spicelib/devices/hicum2/hicumL2.cpp b/src/spicelib/devices/hicum2/hicumL2.cpp index d653593ae..010e53e20 100644 --- a/src/spicelib/devices/hicum2/hicumL2.cpp +++ b/src/spicelib/devices/hicum2/hicumL2.cpp @@ -1219,11 +1219,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Vxf1 = *(ckt->CKTrhsOld + here->HICUMxf1Node); Vxf2 = *(ckt->CKTrhsOld + here->HICUMxf2Node); if (selfheat) { - if (model->HICUMrth_de == 1) { - Vrth = *(ckt->CKTstate0 + here->HICUMith)*here->HICUMrth_t.rpart; - } else { - Vrth = *(ckt->CKTstate0 + here->HICUMvrth); - } + Vrth = *(ckt->CKTstate0 + here->HICUMvrth); } } else if(ckt->CKTmode & MODEINITTRAN) { Vbiei = *(ckt->CKTstate1 + here->HICUMvbiei); @@ -1262,11 +1258,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Vxf1 = *(ckt->CKTrhsOld + here->HICUMxf1Node); Vxf2 = *(ckt->CKTrhsOld + here->HICUMxf2Node); if (selfheat) { - if (model->HICUMrth_de == 1) { - Vrth = *(ckt->CKTstate1 + here->HICUMith)*here->HICUMrth_t.rpart; - } else { - Vrth = *(ckt->CKTstate1 + here->HICUMvrth); - } + Vrth = *(ckt->CKTstate1 + here->HICUMvrth); } } else if((ckt->CKTmode & MODEINITJCT) && (ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)){ @@ -1510,11 +1502,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Vxf2 = *(ckt->CKTrhsOld + here->HICUMxf2Node); Vciei = Vbiei - Vbici; if (selfheat) { - if (model->HICUMrth_de==1) { - Vrth = *(ckt->CKTstate0 + here->HICUMith)*here->HICUMrth_t.rpart; - } else { - Vrth = *(ckt->CKTrhsOld + here->HICUMtempNode); - } + Vrth = *(ckt->CKTrhsOld + here->HICUMtempNode); } #ifndef PREDICTOR @@ -1567,11 +1555,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Vxf1 = *(ckt->CKTrhsOld + here->HICUMxf1Node); Vxf2 = *(ckt->CKTrhsOld + here->HICUMxf2Node); if (selfheat) { - if (model->HICUMrth_de==1) { - Vrth = *(ckt->CKTstate0 + here->HICUMith)*here->HICUMrth_t.rpart; - } else { - Vrth = *(ckt->CKTrhsOld + here->HICUMtempNode); - } + Vrth = *(ckt->CKTrhsOld + here->HICUMtempNode); } ibieihat = *(ckt->CKTstate0 + here->HICUMibiei) + *(ckt->CKTstate0 + here->HICUMibiei_Vbiei)*delvbiei+ @@ -1778,20 +1762,20 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Vbiei = DEVpnjlim(Vbiei,*(ckt->CKTstate0 + here->HICUMvbiei),here->HICUMvt.rpart, here->HICUMtVcrit,&icheck); Vaval = 3 * here->HICUMvdci_t.rpart;//limit step around 3*vdci_t -> somehow this brings convergence - if ((model->HICUMkavlGiven) && (Vbici < MIN(0, -Vaval))) { - Vbici_temp = -(Vbici + Vaval); - Vbici_temp = DEVpnjlim( - Vbici_temp, - -(*(ckt->CKTstate0 + here->HICUMvbici) + Vaval), - here->HICUMvt.rpart, - here->HICUMtVcrit, - &ichk1 - ); - Vbici = -(Vbici_temp + Vaval); - } else { + // if ((model->HICUMkavlGiven) && (Vbici < MIN(0, -Vaval))) { + // Vbici_temp = -(Vbici + Vaval); + // Vbici_temp = DEVpnjlim( + // Vbici_temp, + // -(*(ckt->CKTstate0 + here->HICUMvbici) + Vaval), + // here->HICUMvt.rpart, + // here->HICUMtVcrit, + // &ichk1 + // ); + // Vbici = -(Vbici_temp + Vaval); + // } else { Vbici = DEVpnjlim(Vbici,*(ckt->CKTstate0 + here->HICUMvbici),here->HICUMvt.rpart, here->HICUMtVcrit,&ichk1); - } + //} Vbpei = DEVpnjlim(Vbpei,*(ckt->CKTstate0 + here->HICUMvbpei),here->HICUMvt.rpart, here->HICUMtVcrit,&ichk2); Vbpci = DEVpnjlim(Vbpci,*(ckt->CKTstate0 + here->HICUMvbpci),here->HICUMvt.rpart, @@ -1982,10 +1966,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) it_Vbici = itf_Vbici - itr_Vbici; it_dT = itf_dT - itr_dT; - if (isnan(it)) { - it=0; - } - //end final calculations -------------------------------------------------- here->HICUMtf = Tf; @@ -2355,23 +2335,14 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Ibpbi_Vbiei = -Vbpbi * rbi_Vbiei / (rbi*rbi); Ibpbi_Vbici = -Vbpbi * rbi_Vbici / (rbi*rbi); Ibpbi_Vrth = -Vbpbi * rbi_dT / (rbi*rbi); - } else if(rbi >0.0 ) { + } else { // fallback in case rbi is low Ibpbi = Vbpbi / MIN_R; Ibpbi_Vbpbi = 1 / MIN_R; Ibpbi_Vbiei = 0; Ibpbi_Vbici = 0; Ibpbi_Vrth = 0; - } - else { - // fallback in case rbi is not zero, but smaller than MIN_R - Ibpbi = 0; - Ibpbi_Vbpbi = 0; - Ibpbi_Vbiei = 0; - Ibpbi_Vbici = 0; - Ibpbi_Vrth = 0; - } - + }; // ******************************************** // For simulators having no problem with Vrth) <+ 0.0 @@ -2392,8 +2363,6 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt) Ith_Vrth = 0.0; if(!selfheat) { Ith = 0; - } else if (model->HICUMrth_de==1) { - Ith = -Vrth/here->HICUMrth_t.rpart+pterm; //Current from gnd to T } else { Ith = -Vrth/here->HICUMrth_t.rpart+pterm; //Current from gnd to T @@ -3212,10 +3181,6 @@ load: if (selfheat) { - if (model->HICUMrth_de == 1) { - *(here->HICUMtempTempPtr) += 1; - *(ckt->CKTrhs + here->HICUMtempNode) += Vrth; - } else { // ############################################################# // ############### STAMP WITH SH ADDITIONS ##################### // ############################################################# @@ -3387,7 +3352,6 @@ load: *(here->HICUMtempEmitEIPtr) += -Ith_Veie; *(here->HICUMtempEmitPtr) += +Ith_Veie; // finish - } } }