eQuest & NoteTab Question

11 posts / 0 new
Last post

Hi,

I have a model with 233 zones. Right now, every zone has a water loop heat pump. I want to convert these all to packaged single zone systems. To do this, I am working in the .inp file and doing a "find and replace" in NoteTab. The replacing of the system type is easy. I simply search for the "type = HP" line and replace with "type = PSZ". However, the PSZ system requires a control zone. I would like each control zone to be the zone in which that particular system resides. Which means, for each of my 233 zones, I will have a different control zone (i.e. no longer a simple find and replace search).

Does anyone know of a way to use "find and replace" (or another method) to set each control zone with the zone name which the system resides?

This is what the .inp file should look like for a packaged single zone system:

"EL1 Sys1 (PTAC) (G.SSW1)" = SYSTEM
TYPE = PSZ
HEAT-SOURCE = HEAT-PUMP
ZONE-HEAT-SOURCE = NONE
SIZING-RATIO = 1
COOL-SIZING-RATI = 1
MIN-SUPPLY-T = 58
FAN-SCHEDULE = "S1 Sys1 (PTAC) Fan Sch"
CW-LOOP = "DEFAULT-CW"
COOLING-CAPACITY = 15752
COOL-SH-CAP = 11839
HP-SUPP-SOURCE = NONE
FURNACE-HIR = 1.24067
CONTROL-ZONE = "EL1 SSW Perim Zn (G.SSW1)"
C-EER95 = 8.24
C-COP47 = 0.78
C-AFUE = 0.78
C-SF-MTR-TYPE = 1
C-RF-MTR-TYPE = 1
C-OSA-DMPR-CTRL = 1
C-HTG-DUCT-LOCN = *Ceiling Plenum*
C-HTG-DUCT-RVAL = 7
C-CLG-DUCT-LOCN = *Ceiling Plenum*
C-CLG-DUCT-RVAL = 7
C-CLG-CAP-CATEG = 14

For my next system, everything would be exactly the same except the highlighted lines (and so on for all 233 systems):

"EL1 Sys1 (PTAC) (G.W2)" = SYSTEM
TYPE = PSZ
HEAT-SOURCE = HEAT-PUMP
ZONE-HEAT-SOURCE = NONE
SIZING-RATIO = 1
COOL-SIZING-RATI = 1
MIN-SUPPLY-T = 58
FAN-SCHEDULE = "S1 Sys1 (PTAC) Fan Sch"
CW-LOOP = "DEFAULT-CW"
COOLING-CAPACITY = 15752
COOL-SH-CAP = 11839
HP-SUPP-SOURCE = NONE
FURNACE-HIR = 1.24067
CONTROL-ZONE = "EL1 Sys1 (PTAC) (G.W2)"
C-EER95 = 8.24
C-COP47 = 0.78
C-AFUE = 0.78
C-SF-MTR-TYPE = 1
C-RF-MTR-TYPE = 1
C-OSA-DMPR-CTRL = 1
C-HTG-DUCT-LOCN = *Ceiling Plenum*
C-HTG-DUCT-RVAL = 7
C-CLG-DUCT-LOCN = *Ceiling Plenum*
C-CLG-DUCT-RVAL = 7
C-CLG-CAP-CATEG = 14

thank you,

Jesse Phillips | Energy Engineer

Phillips, Jesse's picture
Offline
Joined: 2015-09-10
Reputation: 0

Can you create a macro that searches for each instance of ?=ZONE?, copies the text before the ?=? to get the zone name, and the pastes in the lines necessary to create a new single zone system, using the zone name now stored in the clip-board to paste in the control zone?

I?m not familiar with NoteTab, but you can do that in boxer.

Nathan Miller, PE, LEED AP BD+C ? Mechanical Engineer/Senior Energy Analyst
RUSHING | D 206-788-4577 | O 206-285-7100
www.rushingco.com

Nathan Miller's picture
Offline
Joined: 2011-09-30
Reputation: 200

I don?t think you can create macros in NoteTab. What would that macro look like in boxer?

Jesse Phillips
Energy Engineer
RDK Engineers
P: 857-221-5957

