CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   Cyclic BC how to obtain exact same meshes? (http://www.cfd-online.com/Forums/openfoam-meshing/128440-cyclic-bc-how-obtain-exact-same-meshes.html)

gelbebanane January 12, 2014 18:23

Cyclic BC how to obtain exact same meshes?
 
Hi,
i want to simulate a steady state pipe flow the inlet and outlet are cyclic BC. I import my geometry through a .stl file. The problem is the mesh at the inlet and outlet are not from the same size and i cant make them cyclic with the "createPatch" utility.
How can i achieve this?

Hope i made my point

Greetings & good night

Akshay January 13, 2014 01:11

Hi1

Use cyclicAMI for the two patches. This should do the job.

gelbebanane January 13, 2014 04:49

Hey,
i've already tried to run it as cyclicAMI but the problem is the error:
Code:

AMI: Creating addressing and weights between 142345 source faces and 142177 target faces
--> FOAM Warning :
    From function AMIInterpolation<SourcePatch, TargetPatch>::checkPatches(const SourcePatch&, const TargetPatch&)
    in file lnInclude/AMIInterpolation.C at line 109
    Source and target patch bounding boxes are not similar
    source box span    : (0.000115329 0.0987398 0.152781)
    target box span    : (8.22414e-05 0.0987483 0.152795)
    source box          : (0.00671131 1.90699e-06 -0.00673927) (0.00682664 0.0987417 0.146042)
    target box          : (0.0301843 1.448e-06 0.0167262) (0.0302665 0.0987498 0.169521)
    inflated target box : (0.0210879 -0.0090949 0.00762988) (0.0393629 0.107846 0.178617)

Have you any idea how i can fix it?

Greetings

Akshay January 13, 2014 05:01

I see a warning not an error. Can you post the entire log?

gelbebanane January 13, 2014 05:49

Yep,
here it is. I create the cyclicAMI patches after my sHM parallel run with
Code:

createPatch -overwrite
Code:

t
>createPatch -overwrite
....
Build  : 2.2.x-ae7a43cbbfe3
Exec  : createPatch -overwrite
Date  : Jan 13 2014
Time  : 10:46:56
Host  :
PID    : 28596
Case  :
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create polyMesh for time = 0

Reading createPatchDict

Adding new patch inlet as patch 4 from
{
    type            cyclicAMI;
    neighbourPatch  outlet;
}

Adding new patch outlet as patch 5 from
{
    type            cyclicAMI;
    neighbourPatch  inlet;
}


Moving faces from patch eingang to patch 4
Moving faces from patch ausgang to patch 5

Doing topology modification to order faces.

AMI: Creating addressing and weights between 142345 source faces and 142177 target faces
--> FOAM Warning :
    From function AMIInterpolation<SourcePatch, TargetPatch>::checkPatches(const SourcePatch&, const TargetPatch&)
    in file lnInclude/AMIInterpolation.C at line 109
    Source and target patch bounding boxes are not similar
    source box span    : (0.000115329 0.0987398 0.152781)
    target box span    : (8.22414e-05 0.0987483 0.152795)
    source box          : (0.00671131 1.90699e-06 -0.00673927) (0.00682664 0.0987417 0.146042)
    target box          : (0.0301843 1.448e-06 0.0167262) (0.0302665 0.0987498 0.169521)
    inflated target box : (0.0210879 -0.0090949 0.00762988) (0.0393629 0.107846 0.178617)


--> FOAM FATAL ERROR:
Unable to find initial target face

    From function void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing(const SourcePatch&, const TargetPatch&, label, label)
    in file lnInclude/AMIInterpolation.C at line 712.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/sw/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/sw/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  at cyclicAMIPolyPatch.C:0
#3  Foam::AMIInterpolation<Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> >, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > >::update(Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&) in "/sw/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#4  Foam::AMIInterpolation<Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> >, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > >::AMIInterpolation(Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&, Foam::PrimitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&, Foam::autoPtr<Foam::searchableSurface> const&, Foam::faceAreaIntersect::triangulationMode const&, bool) in "/sw/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#5  Foam::cyclicAMIPolyPatch::resetAMI() const in "/sw/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#6  Foam::polyBoundaryMesh::movePoints(Foam::Field<Foam::Vector<double> > const&) in "/sw/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#7  Foam::polyMesh::movePoints(Foam::Field<Foam::Vector<double> > const&) in "/sw/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#8 
 in "/sw/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/bin/createPatch"
#9  __libc_start_main in "/lib64/libc.so.6"
#10 
 at /usr/src/packages/BUILD/glibc-2.11.2/csu/../sysdeps/x86_64/elf/start.S:116
Abgebrochen
>

and i want to edit the boundary file because it looks like that:
Code:

FoamFile
{
    version    2.0;
    format      binary;
    class      polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

4
(
    defaultFaces
    {
        type            empty;
        inGroups        1(empty);
        nFaces          0;
        startFace      6220988;
    }
    eingang
    {
        type            wall;
        nFaces          142345;
        startFace      6220988;
    }
    ausgang
    {
        type            wall;
        nFaces          142177;
        startFace      6363333;
    }
    wand
    {
        type            wall;
        nFaces          313335;
        startFace      6505510;
    }
)

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


Ruli January 22, 2014 06:20

How does your createPatchDict look?

Julian

gelbebanane January 22, 2014 09:04

1 Attachment(s)
Hey,
I'm 2 steps further.
First of all i am able to use createPatch without errors. Here is the "createPatch" output and my createPatchDict file attached.
file@bottom
Quote:

Create time

Create polyMesh for time = 0

Reading createPatchDict

Adding new patch inlet as patch 4 from
{
type cyclicAMI;
neighbourPatch outlet;
transform translational;
separationVector ( 0.0332 0 0 );
matchTolerance 0.001;
}

Adding new patch outlet as patch 5 from
{
type cyclicAMI;
neighbourPatch inlet;
transform translational;
separationVector ( -0.0332 0 0 );
matchTolerance 0.001;
}


Moving faces from patch eingang to patch 4
Moving faces from patch ausgang to patch 5

Doing topology modification to order faces.

AMI: Creating addressing and weights between 13756 source faces and 13639 target faces
AMI: Patch source weights min/max/average = 0.144171, 1.11922, 0.99572
AMI: Patch target weights min/max/average = 0.629266, 1.3752, 0.989389
Not synchronising points.

Removing patches with no faces in them.

Removing zero-sized patch defaultFaces type empty at position 0
Removing zero-sized patch eingang type wall at position 1
Removing zero-sized patch ausgang type wall at position 2
Removing patches.
Writing repatched mesh to 0

End
As you can see i distinguished the non overlapping faces and through this also the 0 weights.

But now i am hanging after calculating the velocity field (simpleFoam solver).
Quote:

st5> simpleFoam
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.2.x-ae7a43cbbfe3
Exec : simpleFoam
Date : Jan 22 2014
Time : 13:31:14
Host : "i"
PID : 25790
Case :
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

AMI: Creating addressing and weights between 5000 source faces and 5000 target faces
AMI: Patch source weights min/max/average = 0.984197, 1, 0.999811
AMI: Patch target weights min/max/average = 0.973747, 1, 0.999694
Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kOmegaSST
bounding k, min: 0 max: 0.3 average: 0.3
kOmegaSSTCoeffs
{
alphaK1 0.85034;
alphaK2 1;
alphaOmega1 0.5;
alphaOmega2 0.85616;
gamma1 0.5532;
gamma2 0.4403;
beta1 0.075;
beta2 0.0828;
betaStar 0.09;
a1 0.31;
b1 1;
c1 10;
F3 false;
}

No finite volume options present


SIMPLE: no convergence criteria found. Calculations will run for 100 steps.


Starting time loop

Time = 1

smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 2.74716e-12, No Iterations 1000
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 4.08486e-13, No Iterations 20
smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 3.08847e-13, No Iterations 20


--> FOAM FATAL ERROR:
Size mismatch.
Source patch size:5000
Source agglomeration size:2500
Target patch size:5000
Target agglomeration size:2500

From function AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation( const AMIInterpolation<SourcePatch, TargetPatch>&, const labelList&, const labelList&)
in file lnInclude/AMIInterpolation.C at line 1319.

FOAM exiting

This error excerpt is from my blockMesh compare case. As you can see the sizes are exactly of the same size. With my real case i get the same error but i wanted to test if the error belongs to the different number in cells but it doesn't. Pretty weired that it does not even work on an easy block case where the geometry planes must have the same geometric size.

Have you any further suggestions?

Greetings
Phil
____________
UPDATE:
createPatchDict: Attachment 28178

vbchris January 22, 2014 11:27

You attachment "Attachment 28173" is a dead link can you repost?

Chris

gelbebanane January 23, 2014 09:11

Hey,
and again im 1 step furhter.
The problem was solved like in this case by changing the solver for p (where the solver crashed) to something else.

Ruli January 23, 2014 09:18

Quote:

Originally Posted by gelbebanane (Post 471410)
by changing the solver for p (where the solver crashed) to something else.

Which solver did you use before? I am using GAMG and AMI in combination succesfully...

gelbebanane January 23, 2014 12:02

I have used the GAMG and now i switched to smoothSolver it is working but it needs over 1000 iterations to calculate. I use simpleFoam as CFD code what do you use with your AMI BC?

Greetings

Ruli January 23, 2014 13:24

Quote:

Originally Posted by gelbebanane (Post 471476)
I use simpleFoam as CFD code what do you use with your AMI BC?

I use MRFSimpleFoam.

Akshay January 29, 2014 05:16

Hi Phil

Can you check if your 'mergeLevels' for the GAMG solver is >1 ? If yes then make it '1' and try running it .

Akshay

Metti August 3, 2014 23:28

cyclicAMI
 
Hi Phil,

I don't get how you passed the createPatch step..?

you just said that you are 2 steps furthur. my problem is exactly there.

after SHM when i want to change my BC's with "createPatch", i came to the error of

[AMI: Creating addressing and weights between 98 source faces and 99 target faces
--> FOAM Warning :
From function AMIInterpolation<SourcePatch, TargetPatch>::checkPatches(const SourcePatch&, const TargetPatch&)
in file lnInclude/AMIInterpolation.C at line 111
Source and target patch bounding boxes are not similar
source box span : (105.417 80.3913 20.3297)
target box span : (104.946 81.1113 20.031)
source box : (-105 -79.9299 4.69853) (0.417155 0.461361 25.0282)
target box : (-104.448 77.2405 5) (0.497791 158.352 25.031)
inflated target box : (-111.155 70.5334 -1.70707) (7.20486 165.059 31.7381)


--> FOAM FATAL ERROR:
Unable to find initial target face]

what's the procedure..? :confused:

Metti August 6, 2014 05:14

yep..,:)

the problem is solved.
I got it myslfe.

Thanks anyway.

Metti September 12, 2014 09:50

Hey Foamers,

I'm being stopped. after SHM & createPatch for cyclicAMI faces when running simpleFOAM, it crashes out with the following error:

Quote:

Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

AMI: Creating addressing and weights between 420 source faces and 476 target faces
AMI: Patch source weights min/max/average = 0.67855, 1.0136, 0.995154
AMI: Patch target weights min/max/average = 0, 1.03575, 0.983427
AMI: Creating addressing and weights between 768 source faces and 807 target faces
AMI: Patch source weights min/max/average = 0.898335, 1.03752, 0.999786
AMI: Patch target weights min/max/average = 0.0196412, 1.03748, 0.98675
Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.005

Courant Number mean: 2.77762e-05 max: 0.00874534
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 1.4691e-06, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 1.20568e-06, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 4.8961e-08, No Iterations 1
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 Uninterpreted:
#3 Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&) at ??:?
#4
at ??:?
#5
at ??:?
#6 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#7
at ??:?
Floating point exception (core dumped)
and non of changing solver or other tips of the previous post on this thread couldn't change the situation.
I'm still stuck in my progress.

share your Tips if possible for help.

Thanks in Advance,

best regards,
Metti.

effi December 29, 2014 16:24

Quote:

Originally Posted by Metti (Post 504601)
yep..,:)

