CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [blockMesh] Create an axisymmetric grid from a 2D blockMeshDict (https://www.cfd-online.com/Forums/openfoam-meshing/226191-create-axisymmetric-grid-2d-blockmeshdict.html)

mkhm April 20, 2020 06:29

Create an axisymmetric grid from a 2D blockMeshDict
 
Dear Foamers,


I have a 2 dimensional de laval nozzle. The meshing is done via the blockMeshDict. Now, I want to convert it to an axisymmetric one. So, instead of a symmetry PLANE, I would have a symmetry line and the front and back plane becomes of wedge type. I saw the following utility "makeAxialMesh" which does exactly what I want. However, the problem is that it is not available in OpenFOAM 4.x. Does anyone know any other alternatives ?



Thanks in advance for your help

dplamp August 19, 2020 03:43

Hello,


Here a working example of a wedge :


Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  plus                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;        // m

radius    2.5e-3;
length    80e-3;
halfWedgeAngle    2.5;    // degrees

// wedge coordinates :
hAR        #calc "degToRad($halfWedgeAngle)";    // half angle in rad
wx        #calc "$radius*cos($hAR)";
wyp        #calc "$radius*sin($hAR)";
wyn        #calc "-1.0*$wyp";
cs        #calc "cos($hAR)";

//#calc "Info<< $halfWedgeAngle << $cs << $wx";
//#calc "Info<< $wx << endl";

vertices
(
    (0 0 0)
    (1 0 0)
    (0 1 0)
    (0 0 1)
    (0 0 $length)    // 4
    ($wx $wyn $length)
    ($wx $wyn 0)
    ($wx $wyp 0)
    ($wx $wyp $length)
);

blocks
(
    hex (0 6 7 0 4 5 8 4) (50 1 200) simpleGrading (0.5 1 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 7 6 0)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (4 5 8 4)
        );
    }
    wallPipe
    {
        type wall;
        faces
        (
            (5 6 7 8)
        );
    }
    front
    {
        type wedge;
        faces
        (
            (0 6 5 4)
        );
    }
    back
    {
        type wedge;
        faces
        (
            (0 4 8 7)
        );
    }
    axis
    {
        type symmetry;
        faces
        (
            (0 4 4 0)
        );
    }
);

mergePatchPairs
(
);


// ************************************************************************* //


https://i.paste.pics/fb18800d2da63d6...f294b851e9a1bb


All times are GMT -4. The time now is 22:11.