{"id":164529,"date":"2023-03-17T08:57:57","date_gmt":"2023-03-17T08:57:57","guid":{"rendered":"\/knowledge\/forums\/topic\/i-try-to-run-a-functional-mock-up-interface-fmi-co-simulation-in-cfx-my-functional-mock-up-unit-fmu-specifies-units-for-the-input-and-output-variables-but-cfx-sees-them-as-unitless-what-is-the\/"},"modified":"2023-07-31T12:25:45","modified_gmt":"2023-07-31T12:25:45","slug":"i-try-to-run-a-functional-mock-up-interface-fmi-co-simulation-in-cfx-my-functional-mock-up-unit-fmu-specifies-units-for-the-input-and-output-variables-but-cfx-sees-them-as-unitless-what-is-the","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/i-try-to-run-a-functional-mock-up-interface-fmi-co-simulation-in-cfx-my-functional-mock-up-unit-fmu-specifies-units-for-the-input-and-output-variables-but-cfx-sees-them-as-unitless-what-is-the\/","title":{"rendered":"I try to run a Functional Mock-up Interface (FMI) Co-simulation in CFX. My Functional Mock-up Unit (FMU) specifies units for the input and output variables, but CFX sees them as unitless. What is the reason for this and is there a workaround?"},"content":{"rendered":"<p>If your FMU is written in Modelica, it will probably specify units for the input and output variables, e.g., like this on the Modelica side:    Modelica.Blocks.Interfaces.RealInput InputA(unit=&#8221;W\/m2&#8243;)  which will be translated to something like the following in the .xml file of the FMU:      <ScalarVariable       name=\"InputA\"       causality=\"input\">       <Real         declaredType=\"Modelica.Blocks.Interfaces.RealInput\"         unit=\"W\/m2\">     <\/ScalarVariable>   Due to a known issue with its internal FMU library, CFX will not carry over the units of such variables correctly in versions up to CFX 2019 R2 and thus the variables are shown and treated as unitless. In Release 2019 R3, the issue will be corrected and the variables will carry the units that have been specified on the Modelica side.  As a workaround, you can make the value that CFX passes to the FMU &#8220;artificially&#8221; unitless by multiplying them with the reciprocal value of its unit. For the example above, InputA corresponds to a heat flux with unit [W m^-2], so you need to multiply the value that is computed by CFX with 1 [m^2 W^-1], e.g. like this:  LIBRARY:    CEL:      &#038;replace FUNCTION: myFMU       FMU File Name = D:\/myPath\/myFMU.fmu       FMUI Function = True       Option = Functional Mockup Unit Instance       ARGUMENT VALUE: InputA         Expression Value = areaAve(Wall Heat Flux)@WallA*1[m^2 W^-1]         Result Units = []         Value Name = InputA       END     END   END END<\/p>\n","protected":false},"template":"","class_list":["post-164529","topic","type-topic","status-publish","hentry","topic-tag-2019-r2","topic-tag-cfx","topic-tag-fluid-dynamics","topic-tag-fmu","topic-tag-general-cfx"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["3-15-2023  20:20:36"],"_bbp_forum_id":["27796"],"_bbp_author_ip":["23.56.168.180"],"_btv_view_count":["1751"],"siebel_km_number":["2060331"],"product_version":["2019 R2"],"km_published_date":["2019-08-12T00:00:00.000Z"],"family":["Fluid Dynamics"],"application_name":["CFX"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164529\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=164529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}