CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   simpleFoam errors (https://www.cfd-online.com/Forums/openfoam-pre-processing/143848-simplefoam-errors.html)

Wien3 November 4, 2014 05:13

simpleFoam errors
 
Good morning,
First of all thank you all for creating an useful forum to share our ideas and difficulties about CFD. Let's go to my problem.

First, I followed the tutorial which is described in https://github.com/enGits/engrid/wik...and-enGrid-1.2 ; which consists of a ball which receives moving fluid.
I created the model in Blender and the mesh in enGrids (version 1.4) with some problems, but I think I solved them. After exporting it to OpenFoam, I introduced the directory in my terminal and I wrote 'simpleFoam'.
The error messages which appear are:

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kOmegaSST
--> Upgrading k to employ run-time selectable wall functions
Backup original k to k.old
Writing updated k
--> Upgrading omega to employ run-time selectable wall functions
Backup original omega to omega.old
Writing updated omega
--> Creating nut to employ run-time selectable wall functions
Writing new nut
bounding k, min: 0 max: 0.0024 average: 0.0024
bounding omega, min: 0 max: 2.4 average: 2.4
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#5 at kOmegaSST.C:0
#6 Foam::incompressible::RASModels::kOmegaSST::F2() const in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#7 Foam::incompressible::RASModels::kOmegaSST::F23() const in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#8 Foam::incompressible::RASModels::kOmegaSST::kOmega SST(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&, Foam::word const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#9 Foam::incompressible::RASModel::adddictionaryConst ructorToTable<Foam::incompressible::RASModels::kOm egaSST>::New(Foam::GeometricField<Foam::Vector<dou ble>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#10 Foam::incompressible::RASModel::New(Foam::Geometri cField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#11
in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/simpleFoam"
#12 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13
in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/simpleFoam"
Floating point exception (core dumped)
.

I don't know what these errors mean, so any kind of help would be wonderful!
I attach my enGrid model, in case it could be of help.

Thanks!
Alberto

ssss November 4, 2014 05:29

It diverges.

You will need to see if your Boundary Conditions are right placed with the correct values. You will also need to check your mesh.

We cannot help more if you don't give us more information about your case, how your mesh looks, your BC, etc.

alexeym November 4, 2014 05:31

Hi,

as the error is FPE in Foam::incompressible::RASModels::kOmegaSST::F2(), you can take a look at source code (also it's in division, so usually it's division by zero):

Code:

tmp<volScalarField> kOmegaSST::F2() const
{
    tmp<volScalarField> arg2 = min
    (
        max
        (
            (scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_),
            scalar(500)*nu()/(sqr(y_)*omega_)
        ),
        scalar(100)
    );

    return tanh(sqr(arg2));
}

You've got two divisions in the method, in bot cases denominator contains omega_ and y_. I guess the problem is in initial values of omega field (it's zero somewhere).

Wien3 November 4, 2014 07:05

Hi,
I will try to explain my model. It is quite easy (as shown in attached figure): you have an sphere in the middle of a cube, which receives a fluid by one side and it is expeled by the opposite one.

Concerning the error message, it seems to be that the mistake is related with the "k".

Invalid wall function specification
Patch type for patch Back must be wall
Current patch type is patch

From function kqRWallFunctionFvPatchField::checkType()
in file derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C at line 45.

FOAM aborting


I agree with you that is some kind of error in 0 folder, so I attached it. Maybe more expert eyes could see my mistakes.

Thank you

alexeym November 4, 2014 07:24

Quote:

Originally Posted by Wien3 (Post 517297)
Invalid wall function specification
Patch type for patch Back must be wall
Current patch type is patch

From function kqRWallFunctionFvPatchField::checkType()
in file derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C at line 45.

FOAM aborting

This error is quite obvious and self-explanatory. If you'd like to use wall function as a BC, the type of the patch where you use this wall function should be "wall". In your case it is "patch". As your mesh is imported, you can either correct description of the Back patch in the software you've used to create mesh, or you can edit constant/polyMesh/boundary file.

Also I'm not quite sure about your inlet with k=0, in kOmegaSST.C after solution of k-equation you've got:

Code:

    bound(k_, kMin_);
where kMin_ is 1e-16 (IIRC). So on every time step you'll be bounding k_ and it is not very good idea.

Wien3 November 5, 2014 03:42

Good Morning!
Concerning to the first problem you were right, changing in boundary file the type to wall solved the problem (sorry if I make silly questions but I'm new with this CFD's programs).

Relating to the second one, I decided to change every assignment which were 0 to 0.00001 (as you can see in files attached), in order to try to avoid no-convergence problems. In spite of this, this error appears:

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;
c1 10;
Cmu 0.09;
b1 1;
F3 false;

No finite volume options present

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

Starting time loop

Time = 1


