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: 

Retrieve Cloud Solve Results using API

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
sportner
646 Views, 10 Replies

Retrieve Cloud Solve Results using API

Hi, I'm trying to set up a workflow in which I use Sim CFD 360 pro 2014 (student license) entirely through the API command line interface. So far I've been successful in creating a design study, populating it with designs of differing geometry (where geometries are generated through command line interaction with NX8 CAD), set up the scenarios (BC's, the desired mesh setting, materials, and solver parameters), and sent the scenarios to the 'cloud' solver. I seem to be stuck when it comes to retrieving the results.

 

What is the API interaction required for retrieving results solved remotely?

 

I have noticed that when the graphical window is open results are collected in a "From Server" folder that does not get populated when the GUI is not open. It also appears that with the GUI open once all of the results make it to the "From Server" folder some work is done extracting them and moving them into the "solver" folder.

 

- Stephen

Tags (3)
10 REPLIES 10
Message 2 of 11
Royce_adsk
in reply to: sportner

There are some limitations here that even internally we have looked into doing something very simlar, but so far I haven't seen anyone successuly acomplish an end to end solution.  So, I don't think that functionality is there yet in the API to automatically cycle through each the studies to process the results.

 

One thing you could look into doing is using the triggers to write out a text file when it reaches the 'Solver Finished' option. You could write a script to move onto the next scenario based on discovery of some sort of marker, log in the text file.  I have done this sort of workflow and works well when all scenarios are finished and ready to be processed.  When you have a mix of already process, still running in the cloud, ready to be processed that the limitation exists.

 

Make sense?



Royce.Abel
Technical Support Manager

Message 3 of 11
sportner
in reply to: Royce_adsk

Royce, thanks for the response. Yes that makes sense. I have no problem with waiting to do post-processing until all scenarios have completed. I'll look into doing something with the triggers.

 

To make sure I understand you, when you say "I don't think that functionality is there yet in the API to automatically cycle through each the studies to process the results," by 'process the results' do you mean process in the sense of extracting simulation information e.g. wall results? Or do you mean perform the processing of the downloaded solution files into the solver files we would find in the 'solver' folder?

 

I haven't found how to process even a single scenario directly from the scripting API if that scenario has not been accessed through the GUI since the calculation has completed. Have I missed something, or is that the limiting factor in an end-to-end solution?

 

To give a better idea of what I'm doing my work flow is outlined below:

 

1) Driver Python script

    a) Call NX CAD to update geometries

    b) Call cfdsim360 script to set up design study

    c) Call cfdsim360 script to run design study

    d) Call cfdsim360 script to analyze results

    e) Make geometry changes based on results and perhaps go back to (a) saving everything in a new directory under a new design study

 

 

Message 4 of 11
Royce_adsk
in reply to: sportner

The second statement, you can do post-processing with the API.  I have done a fair amount in that department.

 

When it comes to processing the results files so you can do post-processing you need to realize that is only done when the scenario is made active from the API. That is basically activating the scenario from the UI. At this point if the results are available the UI will process the results.  Make sense?  In otherwords, there is no function call  scenario.GetResultsFromCoud or scenario.ProcessAvailableResults.

 

Cheers,



Royce.Abel
Technical Support Manager

Message 5 of 11
sportner
in reply to: Royce_adsk

Ok I've done a little more work and still seem to be missing something. If I do a local solve, I can do exactly as you describe, from the command line call a script that runs a simulation then waiting until the simulation is finished and then calling another script from the command line to make the scenario active loads the results from the 'from server' folder into the 'solver' folder. This is all without the UI ever being opened.

However, if I do a cloud solve, and follow the same process of calling scripts from the command line to run the simulation, wait till its finished, then call another script to activate the scenario, the results aren't processed and moved from the 'from server' folder to the 'solver' folder. If i go look in the 'from server' folder there isn't anything in it. All of the results are still in the "File Transfer Temporary Folder" (as given in the Simulation Job Manager) but not in exactly the correct form so I can't just copy them over.

 

How do I retrieve those results from the temporary folder to the scenario work folder?

Message 6 of 11
Royce_adsk
in reply to: sportner

The back end of file management is a little different between 360 and Desktop.  Did you look into using Triggers yet?  



Royce.Abel
Technical Support Manager

Message 7 of 11
sportner
in reply to: Royce_adsk

I did look into using triggers and using one that writes to a file upon each scenario completion works just fine. The problem is the triggered isn't 'triggered' until the design study opened and the scenario activated in the UI.

 

Now, I have put together a workaround that opens the design study with the correct scenario activated in the UI via an external python script, but its not a very elegant solution. The python script cycles through the scenarios opening one after another in the UI in order to get the results moved from the temporary folder to the 'from server' folder and then processed into the 'solver' folder. It would be great if there were some way to do this (results in temp folder -> from server folder -> solver folder) using the API directly.

Message 8 of 11
Royce_adsk
in reply to: sportner

That is the process that you need to do.  That is what I was getting at in terms of limitations :-).

 

Cheers,



Royce.Abel
Technical Support Manager

Message 9 of 11
sportner
in reply to: Royce_adsk

Ok, very good. Thanks for the assistance.
Message 10 of 11
hartogj
in reply to: sportner

Any way you can share what kind of work you are looking to do using the API together with cloud solves? Is it optimization or just a very large number of cases you need to run?

 

We are always interested in leanring more about what folks are looking to do in this area.

 

Thanks,

Jon



Jon den Hartog

Product Manager
Message 11 of 11
sportner
in reply to: hartogj

Hi Jon,

 

As you suggested, I'm working on an optimization of sorts. The overall goal of the work I'm doing now is to design a small propeller for small underwater vehicles. Because the propeller is small (I'm really bit on the small aspect) it can end up having very low chord based Reynolds numbers. For such small Reynolds numbers the experimental data available is lacking which stops me from having great faith in a minimum induced loss propeller design based on data from entirely different flow regimes.

 

What I'm using the CFD for specfically is to design and analyze very low chord based Reynolds number (10,000-50,000) airfoils which would then be used as inputs to a minimum induced loss propeller design code. Since I'm interested in 2D sectional performance, CFD should be accurate and cheap (timewise) enough to use as an iterative design tool. Using the API makes optimization much easier while cloud solves allow me to run all of the cases for a given design iteration in parallel.

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

Post to forums  

Autodesk Design & Make Report