importing OpenVSP geometry into SUAVE

596 views
Skip to first unread message

Samuel Ferguson

unread,
Jul 11, 2018, 4:59:16 PM7/11/18
to SUAVE FORUM
Currently I am trying to use the BWB_CFD tutorial file in order to run tests on my design via the script.

However, my issue is that due to the nature of my design, mainly that it has blending throughout the wings, I can't seem to recreate the design via the script, and was wondering if there was either a way to blend wings in SUAVE, or a simpler approach of importing the OpenVSP geometry into the script.

Any help is appreciated

Emilio

unread,
Jul 11, 2018, 11:50:01 PM7/11/18
to SUAVE FORUM
Hi Samuel,
Thanks for your question. A couple of things. 

While we have the ability to export to OpenVSP, we are current working on the ability to import geometries from OpenVSP into SUAVE. However, that effort is not expected to be complete until the end of the summer.

Second, as of now in SUAVE we linearly discretize wing geometries. This is due to the nature of conceptual design. In OpenVSP you can do more complex blended lofts. However, those complex shapes don't lend well to simple aerodynamic methods. So to get a nice BWB shape like in the tutorial we usually but a lot of segments in the wing (think Riemann sum approximation to an integral). 

I hope that helps. Let me know how we can help further.

-Emilio

Samuel Ferguson

unread,
Jul 12, 2018, 10:28:00 AM7/12/18
to SUAVE FORUM
Thanks for the response! One more question,

Is it possible to circumvent the geometry used in the BWB_CFD tutorial script?
I have figured out how to use a python script to generate the needed su2 file for the simulation, however I can't seem to find where in any of the scripts the su2 geometry file is selected. Is there a way I can tell it to use my geometry file instead?

Thanks
-Sam

Emilio

unread,
Jul 12, 2018, 12:24:08 PM7/12/18
to SUAVE FORUM
Hi Sam,
Yes, you can easily circumvent it. Just remove this line here:

Then you just need to have matching base tags with your OpenVSP file since SUAVE/SU2 will be looking for that file name.

The BWB tutorial script also pulls out the areas as well. So it's a good idea to keep using that in case you change things.

However! The viscous drag results will probably be inaccurate because we add analytical/correlative viscous drag components on to the Euler results. So if you're looking to run a mission the results could be very misleading.

-Emilio


Samuel Ferguson

unread,
Jul 16, 2018, 10:41:28 AM7/16/18
to SUAVE FORUM
Thanks, however it seems as though the script still wants to run a mesh generation, it seems like that comes from the SU2 script. When this runs it generates some error due to the mesh it creates when trying to export, causing the script to fail. Is there a way to stop the SU2 script from making its own mesh without editing the scripts that where installed?

Emilio

unread,
Jul 16, 2018, 1:24:01 PM7/16/18
to SUAVE FORUM
Hi Sam,
Okay, from before I was under the impression you wanted to use our meshing.

If you have your own mesh files ready to run in SU2 you can skip that by adding these two lines:
    aerodynamics.process.compute.lift.inviscid.geometry = aerodynamics.geometry
    aerodynamics.finalize = aerodynamics.process.compute.lift.inviscid.initialize

You would put these right here:

This is probably the easiest fix without changing any code in SUAVE.

I have to ask, if you have your own OpenVSP file and your own mesh manually why do you need SUAVE to run SU2? Why not run all your cases, store the results and then load them into SUAVE?

-Emilio

Samuel Ferguson

unread,
Jul 16, 2018, 3:03:59 PM7/16/18
to SUAVE FORUM
Currently I am running my own meshing because when I let it do so via SUAVE it ends up with an error when running the gmsh segment, leading to the script crashing

vsp user

unread,
Mar 11, 2019, 5:30:47 PM3/11/19
to SUAVE FORUM
I am trying to import a geometry that I created in open VSP into SUAVE. From this thread, I learnt that the team is still working on this. Are there any tools or codes that I can use to achieve the same? 

Thanks in advance

Emilio

unread,
Mar 11, 2019, 7:09:09 PM3/11/19
to SUAVE FORUM
Howdy!
We actually started work on this over the past summer. However, OpenVSP has some short comings that we cannot change. Therefore, we have some functionality and it isn't totally automatic.

OpenVSP does not have the ability to query a model to determine which component is which, i.e. through Python we don't know which GEOMS are wings and which are fuselages. So you must manually find the ID of each component and import it sequentially using our scripts.

We currently have the ability to import wings, fuselages, and BEM exported propellers. You can see some of the scripts that would help you here:


You'll also need to append an energy network, setup a mission, etc... like you normally would.

-Emilio

Rob McDonald

unread,
Mar 12, 2019, 12:46:48 AM3/12/19
to SUAVE FORUM
Have you tried GetGeomTypeName? You might also be interested in GetGeomTypes.

I would suggest you work with stacks instead of fuselages -- they're generally much easier to deal with.  Your fuselage code should convert pretty easily.

Rob

vsp user

unread,
Mar 12, 2019, 4:30:38 PM3/12/19
to SUAVE FORUM
Quoting my response before Rob: 
"Thank you Emilio, for getting back on this so quickly with a prompt response.

This might be really a naive question. I am sorry if it is so. So, I implemented the vsp_read_fuselage.py program. It runs without any errors - which means I was successfully able to interface the python API with open vsp. However, I am a bit unclear on how to obtain fuselage_id from open vsp and does calling the "vsp_read_fuselage.py" function in the main program with that fuselage_id suffice? For example, I have attached a sample fuselage that I am trying to import to python using this vsp_read_fuselage function.

Are you having a working folder that could be shared: which contains an sample open vsp fuselage or wing file that is being imported using the aforementioned function.

I appreciate any and all help you can provide in this direction.

Thank you once again."
 
