CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

Possible createPatch/createBaffles bug?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 9, 2014, 15:30
Default Possible createPatch/createBaffles bug?
  #1
Member
 
Simon Arne
Join Date: May 2012
Posts: 42
Rep Power: 5
simpomann is on a distinguished road
Hi,

I create 2 cyclic patches using createPatch. Unluckily the patchField ability does not work as intended.
The workflow:


1)
Create 2 patches with snappyHexMesh baffle functionality:
Code:
    vent_in_fs_0
        {
        level (3 6);
        faceZone vent_in_fs_0;

        // Create baffles for all faces on the surface
        faceType baffle;
        
        patchInfo
         {
            type patch;
 
             }

        }
--> patch vent_in_fs_0 and vent_in_fs_0_slave are created


2)
Convert the 2 baffle faces to cyclics using createPatch:
Code:
    {
        // Name of new patch
        name vent_in_fs_0_cyclic;

        // Dictionary to construct new patch from
        patchInfo
        {
           type cyclic;
       neighbourPatch vent_in_fs_0_slave_cyclic;

                patchFields
                {
                    p
                    {
                    type            fan;
                    patchType       cyclic;
                    jump            uniform 0;
                    value           uniform 0;
                    jumpTable       polynomial 1((100000000 0));
                    }
                }
        }

        // How to construct: either from 'patches' or 'set'
        constructFrom patches;

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches (vent_in_fs_0);
    }

    {
        // Name of new patch
        name vent_in_fs_0_slave_cyclic;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch vent_in_fs_0_cyclic;

                patchFields
                {
                    p
                    {
            type            fan;
            patchType       cyclic;
            value           uniform 0;

                    }
                }
        }
The two cyclic patches are created, unluckily the patchFields part is skipped! Snippet from patchSummary:
Code:
cyclic    : vent_in_fs_0_cyclic
    scalar        nut        cyclic
    scalar        k        cyclic
    scalar        p        cyclic
    scalar        omega        cyclic
    vector        U        cyclic

cyclic    : vent_in_fs_0_slave_cyclic
    scalar        nut        cyclic
    scalar        k        cyclic
    scalar        p        cyclic
    scalar        omega        cyclic
    vector        U        cyclic
The boundary type for field variable p should be set from "cyclic" to "fan".

Snippet from constant/boundary:
Code:
    vent_in_fs_0_cyclic
    {
        type            cyclic;
        inGroups        1(cyclic);
        nFaces          56;
        startFace       5644731;
        matchTolerance  0.0001;
        transform       unknown;
        neighbourPatch  vent_in_fs_0_slave_cyclic;
    }
    vent_in_fs_0_slave_cyclic
    {
        type            cyclic;
        inGroups        1(cyclic);
        nFaces          56;
        startFace       5644787;
        matchTolerance  0.0001;
        transform       unknown;
        neighbourPatch  vent_in_fs_0_cyclic;
    }
I reviewed the patches in paraFoam, they are of correct shape and surfaces are correctly (=opposingly) orientated.
Why is "patchFields" not performed?
I compared it to the TJunctionFan Tutorial, where patchSummary looks like this:
Code:
cyclic    : cyclicFaces_master
    scalar        nut        cyclic
    scalar        k        cyclic
    scalar        nuTilda        cyclic
    scalar        p        fan
    scalar        epsilon        cyclic
    vector        U        cyclic

cyclic    : cyclicFaces_slave
    scalar        nut        cyclic
    scalar        k        cyclic
    scalar        nuTilda        cyclic
    scalar        p        fan
    scalar        epsilon        cyclic
    vector        U        cyclic
I know that the tutorial makes use of createBaffles instead of createPatch, so I switched over to createBaffles but I am stuck with the same behaviour: Patches are generated correctly but patchFields does not work as intended. I also generated a pair of cyclics in the exact same way as in the tutorial, but "patchFields" fails to update them here as well.
Note: In this case my cyclic patches are derived directly from the geometry via searchableSurface/STL (and the baffle creation in snappyHexMesh is commented out, so there is no name conflict etc.).

Code:
baffles
{
  cyclicFaces
    {
        //- Select faces and orientation through a searchableSurface
        type        searchableSurface;
        surface     searchablePlate;
        origin      (10 -3 2);
        span        (0 1 1);

        patchPairs
        {
            type            cyclic;

            //- Optional override of added patchfields. If not specified
            //  any added patchfields are of type calculated.
            patchFields
            {
                p
                {
                    type            fan;
                    patchType       cyclic;
                    jump            uniform 0;
                    value           uniform 0;
                    jumpTable       polynomial 1((100000000 0));
                }
            }
        }
    }

    cyclicFaces1
    {
        //- Use surface to select faces and orientation.
        type        searchableSurface;
        surface     triSurfaceMesh;
        name        vent_in_fs_0.obj;
        //- Optional flip
 //       flip        true;

        // Generate patches explicitly
        patches
        {
            master
            {
                //- Master side patch

                name            vent_in_fs_0;
         type            cyclic;

                neighbourPatch  vent_in_fs_0_slave;

                patchFields
                {
                    type            fan;
                    patchType       cyclic;
                    jump            uniform 0;
                    value           uniform 0;
                    jumpTable       polynomial 1((1000000000 0));
                }
            }
            slave
            {
                //- Slave side patch

                name            vent_in_fs_0_slave;
         type            cyclic;

                neighbourPatch  vent_in_fs_0;

                patchFields
                {
            type            fan;
            patchType       cyclic;
            value           uniform 0;

                }
            }
        }
    }
}
The tutorial on the other hand works fine, even when I remove the topoSet and baffle (not cyclic) faces the pair of cyclics is created sucessfully and the "patchField" entry updates the fields sucessfully..

