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/)
-   -   simpleFooUnable to find initial target face (https://www.cfd-online.com/Forums/openfoam-solving/192165-simplefoounable-find-initial-target-face.html)

vcvedant August 29, 2017 19:04

simpleFooUnable to find initial target face
 
Hello,

I am simulating flow past an airfoil in OpenFOAM. I have created the mesh in Pointwise and then exported it as CAE from Pointwise. I have the following boundary conditions:

INLET -> fixedValue
OUTLET -> zeroGradient;
Periodic_1 -> cyclicAMI, neighbourPatch Periodic_2;
Periodic_2 -> cyclicAMI , neighbourPatch Periodic_1;
frontAndBack -> Empty;
CS -> wall;

I checked the mesh using checkMesh and found it to be OK.
But when I run the simulation using
Code:

simpleFoam
I get the following error: unable to find initial target face
Code:

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 453 source faces and 387 target faces
--> FOAM Warning :
    From function AMIMethod<SourcePatch, TargetPatch>::checkPatches()
    in file lnInclude/AMIMethod.C at line 57
    Source and target patch bounding boxes are not similar
    source box span    : (1.552 0.796554 0.0388)
    target box span    : (1.552 0.796554 0.0388)
    source box          : (-0.430502 -0.0584186 0) (1.1215 0.738135 0.0388)
    target box          : (-0.430502 -0.515211 0) (1.1215 0.281343 0.0388)
    inflated target box : (-0.517747 -0.602456 -0.0872454) (1.20874 0.368588 0.126045)


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

    From function void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise(labelListList&, scalarListList&, labelListList&, scalarListList&, label&, label&)
    in file lnInclude/AMIMethod.C at line 149.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::AMIMethod<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> > >::initialise(Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, int&, int&) in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#3  Foam::faceAreaWeightAMI<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> > >::calculate(Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, int, int) in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.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> > >::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 "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#5  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> > >::constructFromSurface(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&) in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#6  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, 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> > >::interpolationMethod const&, double, bool) in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#7  Foam::cyclicAMIPolyPatch::resetAMI(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> > >::interpolationMethod const&) const in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#8  Foam::cyclicAMIPolyPatch::AMI() const in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#9  Foam::cyclicAMIPolyPatch::applyLowWeightCorrection() const in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so"
#10  Foam::cyclicAMIFvPatch::makeWeights(Foam::Field<double>&) const in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#11  Foam::surfaceInterpolation::makeWeights() const in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#12  Foam::surfaceInterpolation::weights() const in "/gpfs/home/vjc5126/work//OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#13  Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::linearInterpolate<Foam::Vector<double> >(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/gpfs/home/vjc5126/work/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/simpleFoam"
#14  ? in "/gpfs/home/vjc5126/work/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/simpleFoam"
#15  __libc_start_main in "/lib64/libc.so.6"
#16  ? in "/gpfs/home/vjc5126/work/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/simpleFoam"
Aborted (core dumped)

I think it has to do something with cyclicAMI but I cannot understand what is the problem. I am attaching my case folder. I will be really grateful if somebody can help me resolve this.

Here is the link to the case: case

Thanks,

Vedant


Update: I re-checked the geometry and the periodic BCs have the same area and shape

vcvedant August 29, 2017 22:34

I am able to get resolve this issue by adding in the constant/polyMesh/boundary:
Code:

Periodic_1
{
  type    cyclicAMI;
  :
  :
  transform  translational;
  separationVector  (0 0.4567923 0);
}

Same was added to Periodic_2 but with negative value of y-component of the vector.


But now the when I run the simpleFoam, I get 'nan' in the first iteration for p.

vcvedant August 30, 2017 09:48

Another update: I changed the solver type for p and the simulation proceeds further but got very high continuity errors, 10^28. Then I ran the case in laminar and let the velocity field develop. Thereafter I turned on the turbulence and the continuity errors decreased.
I will update this post if I am able to solve this post and get results as per some previous studies in FLUENT and CFX.

PS: Please feel free if anyone wants to give their inputs.

Thanks

tmik September 6, 2018 10:43

Any more details on this? I have the same error:


Code:

Create time

Create mesh for time = 0


SIMPLE: convergence criteria
    field p      tolerance 0.0001
    field Ux    tolerance 0.0001
    field Uy    tolerance 0.0001
    field k      tolerance 0.0001
    field epsilon        tolerance 0.0001

Reading field p

AMI: Creating addressing and weights between 76 source faces and 76 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.164987 0.0569055 0.0005)
    target box span    : (0.164987 0.0569055 0.0005)
    source box          : (-0.186475 0.0302639 0) (-0.0214882 0.0871693 0.0005)
    target box          : (-0.186475 -0.141037 0) (-0.0214882 -0.0841312 0.0005)
    inflated target box : (-0.195201 -0.149763 -0.00872627) (-0.0127619 -0.0754049 0.00922627)


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

    From function bool Foam::AMIMethod<SourcePatch, TargetPatch>::initialise(Foam::labelListList&, Foam::scalarListList&, Foam::labelListList&, Foam::scalarListList&, Foam::label&, Foam::label&) [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> >&>; Foam::labelListList = Foam::List<Foam::List<int> >; Foam::scalarListList = Foam::List<Foam::List<double> >; Foam::label = int]
    in file lnInclude/AMIMethod.C at line 127.

FOAM aborting

using type cyclicAMI in both boundary and constraint files. Somehow it works fine with type cyclic as long as my tolerance is 0.11 (large tolerance).

Vishsel May 13, 2019 03:29

separationVector
 
Hi all,

May i know how to define value for separationVector in createPatchDict ?

Thanks in advance,
Vishsel.

wolfindark July 11, 2019 21:07

Quote:

Originally Posted by Vishsel (Post 733427)
Hi all,

May i know how to define value for separationVector in createPatchDict ?

Thanks in advance,
Vishsel.

the vectors are not referencing the origin of global coordinates. instead, you should write the vectors by taking the origin of the surface coordinates.

surface1 surface2
at (-2 0 0) at (2 0 0)
| ---------------------> |

the separation vector for your surface1 will be (4 0 0) which shows that your neighbour surface surface2 separated from your reference surface1 with that vector.

tmik July 12, 2019 09:33

Thanks
 
Thanks Wolfinthedark! I had no idea, but you are correct.
I was using the vector from the origin instead of between surfaces (or in my case edges)

Code:

Wrong way:
                            |<--------------------.------------------->|
[vector: (0 -2 0)]  surface1                origin                surface2  [vector: (0 2 0)]
 
_________________________________________________________
 
Correct way:
    |--------------------------------------->|
surface1                                      surface2  [vector: (0 4 0)]
 
    |<---------------------------------------|
surface1                                      surface2 [vector: (0 -4 0)]



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