Rick's Blog

Font size: +
Featured

OpenFOAM Baby Steps - Chapter 3: Mesh Generation Part 1

Mesh Generation

This section will deal with generating the mesh for a case.  I will initially create a crude wind tunnel model for 2-dimensional (2D) flow over a flat plate.  That is an instance where the geometry could be generated by hand.  I will use simple tools to automate that process and allow for increasingly more complex geometries.

SwiftBlock Description

I plan to use Blender (version 3.4.1) to create the framework for my meshes.  There is a free addon, called swiftBlock, that will convert the blender geometry into mesh information for OpenFOAM.  The documentation for the addon can be found here.

Blender Geometry with Dimensions
Geometry in Blender

The test section of this wind tunnel will be a 1-meter cube.  The inlet and outlet will be a 1 meter from the test section.  They will be 2 meters tall.  The entire geometry will be 1-meter "thick" (in the z-direction).  Since this is a 2D case, there will be no changes in that direction.

Once the geometry is complete, enter edit mode.  This will allow SwiftBlock to display the Initialize button.  Select all the geometry and click Initialize.  The image below displays the tab that is visible following initialization.

SwiftBlock after Initialization
Geometry with SwiftBlock Patches Defined

At the bottom of the SwiftBlock panel, is a Boundary Patches section.  In Edit mode, select the single face on the left side of the geometry.  (The flow, for me, will be from left to right, so the far left face which is perpendicular to the flow will be the inlet.)  With the inlet selected, in the Boundary Patches section of the SwiftBlock panel, click the icon that looks like a magnifying glass with a plus.  This will create a new patch, by default labeled Default (followed by Default.001, etc. in standard Blender numbering style), and the patch will have a type of wall.  Double click to rename and click to select one of the standard patch types (wall, patch, empty or symmetry).   In my case, I selected the left and right faces and the inlet and outlet, respectively, of type wall, the top and bottom faces were all called walls of type wall, and everything else (cleverly labeled front and back) was an empty.

DISCLAIMER:
This is not intended as a tutorial. This is my process for working through the available documentation in a manner that makes sense to me. Feel free to follow along, but realize that I am interpreting documentation that already exists.
×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

IOTM - Piazza San Marco - Are Geometry Nodes the B...
OpenFOAM Baby Steps - Chapter 2: Cavity Flow, Part...

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Thursday, 07 December 2023

Captcha Image

Rick's Blog

Font size: +
Featured

OpenFOAM Baby Steps - Chapter 3: Mesh Generation Part 1

Mesh Generation

This section will deal with generating the mesh for a case.  I will initially create a crude wind tunnel model for 2-dimensional (2D) flow over a flat plate.  That is an instance where the geometry could be generated by hand.  I will use simple tools to automate that process and allow for increasingly more complex geometries.

SwiftBlock Description

I plan to use Blender (version 3.4.1) to create the framework for my meshes.  There is a free addon, called swiftBlock, that will convert the blender geometry into mesh information for OpenFOAM.  The documentation for the addon can be found here.

Blender Geometry with Dimensions
Geometry in Blender

The test section of this wind tunnel will be a 1-meter cube.  The inlet and outlet will be a 1 meter from the test section.  They will be 2 meters tall.  The entire geometry will be 1-meter "thick" (in the z-direction).  Since this is a 2D case, there will be no changes in that direction.

Once the geometry is complete, enter edit mode.  This will allow SwiftBlock to display the Initialize button.  Select all the geometry and click Initialize.  The image below displays the tab that is visible following initialization.

SwiftBlock after Initialization
Geometry with SwiftBlock Patches Defined

At the bottom of the SwiftBlock panel, is a Boundary Patches section.  In Edit mode, select the single face on the left side of the geometry.  (The flow, for me, will be from left to right, so the far left face which is perpendicular to the flow will be the inlet.)  With the inlet selected, in the Boundary Patches section of the SwiftBlock panel, click the icon that looks like a magnifying glass with a plus.  This will create a new patch, by default labeled Default (followed by Default.001, etc. in standard Blender numbering style), and the patch will have a type of wall.  Double click to rename and click to select one of the standard patch types (wall, patch, empty or symmetry).   In my case, I selected the left and right faces and the inlet and outlet, respectively, of type wall, the top and bottom faces were all called walls of type wall, and everything else (cleverly labeled front and back) was an empty.

DISCLAIMER:
This is not intended as a tutorial. This is my process for working through the available documentation in a manner that makes sense to me. Feel free to follow along, but realize that I am interpreting documentation that already exists.
×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

IOTM - Piazza San Marco - Are Geometry Nodes the B...
OpenFOAM Baby Steps - Chapter 2: Cavity Flow, Part...

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Thursday, 07 December 2023

Captcha Image