My Allrun-Skript:
Code:
#!/bin/sh
cd ${0%/*} || exit 1    # run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

runApplication surfaceFeatureExtract

runApplication blockMesh

runApplication decomposePar
runParallel snappyHexMesh 20 -overwrite

runParallel createPatch 20 -overwrite

#- For non-parallel running
#cp -r 0.org 0 > /dev/null 2>&1

#- For parallel running
ls -d processor* | xargs -i rm -rf ./{}/0 $1
ls -d processor* | xargs -i cp -r 0.org ./{}/0 $1

runParallel patchSummary 20 -expand
runParallel potentialFoam 20 -noFunctionObjects -writep
runParallel $(getApplication) 20

runApplication reconstructParMesh -constant
runApplication reconstructPar 

# ----------------------------------------------------------------- end-of-file
I use openFoam 2.3.0, solver is SIMPLE and the case is processed parallel.
I tried to switch to serial processing and PIMPLE without sucess. In addition I changed from "fan" boundary to fixedJump and uniformJump - unluckily they are not updated neither.




Thanks in advance for every help!
simpomann is offline   Reply With Quote

Old   July 9, 2014, 15:49
Default
  #2
Member
 
Simon Arne
Join Date: May 2012
Posts: 42
Rep Power: 5
simpomann is on a distinguished road
deleted for improved reading

Last edited by simpomann; July 15, 2014 at 12:07.
simpomann is offline   Reply With Quote

Old   July 15, 2014, 07:07
Default
  #3
Member
 
Simon Arne
Join Date: May 2012
Posts: 42
Rep Power: 5
simpomann is on a distinguished road
Update:

I resolved the problem and it was entirely my fault: The Allrun script was in wrong order! The xargs-line overwrote the decomposed patch fields.
Corrected:


Code:
#- For parallel running ls -d processor* | xargs -i rm -rf ./{}/0 $1 ls -d processor* | xargs -i cp -r 0.org ./{}/0 $1

runParallel createPatch 20 -overwrite
Code:
 /*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      createBafflesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Sample for creating baffles:
// - usually converting internal faces into two boundary faces
// - or converting boundary faces into a boundary face
//   (internalFacesOnly=false)(though should use really createPatch
//    to do this)
// - specification in one of two modes:
//      - patchPairs : create two patches of same type, same input
//      - patches    : create patches separately, full control over what
//                     to create on what side
//                     (this mode can also create duplicate (overlapping)
//                      sets of baffles:
//                      - internalFacesOnly = false
//                      - have 4 entries in patches:
//                          - master
//                          - slave
//                          - additional master
//                          - additional slave)


// Whether to convert internal faces only (so leave boundary faces intact).
// This is only relevant if your face selection type can pick up boundary
// faces.
internalFacesOnly true;

// Optionally do not read/convert/write any fields.
//noFields true;


// Baffles to create.
baffles
{   vent_in_fs_0
    {
        //- Select faces and orientation through a searchableSurface
        type        searchableSurface;
        surface     triSurfaceMesh;
        name        vent_in_fs_0.obj;

        //- Optional flip
        flip        true;

        patchPairs
        {
            type            cyclic;

            //- Optional override of added patchfields. If not specified
            //  any added patchfields are of type calculated.
            patchFields
            {
                p
                {
                    type            fan;
                    patchType       cyclic;
                    jump            uniform 0;
                    value           uniform 0;
                    jumpTable       polynomial 5((171.52 0) (-10.09 1) (-1.71 2) (-0.48 3) (0.03 4));
                }
            }
        }

....
Now I am succesfully creating fan cyclics with the createBaffle utility

Thread can be closed or deleted.


Greetings!
Simon

Last edited by simpomann; July 15, 2014 at 12:04.
simpomann is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dieselEngineFoam bug - OpenFOAM-1.6-ext novakm OpenFOAM Bugs 1 December 5, 2013 14:18
Serious bug in LES interface fs82 OpenFOAM Bugs 21 November 16, 2009 09:15
Bug in Meshing Parameters menu Spacing1 (1e+10) Karna ANSYS Meshing & Geometry 1 October 12, 2009 14:38
Bug reports Mattijs Janssens (Mattijs) OpenFOAM 0 January 10, 2005 11:05
Forum y2k Bug Jonas Larsson Main CFD Forum 1 January 5, 2000 11:22


All times are GMT -4. The time now is 07:40.