CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Cyclic boundary condition on SALOME mesh (https://www.cfd-online.com/Forums/openfoam-pre-processing/184004-cyclic-boundary-condition-salome-mesh.html)

kandelabr February 20, 2017 06:59

Cyclic boundary condition on SALOME mesh
 
Hello everybody,

I want to set up a cyclic boundary condition on a mesh made in SALOME. I export mesh to i-deas and run ideasUnvToFoam. I get this:

Code:

--> FOAM FATAL ERROR:
face 0 area does not match neighbour by 30.6027% -- possible face ordering problem.

...

I know what that means but I have no idea how to create a mesh that would suit cyclic BC. I haven't found anything on the internet or in this forum so far... I like SALOME but could use something else as well if this can't be done there.

This is my boundary file:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  3.0.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
|*---------------------------------------------------------------------------*|
|* OpenFOAM for Windows 16.10 (v1)                                          *|
|* Built by CFD Support, www.cfdsupport.com (based on Symscape).            *|
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

8
(
    CyclicInlet2
    {
        type            cyclic;
        nFaces          592;
        startFace      357723;
        transform        rotational;
        rotationAxis        (0 0 1);
        rotationCentre        (0 0 0);
        neighbourPatch        CyclicInlet1;
    }
    CyclicOutlet2
    {
        type            cyclic;
        nFaces          2051;
        startFace      358315;
        transform        rotational;
        rotationAxis        (0 0 1);
        rotationCentre        (0 0 0);
        neighbourPatch        CyclicOutlet1;
    }
    Inlet
    {
        type            patch;
        nFaces          154;
        startFace      360366;
    }
    ImpellerWalls
    {
        type            wall;
        nFaces          5170;
        startFace      360520;
    }
    VoluteWalls
    {
        type            wall;
        nFaces          9142;
        startFace      365690;
    }
    Outlet
    {
        type            patch;
        nFaces          1946;
        startFace      374832;
    }
    CyclicInlet1
    {
        type            cyclic;
        nFaces          592;
        startFace      376778;
        transform        rotational;
        neighbourPatch        CyclicInlet2;
        rotationAxis        (0 0 1);
        rotationCentre        (0 0 0);
    }
    CyclicOutlet1
    {
        type            patch;
        nFaces          2051;
        startFace      377370;
        transform        rotational;
        neighbourPatch        CyclicOutlet2;
        rotationAxis        (0 0 1);
        rotationCentre        (0 0 0);
    }
)

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

Thank you!

kandelabr February 20, 2017 09:34

It's funny how I banged my head on this for two weeks and now that I gave up and asked I immediately found the solution while looking for something totally different.

For future reference for lost souls like me, here's how it's done:

It's the "Projection" algorithm in SALOME. One face is meshed separately with a submesh, the other is meshed separately again but with Projection 1D-2D algorithm.

http://docs.salome-platform.org/late...lgos_page.html

Enjoy!

HenrikJohansson May 30, 2018 10:21

Hi Nejc,

How did you solve it with projection 2D. I tried it but can't get it to work.
How do I create a surface mesh before meshing the whole volume or is this the wrong approach?

Could you make a small step by step list on how to do this?

Regards Henrik

kandelabr June 1, 2018 02:12

1 Attachment(s)
Hi, sorry for a late reply, I had to do it again to check if it still works :)
Here's roughly what to do:
  1. Create a separate patch group on your solid for each side of cyclic patch
  2. Create a mesh on the main solid but don't set any hypotheses on any dimension, just click "apply and close"
  3. Create a sub-mesh on the first cyclic patch, set your hypotheses and calculate it.
  4. Create another sub-mesh on the other cyclic patch and use 'Projection 1D-2D' hypothesis, source mesh: the main mesh from step 2, source face: first cyclic patch group
  5. Calculate the second mesh. Check patches, they should be the same.

See the attachment for a simple example.

Good luck!

anhkenyt December 3, 2018 03:36

