Community
CFD Forum
Welcome to Autodesk’s CFD Forums. Share your knowledge, ask questions, and explore popular CFD topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Helping with CFD Automation using Python and Qt

2 REPLIES 2
Reply
Message 1 of 3
jdmurrow86
412 Views, 2 Replies

Helping with CFD Automation using Python and Qt

Hello,

 

I'm trying to set-up up an analysis, run it, and then extract results. It's my understanding that Qt can be used to create the set-up portion, whereas Python is typically used to extract results/change parameters once an analysis has been set-up.

 

The documentation for the API is very sparse. Does anyone here have any in depth knowledge of Qt or Python that has run a designstudy before in auto mode using the aforementioned programming languages? And is there more in-depth documentation for doing so? Do I need to download a Qt editor to do the set-up and then run a Python script? Any help would be great. Thanks.

 

jdmurrow86

2 REPLIES 2
Message 2 of 3
OmkarJ
in reply to: jdmurrow86

Depends on what you want to automate really. I have done small scripts to first run the simulation using k-eps and then RNG for stability. I could find one:

 

#========================#

# Script for just the active scenario#

#========================#

 

from CFD import Setup

 

#setup the scenario

study = Setup.DesignStudy.Create()

scenario = study.getActiveScenario()

 

#setup the basic model

scenario.setProperty("solverComputer", "Cluster (16 cores)")

scenario.setProperty("flow", "On")

scenario.setProperty("analysisMode", "Steady State")

scenario.setProperty("autoStartup", "Extend")

scenario.setProperty("turbulence", "On")

scenario.setProperty("intelligentSolutionControl", "On")

scenario.setProperty("automaticConvergenceAssessment", "Off")

scenario.setProperty("turbLamRatio", "1000")

 

#run with k-epsilon/ADV1

scenario.setProperty("turbModel", "k-epsilon")

scenario.setProperty("advectionScheme", "ADV 1")

scenario.setProperty("continueFrom", "s0")

scenario.setProperty("iterations",800)

scenario.run()

 

#run with RNG/ADV5

scenario.setProperty("turbModel", "RNG")

scenario.setProperty("advectionScheme", "ADV 5")

scenario.setProperty("continueFrom", "s800")

scenario.setProperty("iterations", 2200)

scenario.run()

 

There was a script which I could get done with Autodesk Support's help, where it automates more than one scenario by looping through the Design Study, but can't find it right now. You might find the "Examples" section in API doco quite handy. You can pick and choose the code from there to suit to your requirement. But I agree, the doco is sparse and we could do with a bit more comprehensive guide and more examples. 

Message 3 of 3
apolo_vanderberg
in reply to: OmkarJ

I'd imagine you might ahve also seen the extra exampls scripts in the local help that can be downloaded from here

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report