CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problem using AMI (https://www.cfd-online.com/Forums/openfoam-solving/95697-problem-using-ami.html)

kid May 8, 2012 07:23

Hello Everyone,
Have been stuck with AMI implementation for some time now and require some help guys.

Review of Problem: trying to solve rotating square in regular fluid domain.
Case file here: http://db.tt/59ubLm1j

Error: See after few iteration the delta T becomes irrelevant ( controlDict) and solver selects depending on courent number i suppose do not know why?

Note 1: "NAN" is last value that solver gets and stops.
GAMG: Solving for p, Initial residual = nan, Final residual = nan, No Iterations 50
time step continuity errors : sum local = nan, global = nan, cumulative = -nan
PIMPLE: iteration 2
smoothSolver: Solving for Ux, Initial residual = nan, Final residual = nan, No Iterations 1000
smoothSolver: Solving for Uz, Initial residual = nan, Final residual = nan, No Iterations 1000
--> FOAM FATAL IO ERROR:
wrong token type - expected Scalar, found on line 3 the word 'nan'
file: /home/chandra/OpenFOAM/chandra-2.1.x/run/roCube/system/data::solverPerformance::U at line 3.
From function operator>>(Istream&, Scalar&)
in file lnInclude/Scalar.C at line 91.
FOAM exiting

Note 2: If you see the AMI line i.e this line . We see 0 source face and 0 target faces. Is it right or wrong ? Really no idea.
I thought some faces should be there to transfer values.
.AMI: Creating addressing and weights between 0 source faces and 0 target faces


Any idea people, ?????

Commands i executed.
1.blockMeah
2 snappyHexMesh
3 mergeMeshes rotor/ stator/ (above 2 steps were repeated separately for rotar and stator.)
4 topoSets
5 ChangeDirectory
6 pimpleDyFoam

linnemann May 8, 2012 22:16

Look in your boundary file

Code:

    AMI1_patch0
    {
        type            cyclicAMI;
        nFaces          0;
        startFace      23605;
        matchTolerance  0.0001;
        neighbourPatch  AMI2_patch0;
        transform      noOrdering;
    }
    AMI2_patch0
    {
        type            cyclicAMI;
        nFaces          0;
        startFace      23605;
        matchTolerance  0.0001;
        neighbourPatch  AMI1_patch0;
        transform      noOrdering;
    }

both AMIs has 0 faces

also your changeDictionary

Code:

dictionaryReplacement
{
    boundary
    {
        AMI1_patch0
        {
            type            cyclicAMI;
            nFaces          0;
            startFace      24985;
            neighbourPatch  AMI2_patch0;
            transform      noOrdering;
            surface       
            {
            }
        }
        AMI2_patch0
        {
            type            cyclicAMI;
            nFaces          0;
            startFace      24985;
            neighbourPatch  AMI1_patch0;
            transform      noOrdering;
            surface       
            {
            }
        }
    }
}

here you set both to have the same startface and 0 nFaces, if I where you I would not use changeDictionary as it obviously does not do what you think it does. Change the files manually.

kid May 9, 2012 01:00

Hi linnemann,
Thank you for reply.
Same case after modification you suggested is here:
http://dl.dropbox.com/u/70019943/roCube2.tar.gz

Yes you are right i do not need changeDict file (silly on my part even after understanding i tried to use it as it made Solver to run ). Now when i change manually :
splitMeshRegions -makeCellZones -overwrite
This gives error as under.
Now the good part is this "weights between 1380 source faces and 1504 target".
Is there something i am terribly missing????

HTML Code:

Reading volScalarField cellToRegion
Reading volScalarField p
AMI: Creating addressing and weights between 1380 source faces and 1504 target faces
--> FOAM FATAL ERROR:
Unable to set source and target faces
    From function void Foam::cyclicAMIPolyPatch::setNextFaces(label&, label&, const primitivePatch&, const primitivePatch&, const boolList&, labelList&, const DynamicList<label>&) const
    in file lnInclude/AMIInterpolation.C at line 878.
FOAM aborting
#0  Foam::error::printStack(Foam::Ostream&) in "/home/chandra/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"


linnemann May 9, 2012 02:53

1 Attachment(s)
If you had spent just 2min on viewing the case in paraview and enabling the two AMIs like in the screenshot you will see why you have an error.

kid May 9, 2012 03:04

Sir ,
Is it because of tooth edges on AMI1_patch0.
Really sorry if this question is too trivial.

linnemann May 9, 2012 03:38

also that, but also because one of the sides of the AMI contains the top and bottom faces.

The ami should be 1:1 geometry wise, not mesh, but the extend and size must be the same.

kid May 9, 2012 03:46

Sir,
" because one of the sides of the AMI contains the top and bottom faces"
This is not clearly understood by me. Could you elaborate?

Also geometry should be 1:1 . What this means ?

linnemann May 9, 2012 04:00

The regions on each side of the AMI Connections are not allowed to be of different sizes and have non-overlap regions.

kid May 9, 2012 04:15

Well AMI1_patch0 is a cylindrical mesh with square. ( this will have upper and lower faces)
And AMI2_patch0 is the other one that is a hollow cylinder with no top and bottom surface.

If not his way what should be the logic to implement both AMI Sir?

Or any other pointer?

Or If we forget all doubts above . What should be the expected look in paraview on selecting both AMI patchs?

Attesz May 9, 2012 07:05

Hi Foamers,

have you tried AMI rotating things using unstructured tetrahedral mesh? In my case I have to use it due to the complexity of my geometry, but I have convergence problems (blowing up pressure fields).

Best,
A

kid May 9, 2012 07:50

Hello Attesz,
What tool you used for generating unstructured Mesh? Any OpenSource tool??

Attesz May 9, 2012 07:51

Quote:

Originally Posted by kid (Post 360088)
Hello Attesz,
What tool you used for generating unstructured Mesh? Any OpenSource tool??


Hi, no, i'm using ICEM CFD.

linnemann May 9, 2012 22:02

In your case both the AMI's have to be a hollow cylinder with no top and bottom

JulytoNovember May 12, 2012 00:57

Linneman, what would you suggest to do with the top and bottom? Inlets and outlets or would you change the nfaces to 0? Or would you suggest something else?

Attesz May 23, 2012 14:57

Bugreport, please contribute
 
Dear all,

I've just created a bugreport on OpenFOAM Mantis (http://www.openfoam.org/bugs/) issue 0000539 in this topic (AMI weight goes down to 0).

Please contribute with your observations to solve this bug asap.

Best regards,
Attesz


Quote:

Originally Posted by vinz (Post 337247)
Dear all,

It's been a while since I did not post on the forum, but I am still following with attention the new developments.
I tried to use the AMI feature with pimpleDymFoam on the tutorial propeller. It works perfectly and look very promising.
So I decided I would try it on one of my own model, and see what I get. Unfortunately, it always break up at some point whatever I use for the max courant number, or the relaxation factors, or many different things I tried.

I just notice that the last time step writes the following lines:

Code:

solidBodyMotionFunctions::rotatingMotion::transformation(): Time = 0.00123617 transformation: ((0 0 0) (0.981207 (0 0 0.192959)))
AMI: Creating addressing and weights between 23366 source faces and 23366 target faces
AMI: Patch source weights min/max/average = 0.000261522, 1.75988, 1.00123
AMI: Patch target weights min/max/average = 0, 1.3569, 1.00084
PIMPLE: iteration 1

I guess now the problem is coming from the "0" we can see just above. Am I right? What does it exactly means? and how can I solve this problem?

Thanks in advance for your advice.


kid May 24, 2012 00:36

Hi Attesz,
Its good that you have reported this issue.

Also in my case it is lack of my understanding of AMI that is creating problem, i suppose.

openfoam_user May 24, 2012 02:19

Hi Attesz,

Now for me it works but only when I generate the grid with ICEMCFD Hexa.

When I generate the mesh with snappyHexMesh (like propeller tutorial) it crashes. Same error as you. Strange because residuals and convergence history is smooth until the crash.

I hope that the AMI robustness will be improved.

Regards,
Stephane

Randomizer May 24, 2012 06:01

Hi Attesz,
I've had a lot of trouble with the same issue you posted. You see, when AMI gets zero weights, that means that during the interpolation to one of the faces on one AMI patch it couldn't find any faces on second AMI patch that has a projection to this face. The reason for this could be a bug in search/interpolation algorithm, or not a very good mesh. The AMI patches should be as much identical as possible (I mean the mesh, because geometry should be totally the same) , especially if they are cylindrical.

kid May 24, 2012 06:08

Hi All,
SUccess after almost 2 months in using AMI.
Though i used "SALOME" mesh imported in OpenFOAM-21x.
Also results are not good!!

But the weights are getting transfered though. Something like this.
AMI: Patch source weights min/max/average = 0.965339, 1.1551, 1.00005
AMI: Patch target weights min/max/average = 0.996065, 1.02292, 1.00278

Next step would be improving mesh again. Thanks everyone specially "linnemann" stephane and lovecraft. And you also guys.

Attesz May 24, 2012 07:52

Ok but how did you manage to make it work? :)

Quote:

Originally Posted by kid (Post 362853)
Hi All,
SUccess after almost 2 months in using AMI.
Though i used "SALOME" mesh imported in OpenFOAM-21x.
Also results are not good!!

But the weights are getting transfered though. Something like this.
AMI: Patch source weights min/max/average = 0.965339, 1.1551, 1.00005
AMI: Patch target weights min/max/average = 0.996065, 1.02292, 1.00278

Next step would be improving mesh again. Thanks everyone specially "linnemann" stephane and lovecraft. And you also guys.



All times are GMT -4. The time now is 00:44.