[SCRIPTING] Automate plane generation and analysis workflow

Questions, suggestions, feature requests, bug reports, feedbackCategory: Questions[SCRIPTING] Automate plane generation and analysis workflow
João HackbartJoão Hackbart asked 2 years ago

I’m using an optimization software called modeFrontier and I’d like to integrate it with flow5. The main idea here is that I need to be able to automate both plane generation and analysis.
Essentially I’m trying to do the following routine without having to access the GUI: 
Change Plane Parameters  –>  Run Analysis  –>  Get Results  –>  Loop
I have a few questions about this workflow:

  1. Does the plane.xml(plane geometry) have to be “loaded” in flow5 for the calculated values to be populated in the XML? In other words, can I change the geometry in the XML and then run the analysis directly without opening flow5 first?
  2. The projected reference dimensions(Area,Span,Chord) in the result file don’t seem to change regardless of what is changed in the plane script. (If I open the results project in flow5 it shows the correct dimensions)
  3. The CSV file with the analysis results is unstructured, so it cannot be opened in excel or any other csv parser in a simple way. It has one column with all the data. Is there anything that can be done to make the readability of the result file better?

Thank you for your help!
 

André Deperroistechwinder Staff replied 2 years ago

Hello,
1. Yes, that is is the intent of the xml files and of the scripting process
2. I’ll check and post back
3. Not sure which csv export you are referring to. Also, did you make sure that the field separator selected in flow5 is recognized by the spreadsheet? The separator can be selected in the Preferences/Save, load and export.
André

André Deperroistechwinder Staff replied 2 years ago

2. Looks good as far as I can tell.
In the analysis file, did you specify the CUSTOM option for the reference dimensions?

2 Answers
João HackbartJoão Hackbart answered 2 years ago

I’m not sure if the comment I made went through, I’ll write as an answer.
Thank you for the quick reply!
I can confirm that, if I change for example the wingspan within the flow5 GUI and then export an analysis, the result will show the correct ref. dimensions as in the analysis file.
The problem I have is that, if I only change the wingspan in the xml file and then run an analysis directly, it does not take that value into consideration for the ref. dimensions, possibly because the dimensions are already written in the analysis file (?)
Btw, I have the ref. dimensions specified to PROJECTED.

João HackbartJoão Hackbart replied 2 years ago

2.

André Deperroistechwinder Staff replied 2 years ago

Still cannot reproduce the problem.
By “run the analysis directly”, I assume you mean running a script from the command line?
Since it is easy to overlook something, here are some key points to check:
– the script calls the intended xml plane definition file
– the script calls the intended xml plane analysis file
– the analysis file specifies “PROJECTED” dimensions – which you have confirmed
– the script runs and ends successfully; use the option -p to enable terminal feedback, or check the log file generated in the output directory
– once done, you are opening the intended result file

João HackbartJoão Hackbart replied 2 years ago

This seems very strange. All of the steps you mentioned were performed and verified through the log file.

I’ll try to describe the steps to reproduce, just in case there is something I might have missed before.

–Script runs successfully and creates a result file in the output directory. Open result file and note the ref. dimensions. (Wingspan for example)
–Go to plane directory and open plane definition file. Change “wingspan” to a new value. Save and close plane definition file.
–Run script again. Go to output directory and open the result file. You should see that the ref. dimensions (ie. Wingspan) are the same, even though other values have changed according to the new wingspan value.

André Deperroistechwinder Staff replied 2 years ago

This is weird because when you run the second script, flow5 should have no memory of the first run. It only knows what is in the modified xml files.

To “Change the wingspan”, I assume that you are changing the value of the y_position of a section?
Are you certain that you are changing the MAINWING’s section and not that of the elevator for instance?
When you open the .fl5 file generated in the output directory, the plane has indeed the modfied wing sections? And the polar is using PROJECTD values?

João HackbartJoão Hackbart replied 2 years ago

Exactly, I change the “y_position” of the next/last section. I can confirm I’m changing the correct wing, since I have variables defined for each parameter in the fin, elevator and mainwing so they are clearly separated.
Now this is the curious part if I open the generated .fl5 project. It shows the correct ref. dimensions in the GUI.

If you’d like I can send you some screenshots over email to exemplify.

André Deperroistechwinder Staff replied 2 years ago

The last phase of the script is to export the same content to the .fl5 file and to the text files.
I’ll send you a private message so that you can forward the screenshots.

João HackbartJoão Hackbart answered 2 years ago

Regarding question 3.
Thank you for this tip, I had not setup the separator, this should make things easier!