[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EnergyPlus_Support] Re: EnergyPlus Macros



Hello Dr. Li,
I'm struggling using the #EVAL to concatinate a zonename_variable. I need this for a EMS program. Could you please show me a simple example.
Thanks,
Jean.

--- In EnergyPlus_Support@xxxxxxxxxxxxxxx, YuanLu Li <yli006@...> wrote:
>
> 
> JEplus is something different from the EPlua Macro usage. I think, it would search the string in the IDF change the values of that object and run another simulation. I have not studied JPlus in detail.=====================The starting point of using MACRO is to split the EPlus IDF files into section. The first is always common, the material and construction does not change much, schedule limits is always the same.  Zone sizing, system sizing, plant sizing are also fixed. If you save all this in separate files, then you can call them in just using a few lines of  ##include  filename   lines.  You can edit these files in text editor or IDFedit and save with different names for different projects. When you have exported a building envelope from a third party software, you can save that as separate section. When you expand a templlate you can save each section as a separate file. When you look at the expIDF carefully, the zone name potion has similar syntax.  The zone name portion can be changed using a macro definition.=======================##def     mmZone [SPACE1-1,    ,  ]  ZoneControl:Thermostat,  SPACE1-1 Thermostat,                                     !- Thermostat Name  SPACE1-1,                                                !- Zone Name  HVACTemplate-Always 4,                                   !- Control Type Schedule Name  ThermostatSetpoint:DualSetpoint,                         !- Control Type  All Zones Dual SP Control;                               !- Control Type Name
> 
> Sizing:Zone,  SPACE1-1,                                                !- Zone Name  16.0,                                                    !- Zone cooling design supply air temperature {C}  50,                                                      !- Zone heating design supply air temperature {C}  0.008,                                                   !- Zone cooling design supply air humidity ratio {kg-H20/kg-air}  0.008,                                                   !- Zone heating design supply air humidity ratio {kg-H2O/kg-air}  flow/person,                                             !- Outdoor Air Method  0.00944,                                                 !- outside air flow per person {m3/s}  0.0,                                                     !- outside air flow per zone area {m3/s-m2}  0.0,                                                     !- outside air flow per zone {m3/s}  ,                                                        !- Zone Heating Sizing Factor  ,                                                        !- Zone Cooling Sizing Factor  DesignDay,                                               !- Cooling Design Air Flow Method  0,                                                       !- cooling design air flow rate {m3/s}  ,                                                        !- cooling min air flow per zone area {m3/s-m2}  ,                                                        !- cooling min air flow {m3/s}  0,                                                       !- cooling min air flow fraction {}  DesignDay,                                               !- Heating Design Air Flow Method  0,                                                       !- heating design air flow rate {m3/s}  ,                                                        !- heating min air flow per zone area {m3/s-m2}  ,                                                        !- heating min air flow {m3/s}  0;                                                       !- heating min air flow fraction {} ##enddif 
> I have selected two objects as example.  There are more with OA mixer, connectin, etc.  All have  the zone ID  'SPACE1-1', which is now used as the macro ID name. When you write in the .IMF : mmZone [SPACE1-1,  ,      ]mmZone [SPACE2-1,  ,      ]mmZone [SPACE3-1,  ,  ]mmZone [SPACE4-1,  ,      ]mmZone [SPACE5-1,  ,      ] you will get the above text five times with different zone ID prefix names.  Normally, you will use a unit name such as 'mn1Zone' in the definition line and save that in a separate file.  You include that file first and then issue the macro command lines.  I showed the first line in black to warn you that it may cause problem, because it is also the definition name. If you add six numbers representing the two opposite conners of a zone in the other fields,  you can all the walls, floor and ceiling copied with different zone names.The templates are written this way I think.  That is why all the  [ ] are replaced with {  }.The building section is copied out and then re-attached, because the ID for construction, walls, etc.  may have [1]  [2]. etc.  If these are mixed up in the IMF files, there will be errors. The above is just one set of macros.  There are many others in the manual.  You can use it to comment out a block of codes from the IDF files as well, using the ##if   .. ##endif, which are commonly used in the other programming language to select diffection sections of codes for compilation. I usually use the example file, extract the building section and replace it with the project section.  Then see how the zone related names can be changed. If you use the HVAC template examples to start, the objects for each zone are grouped together and very easy to change.  In fact, fine and replace can be used, if the number of zones are small.  Dr. Li   
>  To: EnergyPlus_Support@xxxxxxxxxxxxxxx
> From: zqianmin@...
> Date: Wed, 20 Jul 2011 11:33:56 -0700
> Subject: Re: [EnergyPlus_Support] EnergyPlus Macros
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
>   
> 
> 
>     
>       
>       
>       Thank you Dr. Li.What I know relative to C language is C++, one semester learning, and that was 6 years ago. It is hard to say I know it, but you show me a good demonstration of its functions above. 
> 
> I was looking at the post from Yi Zhang about jEPlus, and tried to use it. I feel like it need to work with ep-macro under its parameter item "search string, alternative values", although I'm not that sure about it. 
> 
> For my work, I was looking for something can help me make easier change on text editor. There is only one step undo on text editor, and if I want to utilize some model from energyplus example file in my project, it's not that easy to do copy, past and edit on either idf or text editor. My experience with energyplus and its supplement software is really limited. If one project has same system with one model in energyplus file, but different zone number and zone name, what will you do to implement the system to the project? Directly create the system in idf or copy and paste from energyplus model in idf or in text editor? Or any better way like something I expected from jeplus. Thank you.
> 
> Regards,Qianmin
> 
> On Wed, Jul 20, 2011 at 10:58 AM, YuanLu Li <yli006@...> wrote:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
>   
> 
> 
>     
>       
>       
>       
> 
> 
> Do you know how the conditional compilation work in C programming?
>  
> ##include    myfilename
> 
> would include a file in that location.
> ============
> ##def    mmName1  [ macroName1,   macroNUm1  ]
>  
>    macroName1 outlet,  
> 
>   ,
> macroNum1,
> end;
> ##enddef  
> ===============
> would define a block of codes.
>  
> mmName1 [Z1, 50 ]
>  
> would give you:
> =============
> Z1 outlet,
> ,
> 50,end;
> ==================
> It is very powerful variable substitution and calculatin program. 
> 
>  
> You can sectionize one IDF into many INP files and include them in one IMF file.
>  
> EPlaunch would except the IMF file and expand it into epmIDF and simulate.
> The direct macro expansion program is done by the EPmacro.exe which is run in the DOS window, as described in the Auxiliary Program pdf.
> 
>  
> If you can show me how much you know, I will lead you through. 
>  
>  Dr. Li   
>  
> To: EnergyPlus_Support@xxxxxxxxxxxxxxx
> 
> From: zqianmin@...
> Date: Wed, 20 Jul 2011 10:32:03 -0700
> Subject: [EnergyPlus_Support] EnergyPlus Macros
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
>   
> 
> 
>     
>       
>       
>       Could anyone tell me how to start using input macros? I read this part on auxiliaryprograms.pdf, but can't figure it out. I even don't know how to run the EP-Macro program at this time. Thank you for your help.
> 
> 
> Qianmin
>




------------------------------------

Primary EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx

The primary EnergyPlus web site is found at:
http://www.energyplus.gov

The group web site is:
http://groups.yahoo.com/group/EnergyPlus_Support/

Attachments are currently allowed but be mindful that not everyone has a high speed connection.  Limit attachments to small files.

EnergyPlus Documentation is searchable.  Open EPlusMainMenu.pdf under the Documentation link and press the "search" button.
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/EnergyPlus_Support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/EnergyPlus_Support/join
    (Yahoo! ID required)

<*> To change settings via email:
    EnergyPlus_Support-digest@xxxxxxxxxxxxxxx 
    EnergyPlus_Support-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    EnergyPlus_Support-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/