|
[Sponsors] |
[blockMesh] Cylinder mesh using blockMesh with m4 macro |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 21, 2017, 02:30 |
Cylinder mesh using blockMesh with m4 macro
|
#1 |
Member
Lewis
Join Date: Jun 2016
Posts: 34
Rep Power: 10 |
Currently, I am trying to mesh a vertical cylinder by using the m4 macro provides by Ehsan Madadi. The script is shown below:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | | | \\ / A nd | Copyright (C) 2016 Ehsan Madadi-Kandjani | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; `format' ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // General macros to create cylinder mesh changecom(//)changequote([,]) define(calc, [esyscmd(perl -e 'use Math::Trig; print ($1)')]) define(VCOUNT, 0) define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) define(hex2D, hex ($1b $2b $3b $4b $1t $2t $3t $4t)) define(btQuad, ($1b $2b $2t $1t)) define(topQuad, ($1t $4t $3t $2t)) define(bottomQuad, ($1b $2b $3b $4b)) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.001; // Inner square side half define(s, 0.35) // Inner square side curvature define(sc, 0.4) // cylinder radius define(r, 0.7) // Height of cylinder define(z, 20.0) // Base z define(Zb, 0) // Outlet z define(Zt, calc(Zb + z)) // Number of cells at inner square define(Ns, 20) // Number of cells between inner square and circle define(Ni, 10) // Number of cells in the cylinder height define(Nz, 100) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Thanks in advance! Zuodong |
|
November 21, 2017, 03:15 |
|
#2 |
Senior Member
Join Date: Aug 2013
Posts: 407
Rep Power: 16 |
Hi,
One possible solution would be to use transformPoints and translate by the vector (10 10 0) after you have created the mesh using blockMesh Cheers, Antimony |
|
November 21, 2017, 03:28 |
|
#3 |
Member
Lewis
Join Date: Jun 2016
Posts: 34
Rep Power: 10 |
Hi Antimony! It works now after typing this command:
Code:
transformPoints -translate '(10 10 0)' Zuodong |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] How to mesh for regular pentagonal cylinder using ICEM in 2D? | ranjanrk | ANSYS Meshing & Geometry | 0 | June 18, 2016 03:10 |
Dynamic Structured mesh around cylinder problem!!! | ludosbiz | Mesh Generation & Pre-Processing | 2 | March 23, 2016 16:15 |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
3D Hybrid Mesh Errors | DarrenC | ANSYS Meshing & Geometry | 11 | August 5, 2013 07:42 |
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! | sc298 | OpenFOAM Meshing & Mesh Conversion | 2 | March 27, 2011 22:11 |