Swimming Pool in OpenStudio
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 ...
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.
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 ...
... just in case you haven't come across this yet - maybe useful.
OK, this is rather curious. I just used a batch file (oneliner.bat) file with following content:
... 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.
... see Additional Update in original post above.