CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Courant number blowing up, non-orthogonal mesh? (http://www.cfd-online.com/Forums/openfoam-solving/125169-courant-number-blowing-up-non-orthogonal-mesh.html)

odellar October 21, 2013 04:14

Courant number blowing up, non-orthogonal mesh?
 
Hi,

I'm trying to run a case I created with a backward facing step geometry, using the k-epsilon turbulence model, RAS solver. I've created the mesh and when I run blockMesh it creates the mesh (which when I view in ParaView looks correct) but gives some warnings:
Code:

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

Creating block mesh from
    "/home/olie/OpenFOAM/olie-2.2.1/run/tutorials/incompressible/pisoFoam/ras/bfstep/constant/polyMesh/blockMeshDict"
Creating curved edges
Creating topology blocks
Creating topology patches

Creating block mesh topology
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 0
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 1
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 2
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 3
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 4
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 5
--> FOAM Warning :
    From function blockMesh::createTopology(IOdictionary&)
    in file blockMesh/blockMeshTopology.C at line 255
    negative volume block : 0, probably defined inside-out
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 0
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 1
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 2
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 3
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 4
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 5
--> FOAM Warning :
    From function blockMesh::createTopology(IOdictionary&)
    in file blockMesh/blockMeshTopology.C at line 255
    negative volume block : 1, probably defined inside-out
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 0
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 1
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 2
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 3
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 4
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -2.66667 for face 5
--> FOAM Warning :
    From function blockMesh::createTopology(IOdictionary&)
    in file blockMesh/blockMeshTopology.C at line 255
    negative volume block : 2, probably defined inside-out

Check topology

    Basic statistics
        Number of internal faces : 2
        Number of boundary faces : 14
        Number of defined boundary faces : 14
        Number of undefined boundary faces : 0
    Checking patch -> block consistency

Creating block offsets
Creating merge list .

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale 1

Writing polyMesh
----------------
Mesh Information
----------------
  boundingBox: (0 -2 0) (10 2 1)
  nPoints: 1942
  nCells: 900
  nFaces: 3670
  nInternalFaces: 1730
----------------
Patches
----------------
  patch 0 (start: 1730 size: 10) name: inlet
  patch 1 (start: 1740 size: 20) name: outlet
  patch 2 (start: 1760 size: 110) name: fixedWalls
  patch 3 (start: 1870 size: 1800) name: frontAndBack

End

When I then run pisoFoam it fails and says:

Code:

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

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
    Cmu            0.09;
    C1              1.44;
    C2              1.92;
    sigmaEps        1.3;
}


Starting time loop

Time = 0.001

Courant Number mean: 1.66667e+295 max: 1.5e+297
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  void Foam::fvc::surfaceIntegrate<Foam::Vector<double> >(Foam::Field<Foam::Vector<double> >&, Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#4  Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::surfaceIntegrate<Foam::Vector<double> >(Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#5  at gaussDivSchemes.C:0
#6  Foam::fv::gaussDivScheme<Foam::Tensor<double> >::fvcDiv(Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#7  Foam::tmp<Foam::GeometricField<Foam::innerProduct<Foam::Vector<double>, Foam::Tensor<double> >::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div<Foam::Tensor<double> >(Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so"
#8  Foam::incompressible::RASModels::kEpsilon::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#9 
 in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/pisoFoam"
#10  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11 
 in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/pisoFoam"
Floating point exception (core dumped)

So the Courant number blows up immediately. I don't think it's an issue with my choice of time step, I've been very careful to choose it to satisfy Co<1.

I'd be very grateful if someone could help me out!

Thanks,
Olie

msuaeronautics October 22, 2013 10:43

You need to re-mesh. Seems like you have some mesh quality issues- most specifically, inside-out cells.

odellar October 22, 2013 14:22

Quote:

Originally Posted by msuaeronautics (Post 458322)
You need to re-mesh. Seems like you have some mesh quality issues- most specifically, inside-out cells.

Okay, thank you.

Now what exactly does that mean? Made a mistake with the way I defined blocks or something? Maybe the order of the vertices I give?

Thanks for pointing that out.

msuaeronautics October 22, 2013 14:25

That's what it seems like. You must also remember to follow the right hand rule when defining block faces etc.

odellar October 22, 2013 15:57

Quote:

Originally Posted by msuaeronautics (Post 458364)
That's what it seems like. You must also remember to follow the right hand rule when defining block faces etc.


Thank you - I had a look at the way I'd defined blocks and faces and it would appear I didn't follow the RHR. So I've got it to run now, HOWEVER the mesh isn't using the same x-y-z coordinates as me it would seem. For example I have three blocks, which in blockMeshDict I've declared:

Code:

blocks
(
hex (11 12 4 3 8 9 1 0) (10 10 1) simpleGrading (1 1 1)//0
hex (12 13 5 4 9 10 2 1) (40 10 1) simpleGrading (1 1 1)//1
hex (14 15 7 6 12 13 5 4) (40 10 1) simpleGrading (1 1 1)//2
);

- so I mean to have 10 cells in x, 10 in y, and 1 in z (first block), 40 cells in x, 10 in y, 1 in z (second block).. etc.. HOWEVER when I look at the mesh in Paraview it seems to be producing me the right outline geometrical shape, but with 10 cells in x, 1 in y, and 10 in z (first block), 40 cells in x, 1 in y, and 10 in z (second block).. etc..

I.e. it's mixed up my mesh resolutions in the y & z directions - do you know why this is?

Thanks for the help.
Olie

zfaraday October 22, 2013 19:50

Hi odellar!

Read carefully the section 5.3 of the User Guide http://www.openfoam.org/docs/user/blockMesh.php. It's important to understand the use of the "local coordinate system" when you create your blocks and the difference between both local and global coordinate systems, which is what you see in paraview.

cheers.

zfaraday


All times are GMT -4. The time now is 01:55.