CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   How to fix a value in the buoyanPimpleFoam solver? (http://www.cfd-online.com/Forums/openfoam/99092-how-fix-value-buoyanpimplefoam-solver.html)

samiam1000 March 26, 2012 06:15

How to fix a value in the buoyanPimpleFoam solver?
 
1 Attachment(s)
Dear all,

I am trying to add a constant field at the buoyantPimpleFoam (thank to the explicitSetValue feature) ad I did for the buoyantSimpleFoam (see here).

I modified the solver and you can find it attached.

When I try to use it, I get the following error:

Code:

lab@lab-laptop:~/Documenti/cases_OF/OF_case10_unsteady1_mod$ buoyantPimpleFoam_Epta
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  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  : buoyantPimpleFoam_Epta
Date  : Mar 26 2012
Time  : 12:14:00
Host  : "lab-laptop"
PID    : 6720
Case  : /home/lab/Documenti/cases_OF/OF_case10_unsteady1_mod
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


Reading g
Reading thermophysical properties

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

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
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

Creating field source list from sourcesProperties

Selecting source model type scalarExplicitSetValue
    Source: air_infinite
    - selecting cells using cellSet air_infinite
    - selected 2730 cell(s) with volume 1.2

Courant Number mean: 0 max: 0

PIMPLE: Operating solver in PISO mode


Starting time loop

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

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 9.37413e-07, No Iterations 33
DILUPBiCG:  Solving for Uy, Initial residual = 1, Final residual = 7.89177e-07, No Iterations 32
DILUPBiCG:  Solving for Uz, Initial residual = 1, Final residual = 9.68752e-07, No Iterations 23
DILUPBiCG:  Solving for h, Initial residual = 0.00105513, Final residual = 9.73831e-07, No Iterations 13
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/libc.so.6"
#3  Foam::hRhoThermo<Foam::pureMixture<Foam::constTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > > >::calculate() in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#4  Foam::hRhoThermo<Foam::pureMixture<Foam::constTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > > >::correct() in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#5 
 in "/home/lab/OpenFOAM/lab-2.1.0/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam_Epta"
#6  __libc_start_main in "/lib/libc.so.6"
#7 
 in "/home/lab/OpenFOAM/lab-2.1.0/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam_Epta"
Floating point exception

Could anyone help to solve it?

Thanks a lot,

Samuele

kwardle March 26, 2012 10:21

Looks to me like it is dying on the thermo.correct() line after the hEqn solution. Are you sure your initial conditions are correct/valid? For example, have you verified that your setup works with the standard buoyantPimpleFoam without sources?
Other than that, I have no experience with this thermo model so I can't really say much.
Good luck.

samiam1000 March 27, 2012 04:54

1 Attachment(s)
Dear Kent, Dear All,

first of all, thanks for answering.

Actually, I did try my case with the standard buoyantSimpleFoam solver and - tough a bit slow - it works.

Now it is a bit different: I've edited my solver (see attached) and I get this error: when I write
Code:

    sources.constrain(hEqn);
I get this error:
Code:

lab@lab-laptop:~/Documenti/cases_OF/OF_case10_unsteady1_mod$ buoyantPimpleFoam_Epta
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  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  : buoyantPimpleFoam_Epta
Date  : Mar 27 2012
Time  : 10:50:08
Host  : "lab-laptop"
PID    : 5316
Case  : /home/lab/Documenti/cases_OF/OF_case10_unsteady1_mod
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


Reading g
Reading thermophysical properties

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

Reading/calculating face flux field phi

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

Creating field source list from sourcesProperties

Selecting source model type scalarExplicitSetValue
    Source: air_infinite
    - selecting cells using cellSet infinite_air
    - selected 2730 cell(s) with volume 1.2

Courant Number mean: 0 max: 0

PIMPLE: Operating solver in PISO mode


Starting time loop

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

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 9.76351e-07, No Iterations 43
DILUPBiCG:  Solving for Uy, Initial residual = 1, Final residual = 9.9149e-07, No Iterations 41
DILUPBiCG:  Solving for Uz, Initial residual = 1, Final residual = 9.41257e-07, No Iterations 27
Ok qui - test 1 (file hEqn.H)

DILUPBiCG:  Solving for h, Initial residual = 1, Final residual = 9.89139e-07, No Iterations 46
Ok qui - test 2 (file hEqn.H)

#0  Foam::error::printStack(Foam::Ostream&)^C
lab@lab-laptop:~/Documenti/cases_OF/OF_case10_unsteady1_mod$

Any idea?

samiam1000 April 2, 2012 04:59

1 Attachment(s)
Dear Kent, Dear All,

I still have some problems with the buoyantPimpleFoam_Epta.

It is very strange, since I have done the same modification I did with the steady solver.

When I run it, trying to impose the velocity, I get this error message:
Code:

lab@lab-laptop:~/Documenti/cases_OF/OF_case09_steady_vs_unsteady/unsteady_mod$ buoyantPimpleFoam_Epta
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  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  : buoyantPimpleFoam_Epta
Date  : Apr 02 2012
Time  : 10:45:33
Host  : "lab-laptop"
PID    : 4310
Case  : /home/lab/Documenti/cases_OF/OF_case09_steady_vs_unsteady/unsteady_mod
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


Reading g
Reading thermophysical properties

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

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
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

Creating field source list from sourcesProperties

Selecting source model type vectorExplicitSetValue
    Source: air_infinite
    - selecting cells using cellSet air_infinite
    - selected 2730 cell(s) with volume 1.2

Courant Number mean: 0.000552417 max: 5.02789

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


Starting time loop

Courant Number mean: 8.24029e-05 max: 0.75
deltaT = 0.0298336
Time = 0.0298336

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
PIMPLE: iteration 1
buoyantPimpleFoam_Epta: malloc.c:4630: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned long)(nb)' failed.
Aborted