Of course these iterations take too much time (more than 1000s).
Do you know which order of magnitude should I choose for these constants (k, nu, epsilon, omega)?? I don't really know if the should be like the value I assigned or for example close to 1.

Thank you very much

SCG November 5, 2014 04:08

boundaryFoam solver
 
this is not related this thread this is a new problem please try to reply
I am able to display mesh which is imported from ICEM CFD but when i solve the boundaryFoam it is giving around 17 errors i am unable understand what i need to do
This is simple problem KEpsilon turbulance model and i copied files from Incompressible---boundaryFoam--boundarywallfunction

alexeym November 5, 2014 04:15

Hi,

didn't find error message in your last post. If your concern is about line

Code:

SIMPLE: no convergence criteria found. Calculations will run for 1000 steps.
It simply states that you've forgotten to put convergence criterion in your fvSolution, something like (residualControl dictionary):

Code:

SIMPLE
{
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        "(p|U|k|omega)" 1e-2;
    }
}

About turbulence boundary conditions for inlet and outlet: http://www.cfd-online.com/Wiki/Turbu...ary_conditions. As there's no information about turbulence inside the domain, you can use calculated values as IC also.

Wien3 November 5, 2014 05:59

Hi,
I'm happy because thank to your help I achieved to run 'simpleFoam' with any error messages (and with only three iterations).
My new problem is, when I write 'paraFoam' after that, the new window is opened but in it I don't have the expected results.
I'll explain myself: I select the model, I apply with the green button and, after selecting the variable (for example 'p') and wireframe (as the ball and fluid are inside I didn't have any other idea) but then nothing happens, the whole model is blue.
Apart from this, I realized that it only runs three times when, as input in controlDict folder, it has and endTime of 1000 and a timeStep of 100 (so it is supposed to do it 10 times).

I attach the 0 and system folders to try to ensure they are completely correct.

Thank very very much

alexeym November 5, 2014 08:41

Well,

1. In fact I'm quite surprised it's running at all, cause you've forgotten closing } in residualControl dictionary. You've got

Code:

SIMPLE
{
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        "(p|U|k|epsilon|omega)" 1e-2; //*(3)
}

it should be

Code:

SIMPLE
{
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        "(p|U|k|epsilon|omega)" 1e-2; //*(3)
    }
}

2. And solver does only 3 step due to convergence (I guess, see output of the solver). You've got zero velocity everywhere (except outlet, where zero-gradient BCs is set); no gradients of pressure; so your ICs are your final solution ;)

3. To look inside the cube in paraview, you can use Clip filter to remove part of your cube.

4. Btw I really don't like your mesh. For example Gmsh (http://gmsh.info) has fine demo of a sphere inside a cube (demos -> transfinite.geo) where it creates hexagonal mesh of a sphere inside a cube. You can adapt geometry values for your case.

Wien3 November 6, 2014 03:28

Good morning!
You were right: I forgot a "}". After adding it the number of iterations increased to 5. I hope it could solve my problem but, when I verified it, the problem was still the same.
I don't know if the fact that it appears everything in blue has to some relation with the mesh, but I will try to follow your advice (it has given good results).
The problem is the link to the demo transfinite.geo seems to be broken... any other idea?

PD: Thank you for your tip about 'clip filter'.

alexeym November 6, 2014 03:45

Hi,

if you'd like to have direct like to transfinite.geo: https://geuz.org/svn/gmsh/trunk/demos/transfinite.geo. Any way, you have to visit http://gmsh.info and download software to generate meshes.

The reason for 5 iterations and blue colour in paraview: you don't have any gradients in your initial and boundary conditions. So pressure is 0 everywhere (corresponds to blue colour in paraview's default palette), velocity is 0 everywhere, etc. (well, turbulent parameters should have gradients due to wall functions).

SCG November 6, 2014 04:33

boundary Foam
 
when i run the solver boundary Foam for my case it is telling that
number of wall faces > 2

ssss November 6, 2014 04:57

Dear Wien3,

Here you have a link to the gmsh file

https://github.com/nschloe/gmsh/blob...ransfinite.geo

Be sure to run gmshToFoam after you create the mesh and to check the BC names and type so that it works.

Wien3 November 10, 2014 04:14

Good Morning!
Because of your help and many hours later...After all I achieved to make it work! I'm quite happy because I can see now my pressure map perfectly.
In order to continue learning about these program, I tried with temperature. I wanted to add these variable to my case, so I guessed I had to add a 0/T file and make some changes in fvSolution, as it is done in other tutorials.

My 0/T file is:

dimensions [0 0 0 1 0 0 0];

internalField uniform 300;

