Butterfly and Galapagos Optimization

optimization

#1

Hi everyone,

I’m trying to run an optimization for an Origami structure in Butterfly, in order to maximize wind speed beneath it. As Mostapha Roudsari said here, it is necessary to set interval -1 in the Butterfly_Solution component to visualize only the last value, during the simulation.

With this setting, the optimization through Galapagos seems to start in a good way, but after some iterations it stops due to this error on blockMesh component:

Runtime error (ArgumentException): Environment variable name or value is too long.
Traceback:
line 420, in setitem, “C:\Program Files\Rhinoceros 5 (64-bit)\Plug-ins\IronPython\Lib\os.py
line 80, in getShellinit, “C:\Users\mmel\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly\runmanager.py
line 69, in containerId, “C:\Users\mmel\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly\runmanager.py
line 260, in _RunManager__command, “C:\Users\mmel\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly\runmanager.py
line 316, in run, “C:\Users\mmel\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly\runmanager.py
line 716, in command, “C:\Users\mmel\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly\case.py
line 748, in blockMesh, “C:\Users\mmel\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly\case.py
line 112, in getContainerId, “C:\Users\mmel\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly\runmanager.py
line 215, in command, “C:\Users\mmel\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly\runmanager.py
line 47, in script

Anyone know how to fix it?

Thank you





#2

Hi Federico,

This is a bug and this is why it is happening: I add the path to programs files and docker to os.environ every time that the analysis is ran without checking if it already exist and in your case after a couple of 100 times it end up being too long. I can fix it quickly today or tomorrow and then you can update it on your machine.

Mostapha


#3

It should be fixed now. You need to:

  1. Updated butterfly installation using the attached file. The last updated date should be 2017-05-11 09:44:00

  2. Restart Rhino and Grasshopper. Closing or unloading Grasshopper won’t reload the libraries.

  3. Open your file and try again.

update_butterfly.gh (4.63 KB)


#4

Hi Mostapha,

it seems ok, I am running the optimization with the updated version and the results seems good.

Thanks a lot!


#5

hi FedericoCucchi,sorry to jump out like this
how did you optimization run? i want to ask you a little question,i want to optimization the wind speed in a room,but i can’t get the Specific value of one point,did you have this problem ?what target parameter have you used to do the optimization


#6

Hi WuXue, Did you try using the probes component? You can create a probe for a single point if that’s what you’re looking for.


#7

i tried to create a single point and run the simulation, what i got was a vector with “U”, and the wind pressure of the point with “p”, is the length of the vector representative of wind speed of that point?


#8

Yes it is. You can use the native Gh component to translate the vector to scalar velocity.

Kind regards,
Theodore.


#9

thank you so much, that helps a lot~


#10

I tried to run an optimization in Butterfly,and i have this problem too. But i can’t open the update of butterfly.gh you provided above.could you please sent it again? there is another error that after some iterations,the simulate stops at time=17,which the result do not convergence.

Time = 17

smoothSolver: Solving for Ux, Initial residual = 2.931025e-16, Final residual = 2.931025e-16, No Iterations 0
smoothSolver: Solving for Uy, Initial residual = 2.165529e-13, Final residual = 2.165529e-13, No Iterations 0
smoothSolver: Solving for Uz, Initial residual = 1.66223e-16, Final residual = 1.66223e-16, No Iterations 0
smoothSolver: Solving for T, Initial residual = 0.03995674, Final residual = 0.001261831, No Iterations 2
42. #0 Foam::error::printStack(Foam::Ostream&) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so”
#1 Foam::sigFpe::sigHandler(int) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so”
#2 ? in “/lib64/libc.so.6”
#3 double Foam::sumProd(Foam::UList const&, Foam::UList const&) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so”
#4 Foam::PCG::solve(Foam::Field&, Foam::Field const&, unsigned char) const in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so”
#5 Foam::fvMatrix::solveSegregated(Foam::dictionary const&) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so”
#6 Foam::fvMatrix::solve(Foam::dictionary const&) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin/buoyantBoussinesqSimpleFoam”
#7 Foam::fvMatrix::solve() in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin/buoyantBoussinesqSimpleFoam”
#8 ? in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin/buoyantBoussinesqSimpleFoam”
#9 __libc_start_main in “/lib64/libc.so.6”
#10 ? in "/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin/buoyantBoussinesqSimpleFoam"
43. ***
#0 Foam::error::printStack(Foam::Ostream&) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so”
#1 Foam::sigFpe::sigHandler(int) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so”
#2 ? in “/lib64/libc.so.6”
#3 double Foam::sumProd(Foam::UList const&, Foam::UList const&) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so”
#4 Foam::PCG::solve(Foam::Field&, Foam::Field const&, unsigned char) const in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so”
#5 Foam::fvMatrix::solveSegregated(Foam::dictionary const&) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so”
#6 Foam::fvMatrix::solve(Foam::dictionary const&) in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin/buoyantBoussinesqSimpleFoam”
#7 Foam::fvMatrix::solve() in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin/buoyantBoussinesqSimpleFoam”
#8 ? in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin/buoyantBoussinesqSimpleFoam”
#9 __libc_start_main in “/lib64/libc.so.6”
#10 ? in “/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin/buoyantBoussinesqSimpleFoam”


when i do the simulation for one time,everything look good.i don’t know why it goes wrong in the optimazation.