HVAC system failed to import to OSM

Hi, I’ve created the model in Pollination 1.6 with Ironbug 1.19.1, and it was working fine. After I upgraded Pollination to 1.9, the exported OpenStudio file no longer includes any of the HVAC systems. I’ve since synced all the components using LB Sync GH File, uninstalled & reinstalled Pollination 1.9 and 1.8, but it still doesn’t work. Any idea how I can fix this? Thanks

Hi @sunnydu,

We will need more information to be able to help. Can you share the file with us to recreate the issue? What’s the exact error message that you’re getting?

Hi Mostapha, there is no error message, but when I open the openstudio model, there is no HVAC system. It’s the same if I run the model in the script - no HVAC usage. Is there any way I can attach the model files? Thanks.

Hi @sunnydu,

It sounds like you’re using an older version of the plugin. Can you try and install the latest version. See this discussion.

https://discourse.pollination.solutions/t/missing-hvac-systems-in-osm-file/12154/20?u=mostapha

Hi Mostpha, I’ve updated to PollinationRHGHInstaller-1.65.17. The problem still persists if I add the HVAC using “Detailed HVAC” component, but it works with Ironbug “Save to File” component. Models are uploaded for you to review. Thanks.
20250909_EnergyModel.gh (921.5 KB)
20250909_EnergyModel.3dm (5.6 MB)

1 Like

Hi, @sunnydu ,

You uploaded a Grasshopper definition where all of the components are from LBT 1.8. So make sure that you run the LB Sync Grasshopper File component like you mentioned. Here’s the updated file:

20250909_EnergyModel.gh (921.3 KB)

I can see that there is still an issue after updating everything. The problem seems to be in the Ironbug JSON serializer. So I think we will need @mingbo 's help to fix it. I added some components at the end of the Grasshopper file above to help @mingbo test and recreate the issue:

Adding the Ironbug System directly to the OSM succeeds without issues. However, we get the following error when we serialize the IronBug HVAC to JSON and then try to apply it to the OSM:

"C:\Program Files\ladybug_tools\grasshopper\ironbug\Ironbug.Console.exe" in.osm hvac.json
[INFO] Input osm file:
 C:\Users\Chris\simulation\20250909_SalemHS_SD_PC\openstudio\in.osm
[INFO] Input ironbug HVAC json file:
 C:\Users\Chris\simulation\20250909_SalemHS_SD_PC\openstudio\hvac.json
[INFO] Backup input file:
 C:\Users\Chris\simulation\20250909_SalemHS_SD_PC\openstudio\in.osm.backup
[INFO] OpenStudio library 3.9.0.0 from C:\Program Files\ladybug_tools\openstudio\CSharp\openstudio.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Failed to deserialize ---> Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON 'System.ValueTuple`2[[System.Double, System.Private.CoreLib],[System.Double, System.Private.CoreLib]], System.Private.CoreLib'. Path '$type', line 2, position 137. ---> Newtonsoft.Json.JsonSerializationException: Could not load assembly 'System.Private.CoreLib'.
   at Newtonsoft.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(StructMultiKey`2 typeNameKey)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Newtonsoft.Json.Serialization.DefaultSerializationBinder.BindToType(String assemblyName, String typeName)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadMetadataPropertiesToken(JTokenReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue, Object& newValue, String& id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Ironbug.DeserializationHelper.Deserialize(JToken result)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Ironbug.HVAC.BaseClass.IB_PropArgumentSet.<>c.<OnDeserializedMethod>b__12_1(KeyValuePair`2 _)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Ironbug.HVAC.BaseClass.IB_PropArgumentSet.OnDeserializedMethod(StreamingContext context)
   --- End of inner exception stack trace ---
   at Ironbug.HVAC.BaseClass.IB_PropArgumentSet.OnDeserializedMethod(StreamingContext context)
   --- End of inner exception stack trace ---
   at Ironbug.HVAC.IB_HVACSystem.FromJson(String json)
   at Ironbug.HVAC.IB_HVACSystem.SaveHVAC(String osmPath, String hvacJsonFilePath)
   at Ironbug.Program.Main(String[] args)

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Failed to deserialize ---> Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON 'System.ValueTuple`2[[System.Double, System.Private.CoreLib],[System.Double, System.Private.CoreLib]], System.Private.CoreLib'. Path '$type', line 2, position 137. ---> Newtonsoft.Json.JsonSerializationException: Could not load assembly 'System.Private.CoreLib'.
   at Newtonsoft.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(StructMultiKey`2 typeNameKey)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Newtonsoft.Json.Serialization.DefaultSerializationBinder.BindToType(String assemblyName, String typeName)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadMetadataPropertiesToken(JTokenReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue, Object& newValue, String& id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Ironbug.DeserializationHelper.Deserialize(JToken result)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Ironbug.HVAC.BaseClass.IB_PropArgumentSet.<>c.<OnDeserializedMethod>b__12_1(KeyValuePair`2 _)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Ironbug.HVAC.BaseClass.IB_PropArgumentSet.OnDeserializedMethod(StreamingContext context)
   --- End of inner exception stack trace ---
   at Ironbug.HVAC.BaseClass.IB_PropArgumentSet.OnDeserializedMethod(StreamingContext context)
   --- End of inner exception stack trace ---
   at Ironbug.HVAC.IB_HVACSystem.FromJson(String json)
   at Ironbug.HVAC.IB_HVACSystem.SaveHVAC(String osmPath, String hvacJsonFilePath)
   at Ironbug.Program.Main(String[] args)

I know that @mingbo was recently doing some experiments with the Newtonsoft package so maybe that is the source of the issue.

FYI, @sunnydu . In case it is helpful, here is your OSM with the Ironbug system applied.

in_IB.osm (8.6 MB)

Until @mingbo gets the chance to fix it, you can work around the bug using the Ironbug “Save to File” component like in my screenshot above.

1 Like

Thanks Chris, Mostapha, and Mingbo!

Hi @sunnydu, the Ironbug issue has been fixed. It is because the GFuncs in the Vertical Heat Exchanger. A really rare case that failed the translation.

A new version of the Pollinaiton installer will take more time to release. But if you want, you can just download the latest version of Ironbug installer, that should update the old version on your machine.

1 Like

FYI, I also implemented an improvement so that, if this ever happens again, you will get the Ironbug failure message in Grasshopper:

This should help us identify the problem faster next time.

This issue is resolved in v1.65.21 and later.