boundaryField
{
Back
{
type fixedValue;
value uniform 300;
}
Bottom
{
type fixedValue;
value uniform 300;
}
Front
{
type fixedValue;
value uniform 300;
}
Icosphere
{
type fixedValue;
value uniform 300;
}
Inlet
{
type fixedValue;
value uniform 300;
}
Outlet
{
type zeroGradient;
}
Top
{
type fixedValue;
value uniform 300;
}

}


And my fvSolution has changed in this way:

solvers
{

p PCG
{
maxIter 1000;
preconditioner DIC;
tolerance 1e-06;
relTol 0;
};

T PBiCG //* (6)
{
preconditioner DILU;
tolerance 1e-08;
relTol 0;
};

U PBiCG
{
preconditioner DILU;
tolerance 1e-05;
relTol 0;
};
k PBiCG
{
preconditioner DILU;
tolerance 1e-05;
relTol 0;
};
omega PBiCG
{
preconditioner DILU;
tolerance 1e-05;
relTol 0;
};
epsilon PBiCG
{
preconditioner DILU;
tolerance 1e-05;
relTol 0;
};

}

SIMPLE
{
nNonOrthogonalCorrectors 2;

residualControl
{
"(p|T|U|k|epsilon|omega)" 0.5; //*(3)
}
}
relaxationFactors
{
p 0.3;
T 0.7;
U 0.7;
k 0.7;
epsilon 0.7;
omega 0.7;

}

My problem is when I open paraFoam. I select the faces I want to see in the screen and the fields (T, p, U) but when I click 'play' it appears this message:

p, li { white-space: pre-wrap; } Warning: In /home/opencfd/OpenFOAM/ParaView-4.1.0/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx, line 279
vtkSMPVRepresentationProxy (0x6a66610): Could not determine array range.

I don know what do you think about this error. If you could provide me some piece of advice it would be great.

Thank you

Wien3 November 10, 2014 04:40

Sorry, I forgot to say that I've changed later also the fvSchemes in this way:

ddtSchemes
{
default Euler;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(T) Gauss linear; //*
grad(U) Gauss linear;
}

divSchemes
{
default none;
div(phi,T) Gauss upwind; //*
div(phi,U) Gauss linearUpwind Gauss;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,omega) Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear; //*(2)
}

laplacianSchemes
{
default none;
laplacian(DT,T) Gauss linear corrected; //*
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DomegaEff,omega) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(1,p) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p;
}

jherb November 10, 2014 06:23

Do you use simpleFoam? It does not support temperature. You might be able to use buoyantBoussinesqSimpleFoam or buoyantSimpleFoam (be careful with the different definitions of pressure).

Wien3 November 10, 2014 08:35

Yes, I was using simpleFoam (sorry for the mistake). I have examined a example in "buoyantBoussinessqSimpleFoam" tutorials which is called hotroom. After adding some files and commands which were necessary, I find this error when I write "buoyantBoussinesqSimpleFoam" in my terminal:

--> FOAM FATAL ERROR:
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux : 33.506
Specified mass inflow : 2.14
Specified mass outflow : 0
Adjustable mass outflow : 3.78418e-16


From function adjustPhi(surfaceScalarField&, const volVectorField&,volScalarField&)
in file cfdTools/general/adjustPhi/adjustPhi.C at line 118.

FOAM exiting


Concerning to check velocity, I don't know how to change it if I need my fluid to flow form inlet to outlet and related to run potentialFoam in my terminal before, it also doesn't work. I attach again my files.

Thank you for your help!

Wien3 November 11, 2014 09:55

Well, I achieved to run potentialFoam, copy that 0/U in my case and run later with "buoyantBoussinessqSimpleFoam". If I do it with a tolerance of 0.1, when it takes 88 iterations the process is aborted (also with 0.3). These errors are:

Time = 88

DILUPBiCG: Solving for Ux, Initial residual = 0.510866, Final residual = 9.72347e-06, No Iterations 8
DILUPBiCG: Solving for Uy, Initial residual = 0.519936, Final residual = 2.23894e-06, No Iterations 9
DILUPBiCG: Solving for Uz, Initial residual = 0.588101, Final residual = 3.37925e-06, No Iterations 9
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5 Foam::fvMatrix<double>::solveSegregated(Foam::dict ionary const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#6 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/buoyantBoussinesqSimpleFoam"
#7
at buoyantBoussinesqSimpleFoam.C:0
#8
in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/buoyantBoussinesqSimpleFoam"
#9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10
in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/buoyantBoussinesqSimpleFoam"
Floating point exception (core dumped)


When I changed the tolerance to 0.5 it seemed to work (I don't trust really much on this value). Then I wrote paraFoam, OpenFOAM was opened and I verified (before clicking play) that T could be represented fine.
But when I press play, this variable disappears from 'Properties>VolumeFields'. As in my terminal doesn't appear any kind of error, I don't know how I could follow.
I attach again my files (except U because it weighs too much).

Thank you very much


All times are GMT -4. The time now is 12:17.