I am sorry, I had  replied on the email because of which it does not show up here on the thread which might be helpful for somebody else following this thread.




Thank you Rob. That was helpful; I was able to retrieve the fuselage-id using that and able to get the 'vsp_read_fuselage.py' work.

Now, I am trying to write the fuselage onto OpenVSP. It might sound senseles to read from OpenVSP and write it back again - however, the final goal is to automate the design modification using OpenVSP. I was trying to work only on fuselage and was using the 'write_vsp_fuselage()' function in the 'vsp_write.py' file. Is there some way I can get this function to work by skipping the 'main_wing', and 'tank_set_id' arguments? I do not have these in my original design and needed the write feature to work just using the fuselage that I read using the 'vsp_read_fuselage.py' file.


Thanks again in advance

Tim MacDonald

unread,
Mar 12, 2019, 10:35:06 PM3/12/19
to SUAVE FORUM
Since your fuselage will have segments defined (since it was read from OpenVSP already) and does not have fuel tanks, you should be able to get away with passing a dummy argument for those (i.e. None). This should work because the main wing is only used to position segments when none are provided, and the fuel tank set index is only used if the fuselage contains fuel tanks.

vsp user

unread,
Apr 8, 2019, 8:16:18 PM4/8/19
to SUAVE FORUM
Hi SUAVE team,

I noticed that SUAVE had generated functionalities to import fuselage and wing from OpenVSP into SUAVE. I could successfully use the files read_fuselage.py and read_wing.py in the Input_Output folder of SUAVE. Is there a similar functionality for importing simple propeller geometries as well? 

In 'vsp_read.py' I notice there is a function called 'read_vsp_prop.py' similar to 'read_fuselage.py' and 'read_wing.py'. However, I only find  'read_fuselage.py' and 'read_wing.py', but not 'read_vsp_prop.py'.

Is that still a work in progress or am I missing something?

Thank you for your support.

Emilio

unread,
Apr 8, 2019, 8:39:42 PM4/8/19
to SUAVE FORUM
Hi,
Yes, we're able to read in propeller geometries. However, it's not totally automatic.

If you export a propeller geometry from OpenVSP you can generate a .BEM file which can be read in using this script: https://github.com/suavecode/SUAVE/blob/develop/trunk/SUAVE/Input_Output/OpenVSP/BEM_read.py

Here's some example code that I used in the past for importing:


results_f
= SUAVE.Input_Output.OpenVSP.BEM_read('pusher.bem',units_type='foot')

propeller_forward = SUAVE.Components.Energy.Converters.Propeller()
propeller_forward
.radius_distribution = results_f.radius
propeller_forward
.twist_distribution  = results_f.twist
propeller_forward
.chord_distribution  = results_f.chord
propeller_forward
.tip_radius          = results_f.diameter/2.
propeller_forward
.number_blades       = results_f.num_blade
propeller_forward
.origin              = results_f.origin
propeller_forward
.orientation         = results_f.normal
propeller_forward
.tag                 = 'prop_forward'

This is still an active area of development so if you put together something that improves upon this, please put in a pull request.

-Emilio

vsp user

unread,
Apr 8, 2019, 8:58:16 PM4/8/19
to SUAVE FORUM
Hi Emilio,

Fantastic! That worked perfectly for my current design. Sure, I would do that if I happen to modify the present read file.

Is there a function to write a modified propeller back into VSP as well? I was checking out 'vsp_write.py'.

Thank you

Emilio

unread,
Apr 8, 2019, 10:13:14 PM4/8/19
to suave...@googlegroups.com
Unfortunately it's currently only one way for props.

-Emilio

Yash Thummar

unread,
May 21, 2022, 4:16:51 PM5/21/22
to SUAVE FORUM
Hello, 
I am new to use SUAVE and python. 
Can someone please help me with an example of read entire aircraft or just wing parameters from an openvsp file using SUAVE code?

Actually, I go through the vsp_read and read_vsp_wing documentation, but I cannot understand how to write code for this.
And I also tried to make a code for read vsp file but I got errors all time here is one of them.
TypeError: 'module' object is not callable

Maybe I am not much good in python.
So I would like to request you all that if anyone gives an example of code for read vsp file using SUAVE then it's a great help to me.

Thank you,
Yash Thummar 

Emilio

unread,
May 23, 2022, 4:58:42 PM5/23/22
to SUAVE FORUM
Hi Yash,
The error module object is not callable indicates there's and issue with the import at the top. Here's how it should look:

from SUAVE.Input_Output.OpenVSP.vsp_read import vsp_read

There's really not much to show as examples. Here's how the entire setup typically looks for me:

    vehicle = vsp_read('my_airplane.vsp3',units_type = 'Imperial',specified_network =net)
   
    # Setting up other characteristics not automatically imported
    vehicle.mass_properties.takeoff           = ******
    vehicle.mass_properties.operating_empty   = ******
    vehicle.mass_properties.max_takeoff       = ******  
    vehicle.mass_properties.max_payload       = ******  
    vehicle.mass_properties.center_of_gravity[0][0] =  ******
    vehicle.mass_properties.center_of_gravity[0][2] =  ******

   
    # basic parameters
    vehicle.envelope.ultimate_load = ******
    vehicle.envelope.limit_load    = ******
   
    vehicle.reference_area = ******

I put the ****'s as placeholders for you. The network is an optional input if you have propeller vehicle, otherwise you don't need it. You'll still need to enter in an energy network since most of those parameters are not geometric thus do not come from OpenVSP.

-Emilio

Yash Thummar

unread,
May 27, 2022, 1:01:07 AM5/27/22
to SUAVE FORUM
Thank you so much Emilio, I will try it as your mentioned way.

Yash 
Reply all
Reply to author
Forward
0 new messages