the problem is solved.
I got it myslfe.

Thanks anyway.

Could you please share your solution after the OP already didn't share his?
Im looking at a similar issue

Metti December 30, 2014 09:32

dear Ferdinand,

I know nothing of your case details but ...

what I did, was to get along with the Phill's procedure BUT the final point that he didn't mentioned was to change the option "writePrecision" in controlDict from 6 to a higher level like 10 or ... .

by this, I finally became able to change my patches' type to cyclicAMI without any error, BUT even after that till now I wasn't able to RUN since it crashes out and I haven't found out why ,yet.

Best,

effi January 24, 2015 10:50

Dear Metti,

i got mine to work and not crash!
What I did was (I generated my mesh in Pointwise):
Set the boundaries I wanted to be cyclic to patches.
Used the createPatch utility to transform these to cyclic boundary conditions.
Then renumbered the mesh with renumberMesh.
Voila, it stopped complaining for me!

Metti January 25, 2015 16:52

Hey effi,

So, u suggest to mesh in another software?

(From what i can undrestand from u're post )The way that u are mentioning, is to import the mesh from other tools (and i'm aware of that and of course i did it before and made my case RUN) But the problem was to deal with meshing for complex curved geometries including periodic patches in OF. specifically with SHM.

Correct me if i misundrestood that.

Best.


All times are GMT -4. The time now is 20:28.