August 14, 2023 at 4:18 amAzmin ZamsaniraniSubscriber
I'm working on modifying the AveTemp act extension, which calculates the average temperature of a model. However, the initial output doesn't match the current unit system in Mechanical. For instance, when using the U.S Customary unit system, the result should be in Kelvin, but it's currently produced in Celsius. To address this, I've set the default value as Celsius, as changing it to Kelvin would lead to incorrect output. For example, if the average temperature is 65 Celsius, and I switch to U.S Customary units, it displays 65 Kelvin, which is inaccurate. How can I ensure the output aligns with the current unit system
August 15, 2023 at 10:30 ammjmiddleAnsys Employee
This seems to be the same question as your post:
You need to get the current units and convert:
#toUnit = ExtAPI.DataModel.CurrentUnitFromQuantityName("Temperature")
toUnit = result.Properties["MyProperty"].GetCurrentUnit() # assuming unit="Temperature" in property in XML
fromUnit = 'C'
result.Properties["MyProperty"].Value = units.ConvertUnit(2.54, fromUnit, toUnit)
- You must be logged in to reply to this topic.
Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- License Error
- Error with workbench SceneGraphChart
- Sizing on Ansys Workbench 19.2
- Workbench not opening
- Error: Exception of type ‘Ansys.Fluent.Cortex.Cortex not availableException’ was thrown
- Workbench error
- how to open DesignModeler
- FlexNet Licensing – Not running
- Problem with FlexNet Licensing
- An error occurred when the post processor attempted to load a specific result.
© 2023 Copyright ANSYS, Inc. All rights reserved.