Phillips, Jesse's picture
Offline
Joined: 2015-09-10
Reputation: 0

Hi,

I don't know Notetab, but as long as you have one system for each zone,
this is pretty easy if your editor supports Regular Expressions (Regex).

As you might know, inp files has what I call a positional input for a few
things (space > surface > window/door, same for system > zone). Meaning if
you find something that is a system, everything that's right after (which
are zones) below to this system until you find another system. As opposed
to having a keyword linking those two objects.

So you could use a regex for this job. Especially using positive lookaheads
to delimit a single system and its zone (singular here, could be plural).

If you do have only a single zone per system, it's even easier.

Just look for a system and it's zone below it.

If you are not familiar with regex and can't manage to build it, let me
know, I'll try to find a few tomorrow to help you out (send me your file or
an extract or it so I don't have to create a dummy one to play with it).

By the way, here's a website I wish existed when I first started playing
with regex: https://regex101.com/. Fyi, Notepad++ uses the prce engine.

Cheers,
Julien

--
Julien Marrec, EBCP, BPI MFBA
Energy&Sustainability Engineer
T: +33 6 95 14 42 13

LinkedIn (en) : www.linkedin.com/in/julienmarrec
LinkedIn (fr) : www.linkedin.com/in/julienmarrec/fr

2015-09-09 22:04 GMT+02:00 Phillips, Jesse :

jmarrec's picture
Offline
Joined: 2013-01-09
Reputation: 0

Thanks Julien.

I?ve attached the inp file. I am not familiar with Regex at all but I?ll check out that website. If you could send me some examples tomorrow though, that would be great!

thanks,

Jesse

Phillips, Jesse's picture
Offline
Joined: 2015-09-10
Reputation: 0

Jesse,

I've created an example here : https://regex101.com/r/iZ5jO8/1. This should
really help understanding how I'm getting the result, by decomposing each
step of the regex.

Note that I added names to capturing groups, you don't have to do that, you
could use just positional:

Look for: (SYSTEM *\n *?TYPE *= )HP(.*?FURNACE-HIR +?=
[.0-9]+)\n(.*?\.\.\n)(\".*?\")

Replace with: \1PSZ\2\n CONTROL-ZONE = \4\n\3\4

A few things: dot (.) has to match newline characters for it to work.
Also, in notepad++ to replace with named capturing groups, you use $+{Name}
You have to replace \n (unix convention) by \r\n.

Anyways, for notepad++ try:

Search:
(?SYSTEM *\r\n *?TYPE *= )HP(?.*?FURNACE-HIR +?=
[.0-9]+)\r\n(?.*?\.\.\r
\n)(?\".*?\")

Replace with:
$+{System1}PSZ$+{System2}\n CONTROL-ZONE =
$+{ZoneName}\n$+{System3}$+{ZoneName}

I've loaded it up in eQuest, seems to do the job just fine. Let me know if
you are trouble implementing. I've also attached the file back, but I'd be
a shame to not take this as an opportunity to learn regex

PS: By the way, you should really use floor multipliers.

Best,
Julien

--
Julien Marrec, EBCP, BPI MFBA
Energy&Sustainability Engineer
T: +33 6 95 14 42 13

LinkedIn (en) : www.linkedin.com/in/julienmarrec
LinkedIn (fr) : www.linkedin.com/in/julienmarrec/fr

2015-09-09 22:32 GMT+02:00 Phillips, Jesse :

jmarrec's picture
Offline
Joined: 2013-01-09
Reputation: 0

Here is an example of a macro that inserts a new single zone system for EVERY zone in a file. We usually copy only the zones we want to run this macro on into a separate text file, run the macro, copy that new text and paste it back over the old zone information in the original .inp file. Note, it is easy to make a mistake and mess up your .inp file, so always save a copy of the original somewhere else first.

Basic explanation (this uses some built-in macros already defined in boxer):

1) Go to start of file

2) Recursive ?While? statement to run macro as long as it finds another instance of ?= ZONE?

3) Find ?= ZONE?

4) Copy the zone name part of that text string

5) Move curser above the zone

6) Create text for new system with zone name imbedded (unique system name necessary)

