CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Error while using my solver (https://www.cfd-online.com/Forums/openfoam-programming-development/103147-error-while-using-my-solver.html)

samiam1000 June 12, 2012 07:13

Error while using my solver
 
1 Attachment(s)
Dear All,

I have compiled a new solver (according to the standard name it should be named buoyantPimpleDyMFoam) and when I try to use it, I get this error:

Code:

lab@lab-laptop:~/Documenti/cases_OF/OF_case19_closed_cabinet/baseBuoyant$ buoyantPimpleDyMFoam_SZ
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.0-0bc225064152
Exec  : buoyantPimpleDyMFoam_SZ
Date  : Jun 12 2012
Time  : 12:54:33
Host  : "lab-laptop"
PID    : 6865
Case  : /home/lab/Documenti/cases_OF/OF_case19_closed_cabinet/baseBuoyant
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: displacementSBRStress
Selecting motion diffusion: exponential
Selecting motion diffusion: inverseFaceDistance

Reading g
Reading thermophysical properties

Selecting thermodynamics package hRhoThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
Reading field U

Reading/calculating face flux field phi

Reading field rAU if present

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
--> Upgrading k to employ run-time selectable wall functions
    Backup original k to k.old
    Writing updated k
--> Upgrading epsilon to employ run-time selectable wall functions
    Backup original epsilon to epsilon.old
    Writing updated epsilon
--> Creating mut to employ run-time selectable wall functions
    Writing new mut
--> Creating alphat to employ run-time selectable wall functions
    Writing new alphat
kEpsilonCoeffs
{
    Cmu            0.09;
    C1              1.44;
    C2              1.92;
    C3              -0.33;
    sigmak          1;
    sigmaEps        1.3;
    Prt            1;
}

Calculating field g.h

Reading field p_rgh

Creating field dpdt

Creating field kinetic energy K

No field sources present

Courant Number mean: 0 max: 0

PIMPLE: no residual control data found. Calculations will employ 2 corrector loops


Starting time loop

Courant Number mean: 0 max: 0
deltaT = 0.01
Time = 0.01

GAMG:  Solving for cellDisplacementx, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG:  Solving for cellDisplacementy, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG:  Solving for cellDisplacementz, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG:  Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0


--> FOAM FATAL ERROR:
Different dimensions for -=
    dimensions : [1 0 -1 0 0 0 0] = [0 3 -1 0 0 0 0]


    From function dimensionSet::operator-=(const dimensionSet&) const
    in file dimensionSet/dimensionSet.C at line 255.

FOAM aborting

Could anyone help in finding the problem? Attached, the solver.

Thanks a lot,
Samuele

kmooney June 12, 2012 09:36

Your code is attempting to perform a subtraction operation between two fields of different units (Foam tracks the units of dimensioned fields on the fly). I believe there are details on the [x x x x x x x] format in the users guide. Looking at your error in particular, it appears that one of your fields has been divided by density while the other has not.

samiam1000 June 12, 2012 09:41

Dear Kyle,

thanks for answering.

I am trying to find out which is the `wrong' line.. Isn't there a method to discover it?

Also, do you have any experience/time to help me?

Thanks,

Samuele

kmooney June 12, 2012 09:45

Quote:

Originally Posted by samiam1000 (Post 366017)
Dear Kyle,

thanks for answering.

I am trying to find out which is the `wrong' line.. Isn't there a method to discover it?

Also, do you have any experience/time to help me?

Thanks,

Samuele

I walked someone though a debug process in this thread. You could give it a try:

http://www.cfd-online.com/Forums/ope...exception.html

Its likely that other users have posted more thorough debugging guides on this forum if you search around.

~Kyle

samiam1000 June 13, 2012 04:24

1 Attachment(s)
Dear Kyle,

thanks for help.

Well, I think that I discovered which is the `key point'.. In the file correctPhi.H there are the following lines:
Code:

    while (pimple.correctNonOrthogonal())
    {
        fvScalarMatrix pcorrEqn
        (
            fvm::laplacian(rAU, pcorr) == fvc::div(phi)
        );

        pcorrEqn.setReference(pRefCell, pRefValue);
        pcorrEqn.solve();

So, could you help me in writing a good correctPhi.H file?

Thanks a lot,

Samuele

PS: attached you can find the solver. Thanks!

kmooney June 13, 2012 08:49

Do you have a small test case set up that I would be able to use?

I'm not sure that your issue is in flux correction code you posted. The error you recieved:

Code:

--> FOAM FATAL ERROR:  Different dimensions for -=      dimensions : [1 0 -1 0 0 0 0] = [0 3 -1 0 0 0 0]
Is complaining about an attempted subtraction operation. I don't see an operation of that type in the code you posted.

samiam1000 June 13, 2012 08:53

Yes I have.

Could you give me your email and I'll send it to you? Write me at samuele.zampini@gmail.com and I'll get back to you, soon.

Also, I am now developing a different solver (starting from sonicDyMFoam instead of pimpleDyMFoam), but I can not make the mesh move.

Anyway, I'll write you soon and that would be easier, wouldn't it?

Thanks,
Samuele


All times are GMT -4. The time now is 07:06.