CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Error in using createBaffles (https://www.cfd-online.com/Forums/openfoam-bugs/63419-error-using-createbaffles.html)

lakeat April 8, 2009 03:39

Error in using createBaffles
 
1 Attachment(s)
Dear Foam Fathers,

Good afternonn!

OpenFOAM-1.5
OpenSUSE-11.0
gcc-4.3.1

Procedure to reproduce the error messages is:
Click to download the case: Attachment 140
1. blockMesh
2. faceSet
3. Add another entry in file boundary, name this new patch "plate", as followed,
Code:

    plate
    {
        type            wall;
        nFaces          0;
        startFace      766644;
    }

4. createBaffles plate1 plate
Then:

Code:

lamb@lamb:~/OpenFOAM/lamb-1.5/run/tutorials/oodles/plate20000A1> createBaffles plate1 plate
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.5                                  |
|  \\  /    A nd          | Web:      http://www.OpenFOAM.org              |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Exec  : createBaffles plate1 plate
Date  : Apr 08 2009
Time  : 15:26:51
Host  : lamb
PID    : 15243
Case  : /home/lamb/OpenFOAM/lamb-1.5/run/tutorials/oodles/plate20000A1
nProcs : 1

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

Create mesh for time = 0

Reading faceSet from plate1

Read 920 faces from plate1

Using patch plate at index 4
Reading volScalarField p


bad size -1226266215#0  Foam::error::printStack(Foam::Ostream&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2  Foam::fvsPatchField<double>::addpatchConstructorToTable<Foam::calculatedFvsPatchField<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::surfaceMesh> const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#3  Foam::fvsPatchField<double>::New(Foam::word const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::surfaceMesh> const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/createBaffles"
#4  Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricBoundaryField::GeometricBoundaryField(Foam::fvBoundaryMesh const&, Foam::DimensionedField<double, Foam::surfaceMesh> const&, Foam::word const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#5  Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&, Foam::dimensionSet const&, Foam::word const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#6  Foam::surfaceInterpolation::makeWeights() const in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#7  Foam::surfaceInterpolation::weights() const in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#8  Foam::fvPatch::weights() const in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#9  Foam::coupledFvPatchField<double>::evaluate(Foam::Pstream::commsTypes) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#10  Foam::cyclicFvPatchField<double>::cyclicFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#11  Foam::fvPatchField<double>::adddictionaryConstructorToTable<Foam::cyclicFvPatchField<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#12  Foam::fvPatchField<double>::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/createBaffles"
#13  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricBoundaryField(Foam::fvBoundaryMesh const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/createBaffles"
#14  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readField(Foam::Istream&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/createBaffles"
#15  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/createBaffles"
#16  Foam::List<Foam::word> Foam::ReadFields<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::fvMesh>(Foam::fvMesh const&, Foam::IOobjectList const&, Foam::PtrList<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&, bool) in "/home/lamb/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/createBaffles"
#17  main in "/home/lamb/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/createBaffles"
#18  __libc_start_main in "/lib/libc.so.6"
#19  Foam::regIOobject::readIfModified() in "/home/lamb/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/createBaffles"


    From function List<T>::List(const label size)
    in file /home/dm2/henry/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/List.C at line 54.

FOAM aborting

Aborted

Thanks for any help.
Regards,

Daniel

niklas April 8, 2009 08:09

Why do you have fixedValue bc on a cyclic?
The number of the startface is not 321432.

so apart from a few mistakes in the supplied case it works for me using 1.5.x

So I would say if it is a bug and not a mistake on your side, this has been fixed already.

lakeat April 8, 2009 11:16

Sorry for that I have uploaded a wrong case.

Actually, I'm sure I did not make any mistakes there (I mean fixedValues for cyclic bc, and startSurface number as you mentioned).

So I am compiling version-1.5.x, and see tomorrow if it works or not.

Thank you Niklas!

lakeat April 8, 2009 21:06

Shame! I made a mistake again, I spent too much time sitting before computer.
It works now. Not a bug, sorry!
And thank you, Niklas!

lakeat October 29, 2009 23:56

Dear developers,

Hi, I want to report to you again, though not knowing where the bug is, but in my case now, I could run createBaffles using OpenFOAM-1.5-dev, but using OpenFOAM-1.6 ended with a segv. So I guess this is a bug in OpenFOAM-1.6.

So now I will turn on the OpenFOAM-1.5-dev when I need to createBaffles, and then turn back 1.6 for my pisoFoam case, and this works correctly.

I don't know whether you are interested in this.:confused:

mattijs October 30, 2009 07:14

Did you try 1.6.x? If so can you post some more information about the failure?

Thanks, Mattijs

lakeat October 30, 2009 08:53

My pleasure, I will build 1.6.x when my simulation is finished.

BTW, I really love the idea in version 1.6, that the turbulence modeling structure is rearranged, this is perfect in my opinion, for RANS and LES are going nearer and nearer recent years.

Best regards,

lakeat November 2, 2009 01:41

FOAM FATAL ERROR:
Cannot find faceZone f0
Valid zones are
0
(
)

mattijs November 2, 2009 05:54

the 1.6.x version takes a faceZone instead of a faceSet as in 1.5. For its usage see e.g. Allrun script in the lagrangian/porousExplicitSourceReactingParcelFoam/filter tutorial.

lakeat November 4, 2009 07:35

It works, thanks a lot.

One more question, is there a way to view the number of each face in paraview, I found faceSet or cellSet utilities are difficult to use.
In my case, in order to select some faces (with different angles), I need to use an inclined box first, and then test each number manually, which is very inconvenient.

lakeat November 4, 2009 20:38

1 Attachment(s)
Hi, mattijs!

Could you help and have a look at this, please.
Attachment 1416
It still goes wrong. The process to reproduce the error is
1. Download the A6 case;
2. blockMesh;
3. use the boundary_AfterPlateAdded to replace the boundary file;
4. (No cellSet and faceSet and setsToZones are needed, since I have already done it, the files are already exist);
5. createBaffles f0 plate -overwrite;

Thank you.

mattijs November 5, 2009 06:05

The boundary_AfterPlateAdded has an extra patch 'plate' but it has nFaces != 0 so is not a drop-in replacement. Run checkMesh to check.

(why not add plate to your blockMeshDict)

2) you'll probably want to unset FOAM_SIGFPE because the patchFields created on patch plate have no value (since they cannot be mapped from existing patch faces). If they happen to have an illegal value you will get a sigfpe.

