Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
2

Swimming Pool in OpenStudio

asked 2023-05-05 23:08:00 -0500

mattkoch's avatar

updated 2023-05-07 20:34:48 -0500

I tried to implement a swimming pool following this post on Unmet Hours. If I just create the pool by itself, all is well, though it shows up nowhere in OpenStudioApplication 1.4.0 and so I cannot pick it. But it does appear in the .OSM file, so i know it is there.

However, it falls apart when I try to add it to the plant loop. Then I get the following error:

[03:52:20.973528 ERROR] Found error in state 'translator' with message ["D:\\OSN\\src\\model\\SwimmingPoolIndoor.cpp@149 : Object of type 'OS:SwimmingPool:Indoor' and named 'Swimming Pool' does not have an Surface attached.::/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/model.rb:124:in `translateModel'\n:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/model.rb:124:in `translate_to_energyplus'\n:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/jobs/run_translation.rb:72:in `perform'\n:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/run.rb:291:in `step'\n:/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/run.rb:233:in `run'\n:/openstudio_cli.rb:1173:in `execute'\n:/openstudio_cli.rb:803:in `execute'\n:/openstudio_cli.rb:1972:in `'\neval:188:in `eval'\neval:188:in `require_embedded_absolute'\neval:173:in `block in require_embedded'\neval:167:in `each'\neval:167:in `require_embedded'\neval:126:in `require'\neval:3:in `'"]}

I reached my wits' end really quick on this one. I know the surface in question is indeed there. Is this a bug in OpenStudioApplication 1.4.0/OpenStudio 3.4.0?

>>> Response to Denis Bourgeois <<<

Here is the Surface:

OS:Surface,
{2fbf64c8-fb40-4bfd-a26b-76f8ab875201}, !- Handle
Swimming Pool Surface,                  !- Name
Floor,                                  !- Surface Type
,                                       !- Construction Name
{d56986b7-3bde-4f2a-8fed-bb249f53d035}, !- Space Name
Ground,                                 !- Outside Boundary Condition
,                                       !- Outside Boundary Condition Object
NoSun,                                  !- Sun Exposure
NoWind,                                 !- Wind Exposure
,                                       !- View Factor to Ground
,                                       !- Number of Vertices
18.288, 12.192, 0,                      !- X,Y,Z Vertex 1 {m}
18.288, 3.048, 0,                       !- X,Y,Z Vertex 2 {m}
1.524, 3.048, 0,                        !- X,Y,Z Vertex 3 {m}
1.524, 12.192, 0;                       !- X,Y,Z Vertex 4 {m}

And here is the Swimming Pool Indoor:

OS:SwimmingPool:Indoor,
{205d8fd8-4623-4941-8f31-580c87b23912}, !- Handle
Swimming Pool,                          !- Name
{2fbf64c8-fb40-4bfd-a26b-76f8ab875201}, !- Surface Name
2.25552,                                !- Average Depth {m}
{954c56b7-a6c9-412d-871f-b5d42fc5b90d}, !- Activity Factor Schedule Name
{03694292-0009-4991-a974-c09401bd95b4}, !- Make-up Water Supply Schedule Name
{09a5ca37-f89d-4c5d-81bb-eec7f5b7a18c}, !- Cover Schedule Name
0,                                      !- Cover Evaporation Factor
0,                                      !- Cover Convection Factor
0,                                      !- Cover Short-Wavelength Radiation Factor
0,                                      !- Cover Long-Wavelength Radiation Factor
,                                       !- Pool Water Inlet Node
,                                       !- Pool Water Outlet Node
0.00630901963994975,                    !- Pool Heating System Maximum Water Flow Rate {m3/s}
464527116.568869,                       !- Pool Miscellaneous Equipment Power {W-s/m3}
{c40d9ba0-640c-4727-b3eb-379984c6bdc0}, !- Setpoint Temperature Schedule
50,                                     !- Maximum Number of People
{954c56b7-a6c9-412d-871f-b5d42fc5b90d}, !- People Schedule
{7285f29a-52fc-4b24-b8ba-637ecaa59284}; !- People Heat Gain Schedule

Also, all schedules are generated automatically by

swimming_pool = OpenStudio::Model::SwimmingPoolIndoor.new(model,surface).

So with this model, when I try to generate a plant loop and then assign the swimming pool to it as ... (more)

edit retag flag offensive close merge delete

Comments

Short of sharing the .osm file, could you edit your post and add the relevant .osm excerpts, like the attached Floor surface and the pool object itself, e.g.

OS:SwimmingPool:Indoor,
{d6bee533-be4f-44a3-8c77-7c2a8f3742de}, !- Handle
Swimming Pool Indoor 2,                 !- Name
{c7c1eea3-9b85-47db-99c2-1b319c81a031}, !- Surface Name
...
Denis Bourgeois's avatar Denis Bourgeois  ( 2023-05-06 04:44:21 -0500 )edit

Thanks for the info - not seeing anything wrong with either object. So is your measure limited to adding/linking a new swimming pool to existing surface + existing loop? Successful running a simulation WITHOUT the pool (i.e. ignoring the measure)? If so, successful running a simulation AFTER applying Julien's one-liner on that valid, pre-pool OSM? If that's the case, you then have 2x modified OSMs to compare: 1x modified using the Measure, 1x modified using the one-liner. If one is successfully translated to an IDF, then an App/SDK bug is unlikely. Trying to narrow things down ...

Denis Bourgeois's avatar Denis Bourgeois  ( 2023-05-07 06:42:08 -0500 )edit

... just in case you haven't come across this yet - maybe useful.

Denis Bourgeois's avatar Denis Bourgeois  ( 2023-05-07 07:09:56 -0500 )edit

OK, this is rather curious. I just used a batch file (oneliner.bat) file with following content:

D:\OpenStudio-3.4.0\bin\openstudio -e "include OpenStudio::Model; vt = OpenStudio::OSVersion::VersionTranslator.new; m = vt.loadModel('model.osm').get; s = m.getSurfaceByName('SP Surface').get; pool = SwimmingPoolIndoor.new(m, s); p = m.getPlantLoopByName('SP Loop').get; p.addDemandBranchForComponent(pool); m.save('model.osm', true)"

... just like the original post recommends, and ran it like so > ./oneliner.bat ... and it worked! Would love for it to work in Apply Measure Now, though.

mattkoch's avatar mattkoch  ( 2023-05-07 20:12:06 -0500 )edit

... see Additional Update in original post above.

mattkoch's avatar mattkoch  ( 2023-05-07 20:36:22 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2023-05-09 09:31:37 -0500

Is the Space with the floor surface assigned to a ThermalZone? If not, the space (and its surfaces) won't be translated, which would cause the translation error shown.

edit flag offensive delete link more
1

answered 2023-05-08 19:45:39 -0500

mattkoch's avatar

updated 2023-05-08 19:46:37 -0500

Eric Ringold hit the nail on the head. Adding a thermal zone did indeed solve this problem. Thank you! And Denis Bourgeois, thank you for guiding us there! I suppose running a measure with Apply Measure Now triggers a whole bunch of sanity checks that are not necessarily made when running a simple command one-liner.

... sorry, I don't know how to make sure Eric Ringold gets the credit here?

edit flag offensive delete link more

Comments

I moved my comment to an answer.

ericringold's avatar ericringold  ( 2023-05-09 09:31:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

1 follower

Stats

Asked: 2023-05-05 23:08:00 -0500

Seen: 285 times

Last updated: May 09 '23