Scripting

371 views
Skip to first unread message

eta

unread,
Jul 24, 2018, 5:15:07 AM7/24/18
to OpenVSP
Hi all,



I was looking at the api documentation (http://openvsp.org/wiki/doku.php?id=api#vsp_cfd_surface_behavior_type_enums) trying to write a script for OpenVsp but it doesn't seem to help enough.

The script should do the following: read a .vsp3 file (ReadVSPFile( "test.vsp3" );), modify parameters and run a VSPAERO solver run and export a .polar file.

For now I have been able to read in the file and modify some parameters by hand by manually looking up the ID (e.g. UQDYHMGCNF for 'AirfoilExport').



As to my questions: how do I exactly implement this to be automated, and what is the exact syntax to run a .vspscript in cmd?

Also: many threads say "pass in command line" or "run from batch mode" but what is the syntax for that?



Any help would be greatly appreciated!

-Edouard

Rob McDonald

unread,
Jul 25, 2018, 1:52:16 AM7/25/18
to ope...@googlegroups.com
At the command line, you can run "vsp --help" and you will get the following:

          Vehicle Sketch Pad 3.16.1

-----------------------------------------------------------

Usage: vsp [inputfile.vsp3]               Run interactively

     : vsp -script <vspscriptfile>        Run script

-----------------------------------------------------------


VSP command line options listed below:

  -help              This message

  -des <desfile>     Set variables according to *.des file

  -xddm <xddmfile>   Set variables according to *.xddm file


-----------------------------------------------------------



So, to run a script, you type the following

vsp -script myscript.vspscript

There is also the 'vspscript' executable that you can run.  It is a little smaller, and if you are on a Unix cluster or supercomputer that does not have graphics libraries installed, you can still probably run this one.  It has all the graphics and user-interface stuff stripped away.  It can _only_ run in script mode

vspscript -script myscript.vspscript


You can certainly open your script with ReadVSPFile.  However, since that is such a common option, you can also just pass the file name to the command line.  This is handy if you want to use the same script with many different file names at different times.

vsp airplane.vsp3 -script myscript.vspscript

It will load airplane.vsp3 and then run the script and then terminate.

If you simply wan to change a few variables (as in a typical design or trade study workflow), then the easiest way is to use the -des file capability.  For that, you can do something like:

vsp baseline.vsp3 -des changes.des -script myscript.vspscript

Where now all the script has to do is manage whatever analysis chore you want performed.

Rob


--
You received this message because you are subscribed to the Google Groups "OpenVSP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openvsp+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

edouard...@gmail.com

unread,
Jul 27, 2018, 10:06:25 AM7/27/18
to OpenVSP
thank you very much!
To unsubscribe from this group and stop receiving emails from it, send an email to openvsp+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages