void VLL_Sep::EvalDerivs() { FlashTank::EvalDerivs(); double QmIn, QmOut, MegIn, MegOut; QmIn = 0.0; QmOut = 0.0; MegIn = 0.0; MegOut = 0.0; for (int i=0; i<NoFlwIOs(); i++) { SpConduit & Cd=*IOConduit(i); if (IO_In(i)) { QmIn += Cd.Qm(Water())+Cd.Qm(Steam()); MegIn += Cd.Qm(MEG()); } else if (IO_Out(i) && IOId_Self(i)==VLLIO_boot) { QmOut += Cd.Qm(Water())+Cd.Qm(Steam()); MegOut += Cd.Qm(MEG()); } } dH2oSettled = QmIn*H2ORemEff-QmOut; dMEGSettled = MegIn*H2ORemEff-MegOut; }
char canonical_unit(struct disklabel *lp, char unit) { struct partition *pp; u_int64_t small; int i; if (unit == '*') { small = DL_GETDSIZE(lp); pp = &lp->d_partitions[0]; for (i = 0; i < lp->d_npartitions; i++, pp++) if (DL_GETPSIZE(pp) > 0 && DL_GETPSIZE(pp) < small) small = DL_GETPSIZE(pp); if (small < DL_BLKTOSEC(lp, MEG(1))) unit = 'K'; else if (small < DL_BLKTOSEC(lp, MEG(1024))) unit = 'M'; else if (small < DL_BLKTOSEC(lp, GIG(1024))) unit = 'G'; else unit = 'T'; } unit = toupper((unsigned char)unit); return (unit); }
void VLL_Sep::EvalProducts() { Contents.ZeroDeriv(); QFeed().QZero(); SigmaQIn(QFeed(), 0xffffffff); double TQvIn=0.0; double QvIn=0.0; for (int i=0; i<NoFlwIOs(); i++) if (IO_In(i)) { QvIn=IOConduit(i)->QVolume(som_SL); TQvIn+=QvIn; } double TQvInX=QFeed().QVolume(som_SL); /* hss I have included a variable to define the % of water removed in the boot. Previously it was 100%, which Andre Vogel says is incorrect. The user now has the ability to set the efficiency at a lower value and hence allow some of the water to leave with the condensate. 20/01/97 12/01/2000 hss I have included MEG in the boot contents, as it is also removed from the system via the boot. */ SpMArray OutImg, BootImg; OutImg = Contents.MArray(); OutImg[Water()] -= H2oSettled; OutImg[MEG()] -= MEGSettled; SetProdMakeup(PMU_IOId | PMU_Image, VLLIO_out, OutImg, Contents.Temp(), Contents.Press(), Contents.Model()); // The Boot BootImg = Contents.MArray(); double LoBLFScl=1.0e-6; double BootLiqFrac=(BootImg[Water()]+BootImg[MEG()])/GTZ(BootImg.Mass(som_SL)); double BootLiqScl=1; // @BootLiqFrac==0 then this =1 double OthrLiqScl=Range(0.0, 0.0+2*(LoBLFScl-BootLiqFrac)/LoBLFScl, 1.0); for (i=0; i<SDB.No(); i++) if (SDB[i].IsVap()) BootImg[i] = 0; else if (i==Water() || i==MEG()) BootImg[i] *= BootLiqScl; else BootImg[i] *= OthrLiqScl; SetProdMakeup(PMU_IOId | PMU_Image, VLLIO_boot, BootImg, Contents.Temp(), Contents.Press(), Contents.Model()); /* OLD BootImg = Contents.MArray(); BootImg[Water()] = 0.0; BootImg[MEG()] = 0.0; SetProdMakeup(PMU_IOId | PMU_Blocking, VLLIO_boot, BootImg, Contents.Temp(), Contents.Press(), Contents.Model()); */ EvalProducts_SurgeLevel(ContentHgtOrd); }
int tlb_map_page(U32 vaddr, U32 paddr) { tlb_flush(); tlb_mapi(1, vaddr, LO_ENTRY(paddr), LO_ENTRY(paddr + PAGESIZE)); tlb_mapi(2, vaddr + MEG(32), LO_ENTRY(paddr + MEG(32)), LO_ENTRY(paddr + MEG(32) + PAGESIZE)); return (0); }
void VLL_Sep::ApplyDerivs(double dTime, flag DoDbg) { FlashTank::ApplyDerivs(dTime, DoDbg); H2oSettled += dH2oSettled*dTime; H2oSettled = Range(0.0 , H2oSettled, Contents.SpMass(Water())); MEGSettled += dMEGSettled*dTime; MEGSettled = Range(0.0 , MEGSettled, Contents.SpMass(MEG())); TotalSettled = H2oSettled + MEGSettled; }
flag VLL_Sep::DataXchg(DataChangeBlk & DCB) { if (FlashTank::DataXchg(DCB)) return 1; switch(DCB.lHandle) { case xidBH2oIf: //DCB.D = (H2oSettled*SDB[Water()].msVolume(Contents.Temp(), Contents.Press(), Contents.MArray()))/BootVolume; DCB.D = (H2oSettled*SDB[Water()].msVolume(Contents.Temp(), Contents.Press(), Contents.Ovr(), Contents.MArray()) + MEGSettled*SDB[MEG()].msVolume(Contents.Temp(), Contents.Press(), Contents.Ovr(), Contents.MArray()))/BootVolume; return 1; } return 0; };
void init_raminfo() { add_ram(0x80000000, MEG(512)); }