lakeat November 5, 2009 08:10

Thank you, mattijs.

The case is an external flow past a bridge deck (twin box), but under each box (near the center of the whole deck) there is a guide vane. The guide vanes are too small to use blockMesh to handle in a convenient way, so I decided to treat it as a zero thickness plate. So first, I disregard the guide vanes, and build the whole mesh with blockMesh (quite complicated), then I want to use createBaffles to create the guide vanes with zero thicknesses.

That's why I did not add plate to my original blockMeshDict.

In an old post, I remember the way to createBaffles is to modify the boundary file after faceSet is done, (1) modify the patches number, (2) add another patch entry but leave the nFaces empty meanwhile modify the startFace.

You know, I managed to do it successfully in a 2D mesh which is exactly the same as in this case A6 except the spanwise grid number is unity, but in this 3D case I met the segv, and not knowing what was going wrong here.

Quote:

unset unset FOAM_SIGFPE
Howto? Just comment out "unset FOAM_SIGFPE=" in etc/bashrc?

I have tried many possibilities, but to no avail. I don't know why the utility works in 2D case, but fails in 3D.

So sorry, I did not quite understand your answer, I hope my description are clear and enough.

Many thanks.

mattijs November 5, 2009 11:49

It works on your case.

You can add 'plate' to your blockMeshDict as any other patch but just leave the list of faces empty. Then when you run blockMesh it will create a patch 'plate' with zero faces in it.

FOAM_SIGFPE is a environment variable. See your shell on how to unset it.

lakeat November 5, 2009 20:39

O, great, it works now, thank you very much.

panda60 March 29, 2010 10:54

Dear lakeat,

I am using version-1.6.
First I generate fluent mesh which has an interior face int_WALL.
Then I use fluent3DMeshToFoam,

in faceZones file has this int_WALL.

so I use
createBaffles int_WALL WALL command.
but it display:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Converting faces on zone int_WALL1 into baffles.

Found 1121 faces on zone int_WALL1



Cannot find patch WALL1
Valid patches are
6
(
INLET
OUTLET
LEFT
RIGHT
TOP
GROUND
)


From function findPatchID(const polyMesh&, const word&)
in file createBaffles.C at line 115.

FOAM exiting
.

Then I add
WALL
{
type wall;
nFaces 0;
startFace 127074;
}
to boundary file,
WALL
{
type wall;
nFaces 0;
startFace 127074;
}

but still have error:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0



Expected a ')' or a '}' while reading PtrList, found on line 56 the word 'WALL1'

file: /home/panda60/OpenFOAM/run/exp/constant/polyMesh/boundary at line 56.

From function Istream::readEndList(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 152.

FOAM exiting

.
How could I solve this problem ?
Thank you.

mattijs March 29, 2010 12:49

You'll need to adapt the number at the top of the boundary file. It probably still says 6 but you've got 7 entries in there now.

panda60 April 1, 2010 03:53

1 Attachment(s)
Dear ,Mattijs

Thank you very much.
Now already OK.

but I have nearly 30 internal walls, it is indeed a large work.
for 1,000,000 mesh, I do this again and again and wait for 2 hours.:)

If we have command to convert these 30 faceZones to internal walls for only one time ?

mattijs April 1, 2010 04:11

No, there is no command to do multiple faceZones.

panda60 April 28, 2010 05:56

1 Attachment(s)
Dear Mattijs,
If I want to create an internal patch for sampling, what boundary condition should I set for this patch ?

this patch belongs to internal domain, is not boundary. how should I set for it, then it can be an internal patch, only used for sampling, but doesn't influence the flow ?

If I should use createPatch ? then boundary condition ?

Thank you very much.


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