ladybug-tools / butterfly

:butterfly: A light python API for creating and running OpenFoam cases for CFD simulation.
http://ladybug-tools.github.io/butterfly.html
GNU General Public License v3.0
248 stars 70 forks source link

optimization with butterfly #163

Closed maythuzaw closed 7 years ago

maythuzaw commented 7 years ago

Hello..My name is May..I am a new user to butterfly.I want to run my multiphase turbulent openfoam case with butterfly for optimization.Is it possible or not with current butterfly version?Because I saw the post that currently butterfly can run only steady incompressible case.If someone knows ,please help me.Thank you very much.

thinklikeanarchitect commented 7 years ago

I advise you to check OpenFOAM forums as to this , if its possible with OF, then there may be a way to make it work in BF too.

maythuzaw commented 7 years ago

@mimarilker Thank you very much for your reply.In OF,it is possible to run my case.What I want to do now is I want to connect that case with Butterfly for optimization of Ship hull form and finding optimum solution.Since I am just a user,I don't know that much about the code used in Butterfly.Can butterfly able to run all OpenFOAM case?

thinklikeanarchitect commented 7 years ago

@TheodoreGalanos is very experienced on OF, so I think he knows if its possible with BF.

maythuzaw commented 7 years ago

@TheodoreGalanos Could you give me some suggestions about this?

TheodoreGalanos commented 7 years ago

Hi @maythuzaw

I apologize for the late response, I am currently moving into a new house and access to a computer has been limited.

As of the moment, BF is not capable of creating multi-phase recipes so you would not be able to run your case through BF. Thankfully, that is the least of your worries when your goal is the parametric optimization of geometrical properties, since they will not affect the physical settings (BCs, turbulence models, solution settings, etc.) of your case

*Disclaimer: I am not absolutely certain which tutorial you are basing this on, what I'm writing below stands if you are meshing with a typical SHM workflow (like the one found here https://github.com/OpenFOAM/OpenFOAM-2.2.x/tree/master/tutorials/multiphase/LTSInterFoam/wigleyHull/system or here https://github.com/OpenFOAM/OpenFOAM-2.3.x/tree/master/tutorials/multiphase/LTSInterFoam/DTCHull). If your workflow consists of actually meshing different regions of the mesh according to their properties (e.g. solid, fluid, etc.) then they probably don't apply

BF can exploit the link to Rhinoceros3D/GH allowing users to rapidly, and with high degree of control, generate definitions that can parametrically adapt the properties of your input geometry, and save these design alternatives into (properly named) .stl files into an OF case folder. Additionally, BF will allow you to set the same meshing options in your SHMDict as the ones in your original case. Unfortunately that's where the application of BF would end on this case, but I as I mentioend above I feel that most of the work is already done at this point.

What you can do after that is simply copy and paste the /0, /constant (apart from your trisurfaceMesh ofc), and system folders from the original case you successfully run, to all the design alternative folders you created with BF. Almost all other settings of your case remain the same! The only change you will probably have to do is rename the geometry boundary in your 0 folder to the one of the design alternatives (e.g. hull to hull_1, hull_2, hull_3, etc.). The cases should run out of the box!

I am not sure how familiar you are with GH scripts, I imagine you have experience if you are testing BF in GH, but there are tons of references and examples out there, especially on the GH forums.

Hope this helps!

Kind regards, Theodore.

P.S.: If your experience with BF is positive through your experiements we would greatly appreaciate your input in the process of developing multi-phase workflows into BF. Especially your intimate knowledge on BCs, solver settings, and meshing details would be incredibly helpful! Let us know!

maythuzaw commented 7 years ago

@TheodoreGalanos Thank you so much for your reply.You explained it very well. Now I know the answer that I am looking for. I run my case with OF LTS interFOAM DTC hull.My plan is to do parametric modelling with GH and run with openFOAM and do optimization for hull resistance by changing some parameters of the hull. Since BF can't able to do multiphase right now,I will try to do it in another way.BF is really good idea and I think it will get great attentions in near future.Also hope all the best for your work!! King regards, Maythu

TheodoreGalanos commented 7 years ago

Hi @maythuzaw I'm glad it made sense.

I think you could still take advantage of BF, if only for it's .stl export ability (I'm not aware of another GH plugin that does it in this way). It will allow you to export individual .stl per region or one .stl with all regions included and named properly.

In my experience of practical cases where each case differs in one value of a parameter from the other (my usual example is outdoor wind simulations for the whole wind rose with each simulation representing a different wind direction, e.g. 10, 20, 30, etc..) the most time intensive procedure before BF was manually exporting, naming and (if necessary) merging .stl files.

All the best in your research and we will let you know when we incorporate these kind of studies!

Kind regards, Theodore.

TheodoreGalanos commented 7 years ago

I will close this one if there is nothing more. Please let us know of any experiences you might have with Butterfly in the future. Good luck with your research!

Regards, Theodore.