CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Pointwise & Gridgen (http://www.cfd-online.com/Forums/pointwise/)
-   -   Convert 2D to 3D for OpenFOAM? (http://www.cfd-online.com/Forums/pointwise/126621-convert-2d-3d-openfoam.html)

crossm2 November 21, 2013 13:24

Convert 2D to 3D for OpenFOAM?
 
Hi,

I was wondering if anyone has experience turning a 2D model into a 3D one for OpenFOAM? I have a 2D grid - complete with domains, connectors, and database that I've successfully run on another solver. Do I have to copy the whole thing to a new plane and then add connectors between all the points? Or do I just need the connectors?

Thanks

cnsidero November 21, 2013 16:05

Quote:

Originally Posted by crossm2 (Post 462962)
Hi,

I was wondering if anyone has experience turning a 2D model into a 3D one for OpenFOAM? I have a 2D grid - complete with domains, connectors, and database that I've successfully run on another solver. Do I have to copy the whole thing to a new plane and then add connectors between all the points? Or do I just need the connectors?

Thanks

You'll need to create a 3D mesh (i.e. block) but in this case it's straightforward.

- make sure your domain(s) are in the xy plane
- make sure your CAE type is OpenFOAM
- select the domain(s) and create a translational extrusion of one cell in the +'ve z direction
- apply appropriate CAE BCs on sides of extrusion
- apply the "empty" BC type to original domain(s) and their matching counterpart on other side of the extrusion
- now select the block(s) and File, Export, CAE ... to your polyMesh directory

Note for step 3, the depth of the extrusion shouldn't matter as the simulation is 2D. I usually choose a depth large enough so that selecting the domains on the side of the extrusion isn't tedious. That however may create high enough aspect ratio cells to cause OpenFOAM's checkMesh to complain. That won't cause any issues because the simulation is 2D and the cells are long in the z direction OpenFOAM.

crossm2 November 21, 2013 16:27

This is exactly what I was looking for. Thanks so much!

Edit: the above steps worked perfectly

dgarlisch November 22, 2013 11:33

FYI...

A user attending a Pointwise training class had a similar problem when using GASP. It also wants a one-cell thick grid for 2D cases.

To help him out, I wrote a glyph script that performs the 2D to 3D "thickening." Also, as a big bonus, it automatically transfers any 2D BCs from the connectors to the extruded domains. I have not tested the script using the OpenFOAM solver, but it works wonderfully with GASP!

I will be posting it to the Pointwise script exchange soon (maybe today). Keep an eye on the script exchange for the upload. I will try to remember to make a post here when it is available.

dgarlisch November 25, 2013 18:43

Quote:

Originally Posted by dgarlisch (Post 463103)
FYI...

A user attending a Pointwise training class had a similar problem when using GASP. It also wants a one-cell thick grid for 2D cases.

To help him out, I wrote a glyph script that performs the 2D to 3D "thickening." Also, as a big bonus, it automatically transfers any 2D BCs from the connectors to the extruded domains. I have not tested the script using the OpenFOAM solver, but it works wonderfully with GASP!

I will be posting it to the Pointwise script exchange soon (maybe today). Keep an eye on the script exchange for the upload. I will try to remember to make a post here when it is available.

UPDATE: I tested the aforementioned script with the OpenFOAM CAE exporter.

Unfortunately, the OpenFOAM CAE exporter does not support 2D mode. The script has limited benefit unless you can start with a 2D grid that has BCs applied to the connectors.

So, Chris' instructions are your best option right now.


All times are GMT -4. The time now is 17:21.