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?
Tagged: act, custom, DERIV, derivative, result
-
-
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:
—————
import Ansys.Utilities
from Ansys.Utilities import ApplicationConfigurationimport System
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+'”‘
info.WriteLine(commandLine)
info.Close()# Run the bat file now
startInfo = ProcessStartInfo(bat_file, None)
startInfo.WindowStyle = ProcessWindowStyle.Minimizedp = Process.Start(startInfo)
p.WaitForExit()# Delete the tmp bat file
System.IO.File.Delete(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.
- How to deal with “”Problem terminated — energy error too large””?”
- The LS-DYNA equivalent of *MODEL_CHANGE card (in ABAQUS). Which keywords can be used to introduce(activate)/delete(deactivate) elements in the middle of a calculation (at user-specific time/load steps).
- Contact Definitions in ANSYS Workbench Mechanical
- How do I request ANSYS Mechanical to use more number of cores for solution?
- There is a unit systems mismatch between the environments involved in the solution.
- How to restore the corrupted project in ANSYS Workbench?
- After Workbench crashes, how can I recover the project from a .mechdb file?
- How to resolve “Error: Invalid Geometry”?
- Model has a large number of contacts – how to reduce them?
- Please explain the difference between Point Mass and Distributed Mass.
© 2024 Copyright ANSYS, Inc. All rights reserved.