-
-
February 18, 2022 at 1:49 pm
Shekhar
SubscriberDear Community,
I have been practicing a thermal modelling routine in APDL.
The modelling includes a repetition of a certain set of commands and scalar parameters in a cycle. I got it through the *DO and *IF commands. However, the code is getting extremely lengthy and time taking (for compilation) to set *IF command for every *DO parameter value (Like *DO is running from 1 to 100). But, in actuality the scalar parameters on change for the even and odd values of the *DO parameter.
The code I want goes like this (but it is not working)
!-----------------------------------------------------------------------------
*DO,ii,1,100,1
*IF,ii,EQ,'EVEN',THEN
X = 1
*ELSEIF,ii,EQ,'ODD',THEN
X = 2
*ELSE
*ENDIF
!--------------------------------------------------------------------------
If anybody knows how to set this working, please help
February 21, 2022 at 9:44 pmDaniel Shaw
Ansys EmployeeThere are probably multiple approaches that will work. One approach might be to use the MOD(x,y) function. to find the remainder. Something like:
x1 = mod(ii,2) ! place immediately after *DO command
If ii is an even number; then x1 would be equal to zero
If ii is an odd number, then x1 would be equal to 1
You can then use x1 in the *IF statements
Viewing 1 reply thread- You must be logged in to reply to this topic.
Ansys Innovation SpaceBoost 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.
Trending discussions- how to improve the inflation quality at sharp corners?
- ANSYS Workbench Measuring within Design
- check element type
- The mesh file exporter could not resolve cyclic dependencies in overlapping contact regions error
- How to resolve Mesh Failure
- Meshing Error
- Error in meshing
- Conformal vs Non-Conformal Mesh
- execution error inside the mesher. The process suffered an unhandled exception or ran out of memory
- inflation created stairstep mesh at some location
Top Contributors-
3694
-
2558
-
1765
-
1234
-
590
Top Rated Tags© 2023 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-