Attached you can find the last version of the solver I modified.

Could you help?

Thanks a lot,

Samuele

samiam1000 April 3, 2012 05:56

2 Attachment(s)
Here the 2 solvers.

buoyantSimpleFoam works properly, buoyantPimpleFoam doesn't. Any idea?

Thanks a lot,

Samuele

wyldckat April 3, 2012 06:31

Hi Samuele,

Unfortunately I'm not experienced enough yet to be able to simply look at a modified solver source code and indicate where the problem might be.

I'm not sure if I would be able to point out the problem with examples cases either... But for other people with a bit more experience, it would be good if you also provided an example case for each solver, so anyone can do some trial-and-error in figuring out what's wrong with it!

Best regards,
Bruno

samiam1000 April 3, 2012 06:37

This is the link to my case. I provide only the case that I need to solve using buoyanyPimpleFoam_Epta, since buoyanySimpleFoam_Epta works properly.

Thanks a lot
Samuele

kwardle April 3, 2012 10:42

You example case is missing polyMesh/sets and does not run. You have not included a topoSetDict so I am not sure how you are setting this. Seems like you mentioned some way to set this from you cellZone. Please instruct.

samiam1000 April 3, 2012 10:57

Ooops, sorry.

Let me upload a new case, then.

As far as topoSetDict is concerned, I do not need it.

In buoyantSimpleFoam_Epta I run (successefully!) the case without that file.

Here you can download the new case.

Thanks a lot,

Samuele

kwardle April 3, 2012 11:12

Runs with no problem on my machine. Based on the malloc error you are seeing, probably it is linking to the wrong library somewhere and you need to recompile it. Try to wclean and then wmake again the solver and see if it works.

BTW, I also ran with 8 cores no problems.

samiam1000 April 3, 2012 11:20

Sorry,

my solver with this case works because you don't have any source applied.

The point is that when you add the sourcesProperties file in the constant folder something strange happens.

You could try, copying this text in an empty file and saving it as sourcesProperties in the constant folder:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      sourcesProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

air_infinite
{
    //type            vectorExplicitSetValue;
    type            scalarExplicitSetValue;
    active          true;
    timeStart      0;
    duration        100;
    selectionMode  cellSet;
    cellSet        air_infinite;

    //vectorExplicitSetValueCoeffs
    scalarExplicitSetValueCoeffs
    {
        volumeMode      absolute; //specific
        injectionRate
        {
            //U              (0 0.2 0);
            h              278000;
        }
    }
}

Could you kindly try?

Thanks a lot,

Sam

kwardle April 3, 2012 12:18

Looks like the problem is with thermo.correct(). Perhaps there is some reason this does not work with sources? Unfortunately I have no experience with this specific class of solvers.

samiam1000 April 4, 2012 02:55

1 Attachment(s)
Hi Kent and thanks again for answering.

Actually, if you look at the buoyanSimpleFoam_Epta (attached here!), you can see that it is the same and that the sources can work with the thermo.correct.

It's strange: it works with the steady case, but it doesn't with the unsteady.

Does anyone have an idea?

Thanks,

Sam

samiam1000 April 5, 2012 04:09

2 Attachment(s)
Hey Kent, Hey all,

pardon the question, but what about thermo.correct? Which files are linked to this line and what it does?

Thanks a lot,

Samuele


All times are GMT -4. The time now is 03:57.