TAGGED: #python-#ironpython, ansys-running-slow, heatflux, temperature
-
-
June 1, 2023 at 11:38 pm
Federico Mazzoni
SubscriberHi!
I'm working with Transient Thermal module for a project about heat exchange simulation in a city.
My geometry consists on 4 "city blocks", a round area surrounding the city and a sky dome (see screenshot below). The meshing has roughly ~20k face elements.
Our goal with this project is to load data (materials/convection/radiation/temperature) and run a simulation, expecting to have similar results to what we already have from another software (we already have result data about how the city is heated/cooled throughout the day, and we're basically moving that project to ansys)
At this point we have modeled the materials/convection/conduction and got the results we somewhat expected. However we're facing a problem with how much data we can load into ansys in a reasonable time.
Besides modeling convection/materials, we also need to load the following data from outside ansys (csv files basically):
1) Sky dome temperatures.
For every face element of the sky dome, we use historical data to determine a different temperature for different time steps throughout the day. So we have something like: at 00:00 this piece of the sky is, say, 15 ºC. temperature. For 00:30 some other piece of sky is, say, 20 ºC. We are using scripting to get some calculations done and load temperatures into the model. Our sky dome has 297 face elements, so we end up with 297 Temperature elements, each one of them with its own tabular data that determines the temperature of the sky face element for each 30 min step throughout the day. We have no problems up to this point
2) Heat flux.
There are also heat fluxes that we need to load. We have one for every face element of the city. We also need tabular data in a time/value manner just like what we have for the sky dome and its temperatures, but in this case, for each and every face element of the city mesh. We would need somewhere around ~20k heat flux elements. Here is where we start facing performance issues. It just takes too long to load all of these Heat Fluxes, and it gets slower and slower and slower the more Heat Fluxes are already loaded to the model. We managed to load 4072 heat fluxes that correspond to the radiations that act on the roof of the city, which took about 8 hours, but it would take forever to load the remaining ~15k.
The way our script works is: we read some csv files and generate a json object (using OrderedDict) that has the information of which (mesh element,face id) has which flux value. Generating this json takes about 5 seconds. We then iterate through this json keys, create Heat Flux objects (using heat_flux = analysis.AddHeatFlux()) and assign them the data that we have for each one. This is what seems to be the bottleneck.To confirm that, I went back to the sky dome and ran the script that creates Temperature Objects and measured the time it took to run it each time, without deleting previously loaded data, this is what I got:
-Create 150 Temperatures: 64 seconds
-Create another 150 Temperatures: 73 seconds
-Another 150 ... :89 seconds
- ... :109 seconds
- ... :126 seconds
- ... :149 seconds
So the question is, is there another way to load this data in the way we want, but reducing the time it takes to do so?Thanks in advance, and if you need me to describe something else or just give more insight on what we´re trying to acomplish, just ask!I leave you to the screenshots:Our city:The city surroundings, with bigger mesh elements (precision is less important the further away from the city we are)Sky dome, with 297 face elements:Example of temperature data for one element of the sky dome:The heat fluxes we managed to load so far:Example of one heat flux data:A frame of the simulation: -
June 5, 2023 at 10:50 am
Rob
Ansys EmployeeJust to confirm, you're using Mechanical?
-
- 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.

Ansys Blog
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.
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Suppress Fluent to open with GUI while performing in journal file
- Mesh Interfaces in ANSYS FLUENT
- Time Step Size and Courant Number
- error: Received signal SIGSEGV
-
7742
-
4502
-
2961
-
1449
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.