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/)
-   -   [mesh manipulation] extrudeMesh: Wedge extrusion with positive AND negative angle (https://www.cfd-online.com/Forums/openfoam-meshing/124112-extrudemesh-wedge-extrusion-positive-negative-angle.html)

francois September 27, 2013 09:14

extrudeMesh: Wedge extrusion with positive AND negative angle
 
Hi Foamers,

I would like to know if it's possible to use the wedge extrusion of the extrudeMesh utility with at the same time positive and negative angle value.

For example a symmetric wedge extrusion between -\theta,\theta would just be fine :D.

Is there some hidden option to control this in the extrudeMeshDict ?

Of course it's possible to split this in two operations but I've already got quite a lot of sub-domains that I have to stitch with stitchMesh utility and would like to avoid to use stitchMesh too much.

Does anyone know if it's possible to do this kind of wedge extrusion ?
Thank's for your helpful contributions

Happy Foaming
Francois

francois October 9, 2013 15:31

3 Attachment(s)
Hi all,

I've modified the wedge.C source file to be able to use the wedge extrusion of the extrudeMesh utility with an angle between -Angle/2 and Angle/2 where Angle is the angle value read in the extrudeMeshDict file.

Of course it doesn't work :D.

My problem is that after the extrusion of the original patch in one direction (-Angle/2 <= \theta <= 0) I'm unable to start the extrusion in the other direction (0 <= \theta <= Angle/2) from the same original patch: it always starts from the last extruded layer.

Some pictures below will illustrate the problem clearer.

Here are the modified parts of the wedge.C source file :

Code:

else
    {
        //sliceAngle = angle_*layer/nLayers_;
        sliceAngle = -angle_*sumThickness(layer);
    }

    // Find projection onto axis (or rather decompose surfacePoint
    // into vector along edge (proj), vector normal to edge in plane
    // of surface point and surface normal.
    point d = surfacePoint - axisPt_;

    d -= (axis_ & d)*axis_;

    scalar dMag = mag(d);

    point edgePt = surfacePoint - d;

    // Rotate point around sliceAngle.
    point rotatedPoint = edgePt;
    point rotatedPoint2 = edgePt;

    if (dMag > VSMALL)
    {
        vector n = (d/dMag) ^ axis_;

        if (sliceAngle > -angle_/2.0)
        {
        rotatedPoint +=
          + cos(sliceAngle)*d
          - sin(sliceAngle)*mag(d)*n; // Use either n or surfaceNormal
        }
        else
        {
        sliceAngle = -angle_/2.0 + angle_*sumThickness(layer);
        rotatedPoint = rotatedPoint2 +
          + cos(sliceAngle)*d
          - sin(sliceAngle)*mag(d)*n; // Use either n or surfaceNormal
        }
    }

    return rotatedPoint;

The use of the rotatedPoint2 does nothing here because edgePt comes obviously from the last extruded layer.

How can I start again from the original patch (the one which is extruded at first) ?

Any ideas ?

Thanks :)

francois October 20, 2013 04:22

Up ...
Thanks :)

wyldckat October 20, 2013 04:37

Greetings Francois,

I honestly suggest that you take the simpler road on this case:
  1. Use extrudeMesh with twice the angle to one direction.
  2. Then use transfomPoints to rotate back once the desired angle.

This works, unless you want to perform this sort of manipulation for some other reason than using the resulting mesh as a wedge.

Best regards,
Bruno


All times are GMT -4. The time now is 13:02.