Add coil diameter dia to the inductor parameters.

dia (diameter) takes preference over csect (cross section)
This commit is contained in:
Holger Vogt 2022-06-22 13:26:57 +02:00
parent 10d4b34ec5
commit 8d2a6c2405
4 changed files with 33 additions and 20 deletions

View File

@ -44,6 +44,7 @@ IFparm INDmPTable[] = { /* model parameters */
IOPA( "tc2", IND_MOD_TC2, IF_REAL,"Second order temp. coefficient"),
IOPXU( "tnom", IND_MOD_TNOM, IF_REAL,"Parameter measurement temperature"),
IOPA( "csect", IND_MOD_CSECT, IF_REAL,"Inductor cross section"),
IOPA( "dia", IND_MOD_DIA, IF_REAL,"Inductor diameter"),
IOPA( "length", IND_MOD_LENGTH, IF_REAL,"Inductor length"),
IOPA( "nt", IND_MOD_NT, IF_REAL,"Model number of turns"),
IOPA( "mu", IND_MOD_MU, IF_REAL,"Relative magnetic permeability"),

View File

@ -101,6 +101,7 @@ struct sINDmodel { /* model structure for an inductor */
double INDtempCoeff1; /* first temperature coefficient */
double INDtempCoeff2; /* second temperature coefficient */
double INDcsect; /* Cross section of inductor */
double INDdia; /* Diameter of (cylindrical) inductor */
double INDlength; /* Mean length of magnetic path */
double INDmodNt; /* Model number of turns */
double INDmu; /* Relative magnetic permeability */
@ -109,6 +110,7 @@ struct sINDmodel { /* model structure for an inductor */
unsigned INDtc1Given : 1; /* flag to indicate tc1 was specified */
unsigned INDtc2Given : 1; /* flag to indicate tc2 was specified */
unsigned INDcsectGiven : 1; /* flag to indicate cross section given */
unsigned INDdiaGiven : 1; /* flag to indicate diameter given */
unsigned INDlengthGiven: 1; /* flag to indicate length given */
unsigned INDmodNtGiven : 1; /* flag to indicate mod. n. of turns given */
unsigned INDmuGiven : 1; /* flag to indicate mu_r given */
@ -196,6 +198,7 @@ enum {
IND_MOD_TC2,
IND_MOD_TNOM,
IND_MOD_CSECT,
IND_MOD_DIA,
IND_MOD_LENGTH,
IND_MOD_NT,
IND_MOD_MU,

View File

@ -37,6 +37,10 @@ INDmParam(int param, IFvalue *value, GENmodel *inModel)
mod->INDcsect = value->rValue;
mod->INDcsectGiven = TRUE;
break;
case IND_MOD_DIA:
mod->INDdia = value->rValue;
mod->INDdiaGiven = TRUE;
break;
case IND_MOD_LENGTH :
mod->INDlength = value->rValue;
mod->INDlengthGiven = TRUE;

View File

@ -32,10 +32,10 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
if (!model->INDmIndGiven) {
model->INDmInd = 0.0;
}
if (!model->INDtnomGiven) {
if (!model->INDtnomGiven) {
model->INDtnom = ckt->CKTnomTemp;
}
if (!model->INDtc1Given) {
if (!model->INDtc1Given) {
model->INDtempCoeff1 = 0.0;
}
if (!model->INDtc2Given) {
@ -44,6 +44,9 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
if (!model->INDcsectGiven){
model->INDcsect = 0.0;
}
if (!model->INDdiaGiven){
model->INDdia = 0.0;
}
if (!model->INDlengthGiven) {
model->INDlength = 0.0;
}
@ -53,30 +56,32 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
if (!model->INDmuGiven) {
model->INDmu = 1.0;
}
/* precompute specific inductance (one turn) */
if((model->INDlengthGiven) && (model->INDlength > 0.0)) {
model->INDspecInd = (model->INDmu * CONSTmuZero
* model->INDcsect) / model->INDlength;
} else {
model->INDspecInd = 0.0;
}
/* Lundin's geometry correction factor */
model->INDspecInd *= Lundin(model->INDlength, model->INDcsect);
/* diameter takes preference over cross section */
if (model->INDdiaGiven) {
model->INDcsect = PI * model->INDdia * model->INDdia / 4.;
}
/* precompute specific inductance (one turn) */
if((model->INDlengthGiven) && (model->INDlength > 0.0)) {
model->INDspecInd = (model->INDmu * CONSTmuZero
* model->INDcsect) / model->INDlength;
} else {
model->INDspecInd = 0.0;
}
/* Lundin's geometry correction factor */
model->INDspecInd *= Lundin(model->INDlength, model->INDcsect);
/*
double kl = Lundin(model->INDlength, model->INDcsect);
double Dl = model->INDlength / sqrt(model->INDcsect / PI) / 2.;
fprintf(stdout, "Lundin's correction factor %f at l/D %f\n", kl, Dl);
double kl = Lundin(model->INDlength, model->INDcsect);
double Dl = model->INDlength / sqrt(model->INDcsect / PI) / 2.;
fprintf(stdout, "Lundin's correction factor %f at l/D %f\n", kl, Dl);
*/
/* How many turns ? */
if (!model->INDmIndGiven)
/* How many turns ? */
if (!model->INDmIndGiven)
model->INDmInd = model->INDmodNt * model->INDmodNt * model->INDspecInd;
/* loop through all the instances of the model */
for (here = INDinstances(model); here != NULL ;