I am writing an ACT extension to encapsulate a custom result and need to take the derivative of that nodal result with respect to time. Is it possible to build in a derivative in ACT like this?
June 6, 2022 at 9:58 amFAQParticipant
There are two main options here: Create the derivative yourself in Python, or call out to APDL to invoke the DERIV command.
If creating the derivative yourself, it will require some numerical programming as (unfortunately) ACT’s Python does not have access to SciPy. If calling APDL, note that ansys.RunANSYS() might not won’t work in an Evaluate or Generate callback due to a threading issue. It probably will, but if not, here is how to do it without “import ansys” capabilities:
from Ansys.Utilities import ApplicationConfiguration
from System.Diagnostics import Process
from System.Diagnostics import ProcessStartInfo
from System.Diagnostics import ProcessWindowStyle
# Create a tmp bat file in this path
bat_file = System.IO.Path.Combine(apdlDir,’tmp.bat’);
info = System.IO.StreamWriter(bat_file)
a = ApplicationConfiguration.DefaultConfiguration.AwpRootEnvironmentVariableValue
b = System.IO.Path.Combine(a,’ansys’)
c = System.IO.Path.Combine(b,’bin’)
d = System.IO.Path.Combine(c,ApplicationConfiguration.DefaultConfiguration.AnsysPlatform)
e = System.IO.Path.Combine(d,’ansys162.exe’)
commandLine = ‘”‘+e+'” -dir “‘+apdlDir+'” -j “file” -b -i “‘+apdlInput+'” -o “‘+apdlOutput+'”‘
# Run the bat file now
startInfo = ProcessStartInfo(bat_file, None)
startInfo.WindowStyle = ProcessWindowStyle.Minimized
p = Process.Start(startInfo)
# Delete the tmp bat file
In this code, we create a tmp file with the command we want, and execute it with ANSYS. A nice way to get any APDL functionality in your ACT code.
Introducing Ansys Electronics Desktop on Ansys Cloud
The Watch & Learn video article provides an overview of cloud computing from Electronics Desktop and details the product licenses and subscriptions to ANSYS Cloud Service that are...
How to Create a Reflector for a Center High-Mounted Stop Lamp (CHMSL)
This video article demonstrates how to create a reflector for a center high-mounted stop lamp. Optical Part design in Ansys SPEOS enables the design and validation of multiple...
Introducing the GEKO Turbulence Model in Ansys Fluent
The GEKO (GEneralized K-Omega) turbulence model offers a flexible, robust, general-purpose approach to RANS turbulence modeling. Introducing 2 videos: Part 1 provides background information on the model and a...
Postprocessing on Ansys EnSight
This video demonstrates exporting data from Fluent in EnSight Case Gold format, and it reviews the basic postprocessing capabilities of EnSight.
- The warning message is: “The maximum contact stiffness is too big. This may affect the accuracy of the results.” Why does large contact stiffness affect results accuracy?
- Contact Definitions in ANSYS Workbench Mechanical
- How to resolve “Error: Invalid Geometry”?
- After Workbench crashes, how can I recover the project from a .mechdb file?
- Model has a large number of contacts – how to reduce them?
- How to locate an element of a particular ID number in Mechanical?
- How to display the color of each body based on the material in Mechanical?
- Please explain the warning message “coefficient ratio exceeds 10e8” ?
- How to Connect Excel to Workbench
- How can I plot bodies colored by material property in Workbench?