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/)
-   -   Incompatible dimensions for operation (https://www.cfd-online.com/Forums/openfoam-solving/174445-incompatible-dimensions-operation.html)

twinklekothari July 12, 2016 10:27

Incompatible dimensions for operation
 
I am getting an error as below. Can someone help me solving it?


Courant Number mean: 0 max: 0


--> FOAM FATAL ERROR:
incompatible dimensions for operation
[U[0 1 -2 0 0 0 0] ] == [-grad(p)[1 -2 -2 0 0 0 0] ]

From function checkMethod(const fvMatrix<Type>&, const GeometricField<Type, fvPatchField, volMesh>&)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/fvMatrix.C at line 1356.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 void Foam::checkMethod<Foam::Vector<double> >(Foam::fvMatrix<Foam::Vector<double> > const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, char const*) at ??:?
#3
at ??:?
#4
at ??:?
#5 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6
at ??:?
Aborted (core dumped)


Thank you.

alexeym July 12, 2016 10:55

Hi,

You have wrong pressure dimensions. Guess, the solver is incompressible, so equations are divided by density.

twinklekothari July 14, 2016 07:01

after changing dimensions of pressure
 
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
bounding k, min: 0 max: 0.0937 average: 0.0937
bounding epsilon, min: 0 max: 2.39 average: 2.39
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmaEps 1.3;
}


Starting time loop

Time = 0.0025

Courant Number mean: 0 max: 0
^[[BsmoothSolver: Solving for Ux, Initial residual = 1, Final residual = 9.33146, No Iterations 1000
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.0823896, No Iterations 1000
smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 2.16149, No Iterations 1000
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ??:?
#4 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMa trix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:?
#5 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#6 Foam::fvMatrix<double>::solveSegregated(Foam::dict ionary const&) at ??:?
#7 Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
#8 Foam::fvMatrix<double>::solve() at ??:?
#9
at ??:?
#10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11
at ??:?
Floating point exception (core dumped)

alexeym July 14, 2016 07:09

Quote:

Originally Posted by twinklekothari (Post 609425)
bounding k, min: 0 max: 0.0937 average: 0.0937
bounding epsilon, min: 0 max: 2.39 average: 2.39

This indicates not quite correct initial/boundary conditions. k and epsilon could not be equal to 0.

Quote:

smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 9.33146, No Iterations 1000
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.0823896, No Iterations 1000
smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 2.16149, No Iterations 1000
And this usually means wrong boundary conditions. FPE during solution of pressure equation is just a consequence of diverged velocity equation.

twinklekothari July 14, 2016 08:22

there was mistake in the velocity. corrected it. but then, this.



Courant Number mean: 0.000837853 max: 0.179413
smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 4.77775e-06, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 4.82191e-06, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 2.96083e-12, No Iterations 1
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ??:?
#4 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMa trix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:?
#5 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#6 Foam::fvMatrix<double>::solveSegregated(Foam::dict ionary const&) at ??:?
#7 Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
#8 Foam::fvMatrix<double>::solve() at ??:?
#9
at ??:?
#10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11
at ??:?
Floating point exception (core dumped)

alexeym July 14, 2016 08:29

Since you keep your case in secret (even solver you are using could only be guessed by output), suggestions will be generic:

- check your boundary conditions for pressure
- try PCG instead of GAMG
- try smoothSolver instead of GAMG (if PCG fails)
- relax more

twinklekothari July 14, 2016 08:52

file k:


dimensions [ 0 2 -2 0 0 0 0 ];

internalField uniform 0.0937;

boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
wall
{
type kqRWallFunction;
value uniform 0.0937;
}
}



fvSolution file:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
p
{
solver GAMG;
tolerance 1e-04;
relTol 0.1;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
}

pFinal
{
$p;
tolerance 1e-04;
relTol 0;
}

"(U|k|epsilon|R|nuTilda)"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-03;
relTol 0;
}
}

PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}

please let me know if any other file is required to figure out my mistakes.
thanks alot.

alexeym July 14, 2016 09:02

Then let's start with checkMesh output.

twinklekothari July 15, 2016 07:13

checkMesh output


Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 2568811
faces: 7618500
internal faces: 7531500
cells: 2525000
faces per cell: 6
boundary patches: 3
point zones: 0
face zones: 0
cell zones: 0

Overall number of cells of each type:
hexahedra: 2525000
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
Patch Faces Points Surface topology
inlet 12500 12601 ok (non-closed singly connected)
outlet 12500 12601 ok (non-closed singly connected)
wall 62000 62200 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.10325 -0.10325 -4.1325) (0.10325 0.10325 4.1325)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (1.6254e-16 7.6806e-16 -7.61097e-17) OK.
***High aspect ratio cells found, Max aspect ratio: 7.13865e+195, number of cells 79032
<<Writing 79032 cells with high aspect ratio to set highAspectRatioCells
Minimum face area = 6.05538e-11. Maximum face area = 0.000153586. Face area magnitudes OK.
***Zero or negative cell volume detected. Minimum negative volume: -8.8737e-08, Number of negative volume cells: 77272
<<Writing 77272 zero volume cells to set zeroVolumeCells
Mesh non-orthogonality Max: 180 average: 24.3587
*Number of severely non-orthogonal (> 70 degrees) faces: 87760.
***Number of non-orthogonality errors: 225000.
<<Writing 312760 non-orthogonal faces to set nonOrthoFaces
***Error in face pyramids: 463928 faces are incorrectly oriented.
<<Writing 247308 faces with incorrect orientation to set wrongOrientedFaces
***Max skewness = 871.985, 1056 highly skew faces detected which may impair the quality of the results
<<Writing 1056 skew faces to set skewFaces
Coupled point location match (average 0) OK.

Failed 5 mesh checks.

End

alexeym July 15, 2016 07:28

Now you know what to do: fix your mesh first. Then you can try to proceed with simulation. Since I do not know where did you get your mesh, I can not suggest a way to fix it.

twinklekothari July 15, 2016 07:30

thanks. i hope i fix it.


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