I was created cyclicBoundary in Salome, but when I convert to OpenFoam and set boundary cyclic (I am using repeatAMi) for them , it this error:
''face 0 area does not match neighbour by 59.88569801% -- possible face ordering problem.
patch:cyclic_Out1 my area:2.01556304e-06 neighbour area:1.086666987e-06 matching tolerance:0.01
Mesh face:591751 fc:(0.129768 0.05073526667 -0.07932823333)
Neighbour fc:(0.09832853333 0.00576254 0.01105083333)
If you are certain your matching is correct you can increase the 'matchTolerance' setting in the patch dictionary in the boundary file.
Rerun with cyclic debug flag set for more information.''
Can anyone help me with this problem?

HenrikJohansson December 3, 2018 03:42

Hi,

Could you share your boundary file?
Maybe you have specified your patches faulty.
Do you use createPatch?
COuld you share your mesh or images of the cyclic boundaries?

/ Henrik

anhkenyt December 3, 2018 06:22

Thanks for your repply,
 
https://drive.google.com/file/d/1D2Q...ew?usp=sharingThis is my boundary
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

12
(
inlet
{
type patch;
nFaces 891;
startFace 1407711;
}
cyclicIn1
{
type patch;
nFaces 1714;
startFace 1408602;
}
cyclicIn2
{
type patch;
nFaces 1714;
startFace 1410316;
}
stationaryWalls
{
type patch;
nFaces 3076;
startFace 1412030;
}
couple1
{
type patch;
nFaces 863;
startFace 1415106;
}
statorBlade
{
type patch;
nFaces 4134;
startFace 1415969;
}
couple2
{
type patch;
nFaces 2585;
startFace 1420103;
}
movingWalls
I used CreatePatch
/*--------------------------------*- 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 createPatchDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
pointSync false;

patches
(
{
// Name of new patch
name cyclic_In1;

// Type of new patch
patchInfo
{
type cyclic;
neighbourPatch cyclic_In2;
matchTolerance 1E-2;
}

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

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

{
// Name of new patch
name cyclic_In2;

// Type of new patch
patchInfo
{
type cyclic;
neighbourPatch cyclic_In1;
matchTolerance 1E-2;
}

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

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

{
// Name of new patch
name cyclic_Out1;

// Type of new patch
patchInfo
{
type cyclic;
neighbourPatch cyclic_Out2;
matchTolerance 1E-2;
}

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

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

{
// Name of new patch
name cyclic_Out2;

// Type of new patch
patchInfo
{
type cyclic;
neighbourPatch cyclic_Out1;
matchTolerance 1E-2;
}

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

// If constructFrom = patches : names of patches. Wildcards allowed.
patches (cyclicOut2);
}
);
and this this images of the cyclicBoudary ( cyclicIn1 and cyclicIn2)
https://drive.google.com/file/d/1D2Q...ew?usp=sharing
https://drive.google.com/file/d/1fjM...ew?usp=sharing

https://drive.google.com/file/d/1fjM...aNrXaPUf7/view

HenrikJohansson December 3, 2018 06:51

Thanks,

It is not complaning about the patches you show on the images, cyclicIn1/cyclicIn2, but
Code:

patch:cyclic_Out1 my area:2.01556304e-06 neighbour area:1.086666987e-06 matching tolerance:0.01
There is something wrong with your cyclic_Out1/cyclic_Out2 which are not shown in either images or your boundary file.

kandelabr December 3, 2018 07:28

Try specifying more details about your cyclic. In case of rotational symmetry, it would be something like this:

Code:

cyclicRight
{
    type cyclicAMI;
    neighbourPatch cyclicLeft;
    transform rotational;
    rotationAxis (1 0 0);
    rotationCentre (0 0 0);

  // OpenFOAM usually guesses this correctly
  // rotationAngle 60;
}


HenrikJohansson December 3, 2018 07:37

Like Nejc said,

Using cyclicAMI or cyclicGGI could solve the problem. Since they dont care about the face ordering like the cyclic does.
I have never tried using cyclic with 1:1 from Salome just cyclicGGI in foam-extend. Which worked with salomeToOpenFOAM as importer to foam-extend.
Depending on how you export your model from Salome to openfoam the face ordering might not be conserved or even correct for the cyclic condition in OpenFOAM.

anhkenyt December 3, 2018 07:46

hi Johansson,
Sorry about my mistakes
There ary my boundary and creatPatch
https://drive.google.com/drive/folde...zO?usp=sharing

HenrikJohansson December 3, 2018 07:51

Try using cyclicAMI instead of the classic 1:1 cyclic. Since your mesh is 1:1 it shall not make any difference to the result but might increase the solution time slightly.
https://www.cfdsupport.com/OpenFOAM-...t/node116.html

I think the face ordering from Salome of the 1:1 cyclic boundaries are not correct to how OpenFOAM wants it.

anhkenyt February 28, 2019 02:35

Problem when using cyclicAMI
 
3 Attachment(s)
Hi Johansson,
It's me again, but this time, I used TurborGird for created mesh and imported it to Of6. I tried using CyclicAMI instead of Cyclic but when l run PImpleFoam I am facing an error:
Code:

AMI: Creating addressing and weights between 6625 source faces and 6625 target faces
--> FOAM Warning :
    From function void Foam::AMIMethod<SourcePatch, TargetPatch>::checkPatches() const [with SourcePatch = Foam::PrimitivePatch<Foam::face, Foam::SubList, const Foam::Field<Foam::Vector<double> >&>; TargetPatch = Foam::PrimitivePatch<Foam::face, Foam::SubList, const Foam::Field<Foam::Vector<double> >&>]
    in file lnInclude/AMIMethod.C at line 57
    Source and target patch bounding boxes are not similar
    source box span    : (0.041425 0.0215107 0.096)
    target box span    : (0.0419304 0.0195127 0.096)
    source box          : (0.0874741 0.04003 -0.016) (0.128899 0.0615407 0.08)
    target box          : (0.0897394 0.035125 -0.016) (0.13167 0.0546376 0.08)
    inflated target box : (0.0844115 0.029797 -0.0213279) (0.136998 0.0599656 0.085328)


--> FOAM FATAL ERROR:
Unable to set source and target faces

My case is pretty similar to the tutorial Impeller in OF 6.0 and I also follow the setup in that tutorial for boundary conditions.
Please have a look at my geometry in the attached images. My boundaries is like below::
Code:

12
(
    outlet
    {
        type            patch;
        nFaces          6360;
        startFace      4074577;
    }
    movingWalls
    {
        type            wall;
        inGroups        1(wall);
        nFaces          40680;
        startFace      4080937;
    }
    rotorBlade
    {
        type            wall;
        inGroups        1(wall);
        nFaces          33231;
        startFace      4121617;
    }
    statorBlade
    {
        type            wall;
        inGroups        1(wall);
        nFaces          6976;
        startFace      4154848;
    }
    inlet
    {
        type            patch;
        nFaces          1280;
        startFace      4161824;
    }
    stationnaryWalls
    {
        type            wall;
        inGroups        1(wall);
        nFaces          18920;
        startFace      4163104;
    }
    cyclicRepeatAMIInterface1
    {
        type            cyclicRepeatAMI;
        inGroups        1(RepeatAMI1);
        nFaces          1792;
        startFace      4182024;
        inGroups        1 ( RepeatAMI1 );
        name            cyclicRepeatAMIInterface1;
        neighbourPatch  cyclicRepeatAMIInterface2;
        transformPatch  cyclic_Out1;
    }
    cyclicRepeatAMIInterface2
    {
        type            cyclicRepeatAMI;
        inGroups        1(RepeatAMI2);
        nFaces          5565;
        startFace      4183816;
        inGroups        1 ( RepeatAMI2 );
        name            cyclicRepeatAMIInterface2;
        neighbourPatch  cyclicRepeatAMIInterface1;
        transformPatch  cyclic_Out1;
    }
    cyclic_In1
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          3616;
        startFace      4189381;
        matchTolerance  0.0001;
        transform      rotational;
        neighbourPatch  cyclic_In2;
        rotationAxis    (0 0 1);
        rotationCentre  (0 0 0);
    }
    cyclic_In2
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          3616;
        startFace      4192997;
        matchTolerance  0.0001;
        transform      rotational;
        neighbourPatch  cyclic_In1;
        rotationAxis    (0 0 1);
        rotationCentre  (0 0 0);
    }
    cyclic_Out1
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          6625;
        startFace      4196613;
        matchTolerance  0.0001;
        transform      rotational;
        neighbourPatch  cyclic_Out2;
        rotationAxis    (0 0 1);
        rotationCentre  (0 0 0);
    }
    cyclic_Out2
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          6625;
        startFace      4203238;
        matchTolerance  0.0001;
        transform      rotational;
        neighbourPatch  cyclic_Out1;
        rotationAxis    (0 0 1);
        rotationCentre  (0 0 0);
    }
)

Could you have me on this problem?
Attachment 68646

Attachment 68647

Attachment 68648

HenrikJohansson February 28, 2019 07:08

I have no personal experince with cyclicAMI but it looks like there is a problem with your cyclicOut. If you won't figure it out you could try cyclicGGI in foam-extend. That I have used and can help you with.

Annken March 2, 2019 02:40

Hi Johansson,
Thanks a lot for guiding me. In boundary file l have edited the cyclicAmi to be made cyclicGGi and which is given below
Code:

12
(
    outlet
    {
        type            patch;
        nFaces          6360;
        startFace      4074577;
    }
    movingWalls
    {
        type            wall;
        inGroups        1(wall);
        nFaces          40680;
        startFace      4080937;
    }
    cyclicOut1
    {
        type cyclicGgi;
        nFaces          6625;
        startFace      4121617;
        shadowPatch cyclicOut2;
        bridgeOverlap off;
        rotationAxis (0 0 1);
        rotationAngle 18;
        separationOffset (0 0 0);
    }
    cyclicOut2
    {
        type cyclicGgi;
        nFaces          6625;
        startFace      4128242;
        shadowPatch cyclicOut1;
        bridgeOverlap off;
        rotationAxis (0 0 1);
        rotationAngle 18;
        separationOffset (0 0 0);
    }
    rotorBlade
    {  type            wall;
        inGroups        1(wall);
        nFaces          33231;
        startFace      4134867;
    }
    statorBlade
    {
        type            wall;
        inGroups        1(wall);
        nFaces          6976;
        startFace      4168098;
    }
    inlet
    {
        type            patch;
        nFaces          1280;
        startFace      4175074;
    }
    stationaryWalls
    {
        type            wall;
        inGroups        1(wall);
        nFaces          18920;
        startFace      4176354;
    }
    cyclicIn1
    {
        type cyclicGgi;

        shadowPatch cyclicIn2;
        bridgeOverlap off;
        rotationAxis (0 0 1);
        rotationAngle 18;
        separationOffset (0 0 0);
        nFaces          3616;
        startFace      4195274;
     
    }
    cyclicIn2
    {  type cyclicGgi;
        nFaces          3616;
        startFace      4198890;
        shadowPatch cyclicIn1;
        bridgeOverlap off;
        rotationAxis (0 0 1);
        rotationAngle 18;
        separationOffset (0 0 0);
    }
    cyclicRepeatAMIInterface1
    {
        type            cyclicRepeatAMI;
        inGroups       
2
(
cyclicRepeatAMI
RepeatAMI1
)
;
        nFaces          1792;
        startFace      4202506;
        matchTolerance  0.0001;
        transform      unknown;
        neighbourPatch  cyclicRepeatAMIInterface2;
        method          faceAreaWeightAMI;
        transformPatch  cyclicOut1;
    }
    cyclicRepeatAMIInterface2
    {
        type            cyclicRepeatAMI;
        inGroups       
2
(
cyclicRepeatAMI
RepeatAMI2
)
;
        nFaces          5565;
        startFace      4204298;
        matchTolerance  0.0001;
        transform      unknown;
        neighbourPatch  cyclicRepeatAMIInterface1;
        method          faceAreaWeightAMI;
        transformPatch  cyclicOut1;
    }
)

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

But I am facing the problem when I run the solver pimpleFoam
Code:

/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  6
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 6-f934eabb0d52
Exec  : pimpleFoam
Date  : Mar 02 2019
Time  : 10:45:59
Host  : "anh"
PID    : 16781
I/O    : uncollated
Case  : /home/anh/OpenFOAM/OpenFOAM-6/run/ducanh/turbineImpellerNotSnap
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: solidBody
Selecting solid-body motion function rotatingMotion
Applying solid body motion to cellZone inletChannel

PIMPLE: No convergence criteria found


PIMPLE: No corrector convergence criteria found
        Calclations will do 2 corrections

Reading field p

cyclicRepeatAMI : Creating addressing and weights between 1792 source faces and 5565 target faces


--> FOAM FATAL ERROR:
Attempt to cast type genericPatch to type coupled

    From function To& Foam::refCast(From&) [with To = const Foam::coupledPolyPatch; From = const Foam::polyPatch]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/typeInfo.H at line 114.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::cyclicRepeatAMIPolyPatch::transformPatch() const at ??:?
#3  Foam::cyclicRepeatAMIPolyPatch::resetAMI() const at ??:?
#4  Foam::cyclicAMIPolyPatch::AMIs() const at ??:?
#5  Foam::tmp<Foam::Field<double> > Foam::cyclicAMIPolyPatch::interpolate<double>(Foam::Field<double> const&, Foam::UList<double> const&) const at ??:?
#6  Foam::cyclicAMIFvPatchField<double>::patchNeighbourField() const at ??:?
#7  Foam::coupledFvPatchField<double>::evaluate(Foam::UPstream::commsTypes) at ??:?
#8  Foam::cyclicAMIFvPatchField<double>::cyclicAMIFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#9  Foam::fvPatchField<double>::adddictionaryConstructorToTable<Foam::cyclicRepeatAMIFvPatchField<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#10  Foam::fvPatchField<double>::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/pimpleFoam"
#11  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary::readField(Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/pimpleFoam"
#12  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readFields(Foam::dictionary const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/pimpleFoam"
#13  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readFields() in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/pimpleFoam"
#14  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/pimpleFoam"
#15  ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/pimpleFoam"
#16  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#17  ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/pimpleFoam"
Aborted (core dumped)

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

Can you guide me detail for how to creates cyclicGGi or could you have me on this problem?
Thanks,

HenrikJohansson March 2, 2019 04:51

Hi,

I don't think GGi is implemented in OpenFOAM. You would have to install the extended version to use it. But I think that would be unnecessary. I would try to fix the AMI. Double check your boundary. Maybe there is a typo or you have not pointed to the correct shadow patches.

Annken March 22, 2019 07:09

Hi,
l tried my boundary but l do not see any problem, this is my case, could you help me?
https://github.com/anhkenyt/turbineU...bineTurborCase

hal_9000 March 8, 2024 04:14

Quote:

Originally Posted by kandelabr (Post 694231)
Hi, sorry for a late reply, I had to do it again to check if it still works :)
Here's roughly what to do:
  1. Create a separate patch group on your solid for each side of cyclic patch
  2. Create a mesh on the main solid but don't set any hypotheses on any dimension, just click "apply and close"
  3. Create a sub-mesh on the first cyclic patch, set your hypotheses and calculate it.
  4. Create another sub-mesh on the other cyclic patch and use 'Projection 1D-2D' hypothesis, source mesh: the main mesh from step 2, source face: first cyclic patch group
  5. Calculate the second mesh. Check patches, they should be the same.

See the attachment for a simple example.

Good luck!

how can it be applied to a hexahedral mesh? the cyclic boundary patches are all faces and my sub-meshes are 1D edges


All times are GMT -4. The time now is 03:53.