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
249 stars 71 forks source link

Custom boundaries for outdoor simulations #126

Open NallaV opened 7 years ago

NallaV commented 7 years ago

Hello. I was wondering if it is possible to add a custom boundary condition currently in butterfly or if there is an alternative way to do so.

If not, I think it would be great to have a component for custom boundaries conditions where variables like U, k, e could be defined based on equations. For example the "wind profile power law" equation could be used as an inlet boundary condition since it is a very common assumption for big scale outdoor simulations.

Great job by the way. I can't wait for future updates. I am not an expert in cfd but Butterfly looks very promising.

TheodoreGalanos commented 7 years ago

Hi @NallaV

Thanks for trying out BF!

The custom boundary component exists in the boundary tab. You can use it to make almost any type of custom boundary that works with OpenFOAM. I haven't tried function coded ones, which I assume the power low ABL is but it should work. Let us know if it doesn't!

Kind regards, Theodore.

mostaphaRoudsari commented 7 years ago

@NallaV since inlet in not a BFGeometry you can't use the component that @TheodoreGalanos mentioned for the case however you can also change them using solutionParameters. The current boundary condition for inlet is atmBoundaryLayerInletVelocity but you can change it in U file by creating a solutionParameter. I hope this answers your question. If you know python then you can overwrite the inlet boundary condition after creating the windtunnel using a GHPython component. Hope this answers your question.

TheodoreGalanos commented 7 years ago

Hi @NallaV and @mostaphaRoudsari , indeed this is an outdoor case study and the boundary geometries are automatically created through the WT component.

Still if you want there is a kind of hacky way to do this. After your create your wind tunnel with the WT component, you can bake your wind tunnel geometry and then manually bring the inlet, outlet, sides, and top surfaces as BF geometries into grasshopper. That would give you access to the inlet geometry and it's custom BC. You would then use the internal workflow to prepare the case.

Ofc, changing it manually will also work just fine if you can manage, it's also cleaner since you can do that right before you run the case and you don't need to change the case preparation workflow.

Regards, Theodore.

mostaphaRoudsari commented 7 years ago

@TheodoreGalanos, I won't suggest the manual approach. That is a broken workflow. Maybe we should have have a component that gives access to overwrite the boundary condition for WT faces, if this is a common case.

TheodoreGalanos commented 7 years ago

@mostaphaRoudsari That workflow is more common than I would like when working with SHM, especially in cases where your ground geometry is not flat. That was simply a workaround for a few cases where SHM has issues.

A component like that can be useful, I agree it is much cleaner to do that.

NallaV commented 7 years ago

Thank you for your replies. I managed to run the case as an internal one. I set up every boundary in the beginning and then I override the conditions by adding a text describing the new boundaries into the "additionalParameters"at the "simulationParameters"component. It works just fine!

Zarisu commented 7 years ago

Hey @NallaV. I'm having some problems with boundary conditions for my outdoor simulation and it sounds like you have found a way to make it work - are you willing to share your gh file? I would like to see how you solved this in practice.

mostaphaRoudsari commented 7 years ago

@Zarisu try something like this: image

Zarisu commented 7 years ago

Thanks for the reply @mostaphaRoudsari :) However, I don't think that I was specific enough with the intention of my question. I would like to set up boundary conditions for the 'ground' and 'building' surfaces in order to match a simulation done in Fluent.

This is what i tried to do (don't work): bc_wall_and_surface based on information found in https://www.cfd-online.com/Forums/openfoam-programming-development/71412-nutroughwallfunction-surface-roughness-documented.html