7) Print in the inputs we want for each unique system, here, type PSZ, Min OA = 0, Control Zone = pasted zone name (we use user defined defaults a lot, or you might just go in later and modify values you don?t want to default once the systems are already created)

8) Don?t forget to put ?..? at the end of the system definition

9) Go back and check to see if while condition is satisfied.

Boxer Macro:

/* Use to add single zone systems to multiple zones.
Make sure that the group of zones are all conditioned.
Cut zone group out of .inp file to new file, run macro, paste back into .inp
*/

macro AddSingleZoneSystems()
{
StartOfFile;
while(Find("= ZONE")!=0)
{
SelectToStartOfLine;
Copy;
InsertLineAbove;
Paste;
EndOfLine;
Backspace;
Backspace;
printf(" PSZ Econ\"");
printf(" = SYSTEM");
InsertLineBelow;
printf(" TYPE = PSZ");
InsertLineBelow;
printf(" MIN-OUTSIDE-AIR = 0");
InsertLineBelow;
printf(" CONTROL-ZONE = ");
Paste;
InsertLineBelow;
printf(" ..");
Down;
Down;
}
}

Nathan Miller, PE, LEED AP BD+C ? Mechanical Engineer/Senior Energy Analyst
RUSHING | D 206-788-4577 | O 206-285-7100
www.rushingco.com

Nathan Miller's picture
Offline
Joined: 2011-09-30
Reputation: 200

We typically use RegExs for tasks like this as well, but I had not run
across the Regular Expressions 101 site before;
what a great resource Julien! Very cool way to keep track of
expressions and share. Thanks for circulating these examples!
David

David Reddy4's picture
Offline
Joined: 2012-03-30
Reputation: 0

I use UltraEdit for editing .inp files. After doing the search and replace PSZ for HP, I recorded a macro that first searches for ?PSZ?, then searches for ? = ZONE?. Then

[cid:image003.png at 01D09C46.E75BA0D0]
Christopher Jones, P.Eng.
Senior Engineer

WSP Canada Inc.
2300 Yonge Street, Suite 2300
Toronto, ON M4P 1E4
T +1 416-644-4226
F +1 416-487-9766
C +1 416-697-0065

www.wspgroup.com

Jones, Christopher's picture
Joined: 2015-06-11
Reputation: 0

Oops, hit the send button too soon.

I use UltraEdit for editing .inp files. I am pretty sure you can record macros with NotePad++ the same way you can with UltraEdit.

After search and replace PSZ for HP.
Record Macro:
Search for PSZ,
Search for ? = ZONE?
Ctrl Left Arrow
Ctrl Left Arrow
Left Arrow (the cursor is now at the end of the zone name)
Shift Home,
Ctrl C
Search Previous for ? = SYSTEM?
Carriage Return
Type ?CONTROL-ZONE = ?
Ctrl V
End Record Macro
Run macro once or twice to make sure it is doing the correct thing. Then run the macro to the end of the file.

This works fine as long as the control zone is the first zone after the system definition.

Regex is very cool and powerful but you can spend a quite a bit of time climbing that learning curve.

[cid:image003.png at 01D09C46.E75BA0D0]
Christopher Jones, P.Eng.
Senior Engineer

WSP Canada Inc.
2300 Yonge Street, Suite 2300
Toronto, ON M4P 1E4
T +1 416-644-4226
F +1 416-487-9766
C +1 416-697-0065

www.wspgroup.com

Jones, Christopher's picture
Joined: 2015-06-11
Reputation: 0

Christopher,

I agree that regex can be intimidating but the site I posted should help a
lot.

And once you have climbed that learning curve... http://xkcd.com/208/

Cheers and happy friday,
Julien

--
Julien Marrec, EBCP, BPI MFBA
Energy&Sustainability Engineer
T: +33 6 95 14 42 13

LinkedIn (en) : www.linkedin.com/in/julienmarrec
LinkedIn (fr) : www.linkedin.com/in/julienmarrec/fr

2015-09-11 15:18 GMT+02:00 Jones, Christopher <
Christopher.r.Jones at wspgroup.com>:

jmarrec's picture
Offline
Joined: 2013-01-09
Reputation: 0