# Working Folder change to $FOAM\_RUN

**URL:** <https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157>\
**Category:** butterfly\
**Created:** [January 21, 2020, 10:41am UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157 "2020-01-21T10:41:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![javiervinuales](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/javiervinuales/32/14510_2.png) [@javiervinuales](https://discourse.ladybug.tools/u/javiervinuales)\
**Post date:** [January 21, 2020, 10:41am UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/1 "2020-01-21T10:41:45Z")

</div>

Hi everyone,

I am a new user of butterfly, so far I am greatly impressed with the tool and I think it can really help with my CFD workflow.

The default folder for butterfly seems to be “…/user/butterfly”. I would like to change the working folder to the run folder of OpenFOAM/BlueCFD- I found somewhere that you can do that through case.wrokingDir, so I tried that:

 ![image](https://discourse.ladybug.tools/uploads/default/original/2X/9/9a16c0bc0cfafe67235e94a561577725f5a0db2d.png)

But as you can see from the output, it is still working on /user/butterfly. How can I change the working directory?

Thanks.

---

<div class="post-metadata">

**Author:** ![javiervinuales](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/javiervinuales/32/14510_2.png) [@javiervinuales](https://discourse.ladybug.tools/u/javiervinuales)\
**Post date:** [February 7, 2020, 2:39pm UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/2 "2020-02-07T14:39:27Z")

</div>

no one can help? …

---

<div class="post-metadata">

**Author:** ![minggangyin](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/minggangyin/32/216_2.png) [@minggangyin](https://discourse.ladybug.tools/u/minggangyin)\
**Post date:** [February 8, 2020, 3:42am UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/3 "2020-02-08T03:42:23Z")

</div>

@javiervinuales As I know, it is hard to change the default folder in Grasshopper. Maybe you should change the python code of butterfly.  
You can change the code as below.  
The abspath is C:\Users\XXX\AppData\Roaming\McNeel\Rhinoceros\6.0\scripts\butterfly\case.py

 ![image](https://discourse.ladybug.tools/uploads/default/original/2X/d/d4458bbb5b6f35a8a3c96c969e4a3fef87f9439d.png)

---

<div class="post-metadata">

**Author:** ![javiervinuales](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/javiervinuales/32/14510_2.png) [@javiervinuales](https://discourse.ladybug.tools/u/javiervinuales)\
**Post date:** [February 8, 2020, 9:32am UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/4 "2020-02-08T09:32:35Z")

</div>

Hi Minggang,

Thanks a lot for your answer, I will give it a try.

Cheers,

Javier

---

<div class="post-metadata">

**Author:** ![ZhengrongTao](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/zhengrongtao/32/31521_2.png) [@ZhengrongTao](https://discourse.ladybug.tools/u/ZhengrongTao)\
**Post date:** [May 29, 2020, 5:36am UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/5 "2020-05-29T05:36:32Z")

</div>

Hello there! Have you successfully changed the folder directory to a custom folder? Your answer is very important to me, and I look forward to receiving your reply.

---

<div class="post-metadata">

**Author:** ![javiervinuales](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/javiervinuales/32/14510_2.png) [@javiervinuales](https://discourse.ladybug.tools/u/javiervinuales)\
**Post date:** [May 29, 2020, 9:34am UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/6 "2020-05-29T09:34:15Z")

</div>

Hi Zhengrong,

Unfortunately, I discarded the Butterfly option for my CFD workflow due to limited support and solver limitations. Currently using Python, pyFoam and GH Python Remote to run parametric studies with OpenFoam as solver and controlling geometry with Grasshopper. It requires some manual case folder preparation but it is not too bad.

---

<div class="post-metadata">

**Author:** ![minggangyin](https://discourse.ladybug.tools/user_avatar/discourse.ladybug.tools/minggangyin/32/216_2.png) [@minggangyin](https://discourse.ladybug.tools/u/minggangyin)\
**Post date:** [June 1, 2020, 3:25am UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/7 "2020-06-01T03:25:12Z")

</div>

@javiervinuales This workflow is awesome!!! Would you like to tell us more details about it?

> [@javiervinuales](#):
>
> Currently using Python, pyFoam and GH Python Remote to run parametric studies with OpenFoam as solver and controlling geometry with Grasshopper.

---

<div class="post-metadata">

**Author:** ![ofkurt](https://discourse.ladybug.tools/letter_avatar_proxy/v4/letter/o/848f3c/32.png) [@ofkurt](https://discourse.ladybug.tools/u/ofkurt)\
**Post date:** [May 10, 2025, 1:23pm UTC](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/8 "2025-05-10T13:23:57Z")

</div>

As someone who is still trying to use butterfly in 2025, this worked for me and helped solve the problem mentioned [in this issue.](https://discourse.ladybug.tools/t/working-folder-change-to-foam-run/8157/3) Thanks 👍
